Hi, Christian,

 

Yes, this is a tricky one to reproduce :)

 

I’ve made a short video that illustrates the behavior (attached). Here are the steps that typically (although not always) reproduce the issue for me:

 

  1. Reboot computer.
  2. Start BaseX GUI from command line.
  3. Recreate the sample database for testing.
  4. Run the sample query (wrapped in fn:count). Query returns 3.
  5. Change the query to call fn:count using the sequence arrow operator instead.
  6. Run the sample query again. Query returns 0, and queries are now “broken,” such that repeating step (4) also returns 0.

 

Here’s the additional information:

 

 

All best,

Tim

 

 

-- 
Tim A. Thompson (he, him)
Librarian for Applied Metadata Research
Yale University Library
www.linkedin.com/in/timathompson

 

 

From: Christian Grün <christian.gruen@gmail.com>
Date: Sunday, March 3, 2024 at 6:42 AM
To: Thompson, Timothy <timothy.thompson@yale.edu>
Cc: BaseX <basex-talk@mailman.uni-konstanz.de>
Subject: Re: [basex-talk] Inconsistent behavior for root context in BaseX GUI

Hi Tim,

 

Thanks for your observation. We need more help to reproduce this: Could you describe in detail, and step by step, how to trigger this issue?

 

In addition, you could…

• tell us more about your OS and JDK version

• start BaseX on command line and share a possible stack trace with us

• verify if the error also occurs with other XML input (such as <x/>) and other queries (such as .)

 

The simpler the use case, the better…

 

Thanks

Christian

 

 

 

On Fri, Mar 1, 2024 at 6:11PM Thompson, Timothy <timothy.thompson@yale.edu> wrote:

I’ve been noticing an inconsistent behavior in the GUI with BaseX 11 beta (build 17d8426).

 

I have a simple query on a database created from a CSV file. Sometimes it works, but sometimes the root context is evaluated as an empty sequence:

 

- rewrite context value: . -> ()

- rewrite util:root(nodes): util:root(()) -> ()

 

I notice this when I open the database as context and try to execute the query. After the query fails, if I try to click on the “home” icon in the result panel, it also returns an empty sequence, even though the database is open.

 

If I reopen the database and run the query, it works again.

 

Sample data:

 

<csv>

  <record>

    <entry>http://id.loc.gov/authorities/names/n00000121</entry>

    <entry>http://id.loc.gov/rwo/agents/n00000121</entry>

    <entry>0.11861849</entry>

  </record>

  <record>

    <entry>http://id.loc.gov/authorities/names/n00000122</entry>

    <entry>http://id.loc.gov/rwo/agents/n00000122</entry>

    <entry>0.11699477</entry>

  </record>

  <record>

    <entry>http://id.loc.gov/authorities/names/n00000267</entry>

    <entry>http://id.loc.gov/rwo/agents/n00000267</entry>

    <entry>0.10811427</entry>

  </record>

</csv>

 

Query (with DB open as context):

 

count(distinct-values(

  for $rec in /csv/record 

  where contains($rec/entry[1], "id.loc.gov")

  return $rec/entry[1]

))

 

Thanks in advance,

Tim