child node problem

Tuesday, 27 March 2018 · 3 messages · last reply 4 Apr 2018
GC
Giuseppe Celano27 Mar 2018 18:49 #
Hi All, Thanks for this new release, which looks great! I have found a problem though (see error message below), when running a query like:
for $ee in collection("my-path-to-files")
where $ee//case[./aspect-values[@sign = "yes"]]
return
$ee
This works in version 8.6.7. The problem seems to be [./aspect-values[@sign = "yes"]]: if I change it in [//aspect-values[@sign = "yes"]] it works fine also in 9.0. Any idea? Thanks. Best, Giuseppe ERROR MESSAGE Error: Improper use? Potential bug? Your feedback is welcome: Contact: basex-talk at mailman.uni-konstanz.de Version: BaseX 9.0 Java: Oracle Corporation, 1.8.0_151 OS: Mac OS X, x86_64 Stack Trace:
java.lang.ClassCastException: org.basex.query.value.item.Dummy cannot be cast to org.basex.query.value.node.DBNode
	at org.basex.query.expr.path.InvDocTest.get(InvDocTest.java:56)
	at org.basex.query.expr.path.Path.index(Path.java:692)
	at org.basex.query.expr.path.Path.optimize(Path.java:174)
	at org.basex.query.expr.path.Path.optimize(Path.java:180)
	at org.basex.query.expr.path.Path.compile(Path.java:157)
	at org.basex.query.expr.gflwor.Where.compile(Where.java:53)
	at org.basex.query.expr.gflwor.Where.compile(Where.java:1)
	at org.basex.query.expr.gflwor.GFLWOR.compile(GFLWOR.java:101)
	at org.basex.query.scope.MainModule.comp(MainModule.java:83)
	at org.basex.query.QueryCompiler.compile(QueryCompiler.java:114)
	at org.basex.query.QueryCompiler.compile(QueryCompiler.java:105)
	at org.basex.query.QueryContext.compile(QueryContext.java:299)
	at org.basex.query.QueryProcessor.compile(QueryProcessor.java:79)
	at org.basex.core.cmd.AQuery.query(AQuery.java:78)
	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:427)
	at org.basex.gui.GUI.lambda$4(GUI.java:370)
	at java.lang.Thread.run(Thread.java:748)
Compiling:
- pre-evaluate fn:collection([uri]) to document-node() sequence: collection("/Users/mycomputer/Documents/... -> (db:open-pre("documents", 0), ...)
- rewrite cached path to = operator: *:aspect-values -> (*:aspect-values/@*:sign = "yes")
- rewrite cached path to = operator: *:aspect-values -> (*:aspect-values/@*:sign = "yes")
- rewrite descendant-or-self step(s)
- apply attribute index for "yes"
Optimized Query:
for $ee_0 in (db:open-pre("documents", 0), ...) where $ee_0/descendant-or-self::node()/descendant::*:case[(*:aspect-values/@*:sign = "yes")] return $ee_0
Query:
for $ee in collection("/Users/mycomputer/Documents/act/03_p-valuesAfterReductionToPerfImp/documents") where $ee//case[./aspect-values[@sign = "yes"]] return $ee
Universität Leipzig Institute of Computer Science, Digital Humanities Augustusplatz 10 04109 Leipzig Deutschland E-mail: celano at informatik.uni-leipzig.de E-mail: giuseppegacelano at gmail.com Web site 1: http://www.dh.uni-leipzig.de/wo/team/ Web site 2: https://sites.google.com/site/giuseppegacelano/
CG
Christian Grün4 Apr 2018 10:58 #
Hi Giuseppe, A bug fix is available for the issue you’ve reported [1]. If you don’t want to switch over to the snapshot, you can rewrite your query as follows until 9.0.1 is released:
  for $ee in collection("my-path-to-files")
  where $ee//case/aspect-values/@sign = "yes"
  return $ee
Hope this helps, thanks for the kudos, Christian [1] http://files.basex.org/releases/latest/
Quoted text · Giuseppe Celano · 70 lines
On Tue, Mar 27, 2018 at 6:49 PM, Giuseppe Celano <celano at informatik.uni-leipzig.de> wrote: > Hi All, > > Thanks for this new release, which looks great! > > I have found a problem though (see error message below), when running a query like: > > for $ee in collection("my-path-to-files") > where $ee//case[./aspect-values[@sign = "yes"]] > return > $ee > > This works in version 8.6.7. The problem seems to be [./aspect-values[@sign = "yes"]]: if I change it in [//aspect-values[@sign = "yes"]] it works fine also in 9.0. Any idea? Thanks. > > Best, > Giuseppe > > ERROR MESSAGE > > Error: > Improper use? Potential bug? Your feedback is welcome: > Contact: basex-talk at mailman.uni-konstanz.de > Version: BaseX 9.0 > Java: Oracle Corporation, 1.8.0_151 > OS: Mac OS X, x86_64 > Stack Trace: > java.lang.ClassCastException: org.basex.query.value.item.Dummy cannot be cast to org.basex.query.value.node.DBNode > at org.basex.query.expr.path.InvDocTest.get(InvDocTest.java:56) > at org.basex.query.expr.path.Path.index(Path.java:692) > at org.basex.query.expr.path.Path.optimize(Path.java:174) > at org.basex.query.expr.path.Path.optimize(Path.java:180) > at org.basex.query.expr.path.Path.compile(Path.java:157) > at org.basex.query.expr.gflwor.Where.compile(Where.java:53) > at org.basex.query.expr.gflwor.Where.compile(Where.java:1) > at org.basex.query.expr.gflwor.GFLWOR.compile(GFLWOR.java:101) > at org.basex.query.scope.MainModule.comp(MainModule.java:83) > at org.basex.query.QueryCompiler.compile(QueryCompiler.java:114) > at org.basex.query.QueryCompiler.compile(QueryCompiler.java:105) > at org.basex.query.QueryContext.compile(QueryContext.java:299) > at org.basex.query.QueryProcessor.compile(QueryProcessor.java:79) > at org.basex.core.cmd.AQuery.query(AQuery.java:78) > 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:427) > at org.basex.gui.GUI.lambda$4(GUI.java:370) > at java.lang.Thread.run(Thread.java:748) > Compiling: > - pre-evaluate fn:collection([uri]) to document-node() sequence: collection("/Users/mycomputer/Documents/... -> (db:open-pre("documents", 0), ...) > - rewrite cached path to = operator: *:aspect-values -> (*:aspect-values/@*:sign = "yes") > - rewrite cached path to = operator: *:aspect-values -> (*:aspect-values/@*:sign = "yes") > - rewrite descendant-or-self step(s) > - apply attribute index for "yes" > Optimized Query: > for $ee_0 in (db:open-pre("documents", 0), ...) where $ee_0/descendant-or-self::node()/descendant::*:case[(*:aspect-values/@*:sign = "yes")] return $ee_0 > Query: > for $ee in collection("/Users/mycomputer/Documents/act/03_p-valuesAfterReductionToPerfImp/documents") where $ee//case[./aspect-values[@sign = "yes"]] return $ee > > > Universität Leipzig > Institute of Computer Science, Digital Humanities > Augustusplatz 10 > 04109 Leipzig > Deutschland > E-mail: celano at informatik.uni-leipzig.de > E-mail: giuseppegacelano at gmail.com > Web site 1: http://www.dh.uni-leipzig.de/wo/team/ > Web site 2: https://sites.google.com/site/giuseppegacelano/ >
GC
Giuseppe Celano4 Apr 2018 13:03 #
Thanks for this quick reply! Universität Leipzig Institute of Computer Science, Digital Humanities Augustusplatz 10 04109 Leipzig Deutschland E-mail: celano at informatik.uni-leipzig.de E-mail: giuseppegacelano at gmail.com Web site 1: http://www.dh.uni-leipzig.de/wo/team/ Web site 2: https://sites.google.com/site/giuseppegacelano/
Quoted text · Christian Grün · 91 lines
> On Apr 4, 2018, at 10:58 AM, Christian Grün <christian.gruen at gmail.com> wrote: > > Hi Giuseppe, > > A bug fix is available for the issue you’ve reported [1]. > > If you don’t want to switch over to the snapshot, you can rewrite your > query as follows until 9.0.1 is released: > > for $ee in collection("my-path-to-files") > where $ee//case/aspect-values/@sign = "yes" > return $ee > > Hope this helps, thanks for the kudos, > Christian > > [1] http://files.basex.org/releases/latest/ > > > > On Tue, Mar 27, 2018 at 6:49 PM, Giuseppe Celano > <celano at informatik.uni-leipzig.de> wrote: >> Hi All, >> >> Thanks for this new release, which looks great! >> >> I have found a problem though (see error message below), when running a query like: >> >> for $ee in collection("my-path-to-files") >> where $ee//case[./aspect-values[@sign = "yes"]] >> return >> $ee >> >> This works in version 8.6.7. The problem seems to be [./aspect-values[@sign = "yes"]]: if I change it in [//aspect-values[@sign = "yes"]] it works fine also in 9.0. Any idea? Thanks. >> >> Best, >> Giuseppe >> >> ERROR MESSAGE >> >> Error: >> Improper use? Potential bug? Your feedback is welcome: >> Contact: basex-talk at mailman.uni-konstanz.de >> Version: BaseX 9.0 >> Java: Oracle Corporation, 1.8.0_151 >> OS: Mac OS X, x86_64 >> Stack Trace: >> java.lang.ClassCastException: org.basex.query.value.item.Dummy cannot be cast to org.basex.query.value.node.DBNode >> at org.basex.query.expr.path.InvDocTest.get(InvDocTest.java:56) >> at org.basex.query.expr.path.Path.index(Path.java:692) >> at org.basex.query.expr.path.Path.optimize(Path.java:174) >> at org.basex.query.expr.path.Path.optimize(Path.java:180) >> at org.basex.query.expr.path.Path.compile(Path.java:157) >> at org.basex.query.expr.gflwor.Where.compile(Where.java:53) >> at org.basex.query.expr.gflwor.Where.compile(Where.java:1) >> at org.basex.query.expr.gflwor.GFLWOR.compile(GFLWOR.java:101) >> at org.basex.query.scope.MainModule.comp(MainModule.java:83) >> at org.basex.query.QueryCompiler.compile(QueryCompiler.java:114) >> at org.basex.query.QueryCompiler.compile(QueryCompiler.java:105) >> at org.basex.query.QueryContext.compile(QueryContext.java:299) >> at org.basex.query.QueryProcessor.compile(QueryProcessor.java:79) >> at org.basex.core.cmd.AQuery.query(AQuery.java:78) >> 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:427) >> at org.basex.gui.GUI.lambda$4(GUI.java:370) >> at java.lang.Thread.run(Thread.java:748) >> Compiling: >> - pre-evaluate fn:collection([uri]) to document-node() sequence: collection("/Users/mycomputer/Documents/... -> (db:open-pre("documents", 0), ...) >> - rewrite cached path to = operator: *:aspect-values -> (*:aspect-values/@*:sign = "yes") >> - rewrite cached path to = operator: *:aspect-values -> (*:aspect-values/@*:sign = "yes") >> - rewrite descendant-or-self step(s) >> - apply attribute index for "yes" >> Optimized Query: >> for $ee_0 in (db:open-pre("documents", 0), ...) where $ee_0/descendant-or-self::node()/descendant::*:case[(*:aspect-values/@*:sign = "yes")] return $ee_0 >> Query: >> for $ee in collection("/Users/mycomputer/Documents/act/03_p-valuesAfterReductionToPerfImp/documents") where $ee//case[./aspect-values[@sign = "yes"]] return $ee >> >> >> Universität Leipzig >> Institute of Computer Science, Digital Humanities >> Augustusplatz 10 >> 04109 Leipzig >> Deutschland >> E-mail: celano at informatik.uni-leipzig.de >> E-mail: giuseppegacelano at gmail.com >> Web site 1: http://www.dh.uni-leipzig.de/wo/team/ >> Web site 2: https://sites.google.com/site/giuseppegacelano/ >> >

⚡Generated with XQuery