One more hint:
If you iterate over documents that are not stored in a database, you can save a lot of main memory by using fetch:xml instead of fn:doc.
As fn:doc is deterministic, all intermediate documents must be kept in main memory in order to ensure that a future access to this file will return the same document node. If you use fetch:xml, the document reference will automatically be dropped in the next step of the iteration.
On Sat, Nov 21, 2020 at 11:32 PM Giuseppe G. A. Celano celano@informatik.uni-leipzig.de wrote:
Hi,
I got an "Improper use? Potential bug?” error (see below) with a (complex) query which actually works when applied to many files (but not to all). This is the query (temporary links):
https://git.informatik.uni-leipzig.de/celano/latinnlp/-/blob/master/scripts/...
applied to all files here:
https://git.informatik.uni-leipzig.de/celano/latinnlp/-/tree/master/texts/pa...
Essentially, I have some words associated to an XPath expression + offsets (see, for example, [1]), which (words) I can retrieve by using substring($xpath, $start, $long) applied to [2]. My goal is to try to identify the text nodes the words are children of, because I want to check whether they are contained in some specific elements.
Ciao, Giuseppe
[1] https://git.informatik.uni-leipzig.de/celano/latinnlp/-/blob/master/texts/pa... [2] https://git.informatik.uni-leipzig.de/celano/latinnlp/-/blob/master/texts/pa...
Error: Improper use? Potential bug? Your feedback is welcome: Contact: basex-talk@mailman.uni-konstanz.de Version: BaseX 9.3.2 Java: Ubuntu, 11.0.9.1 OS: Linux, amd64 Stack Trace: java.lang.ArrayIndexOutOfBoundsException: Maximum array size reached. at org.basex.util.Array.newSize(Array.java:299) at org.basex.util.Array.newSize(Array.java:288) at org.basex.util.TokenBuilder.add(TokenBuilder.java:267) at org.basex.util.TokenBuilder.add(TokenBuilder.java:252) at org.basex.query.QueryInfo.toString(QueryInfo.java:142) at org.basex.query.QueryContext.info(QueryContext.java:474) at org.basex.query.QueryProcessor.info(QueryProcessor.java:272) at org.basex.core.cmd.AQuery.extError(AQuery.java:212) at org.basex.core.cmd.AQuery.query(AQuery.java:130) at org.basex.core.cmd.XQuery.run(XQuery.java:22) at org.basex.core.Command.run(Command.java:257) at org.basex.core.Command.execute(Command.java:93) at org.basex.gui.GUI.exec(GUI.java:416) at org.basex.gui.GUI.lambda$execute$4(GUI.java:359) at java.base/java.lang.Thread.run(Thread.java:834)