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<http://id.loc.gov/authorities/names/n00000121%3c/entry>>
    
<entry>http://id.loc.gov/rwo/agents/n00000121</entry<http://id.loc.gov/rwo/agents/n00000121%3c/entry>>
    <entry>0.11861849</entry>
  </record>
  <record>
    
<entry>http://id.loc.gov/authorities/names/n00000122</entry<http://id.loc.gov/authorities/names/n00000122%3c/entry>>
    
<entry>http://id.loc.gov/rwo/agents/n00000122</entry<http://id.loc.gov/rwo/agents/n00000122%3c/entry>>
    <entry>0.11699477</entry>
  </record>
  <record>
    
<entry>http://id.loc.gov/authorities/names/n00000267</entry<http://id.loc.gov/authorities/names/n00000267%3c/entry>>
    
<entry>http://id.loc.gov/rwo/agents/n00000267</entry<http://id.loc.gov/rwo/agents/n00000267%3c/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


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

Reply via email to