You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The queried resource is a (public) online json-ld document.
With sparql-anything client v0.8.1, I get this trace:
$ java -jar ~/.local/share/java/sparql-anything-0.8.1.jar -q pflu_query_005.rq
[main] INFO com.github.sparqlanything.cli.SPARQLAnything - SPARQL anything
[main] INFO com.github.sparqlanything.rdf.RDFTriplifier - URL http://pflu.evolbio.mpg.de/web-services/content/v0.1
[main] ERROR com.github.sparqlanything.engine.FacadeXOpExecutor - An error occurred: java.lang.StringIndexOutOfBoundsException: Range [0, -1) out of bounds for length 19
Exception in thread "main" java.lang.RuntimeException: java.io.IOException: java.lang.StringIndexOutOfBoundsException: Range [0, -1) out of bounds for length 19 at com.github.sparqlanything.engine.FacadeXOpExecutor.execute(FacadeXOpExecutor.java:69)
at org.apache.jena.sparql.engine.main.ExecutionDispatch.visit(ExecutionDispatch.java:203)
at org.apache.jena.sparql.algebra.op.OpService.visit(OpService.java:56)
at org.apache.jena.sparql.engine.main.ExecutionDispatch.exec(ExecutionDispatch.java:46)
at org.apache.jena.sparql.engine.main.OpExecutor.exec(OpExecutor.java:118)
at org.apache.jena.sparql.engine.main.OpExecutor.execute(OpExecutor.java:390)
at org.apache.jena.sparql.engine.main.ExecutionDispatch.visit(ExecutionDispatch.java:267)
at org.apache.jena.sparql.algebra.op.OpProject.visit(OpProject.java:47)
at org.apache.jena.sparql.engine.main.ExecutionDispatch.exec(ExecutionDispatch.java:46)
at org.apache.jena.sparql.engine.main.OpExecutor.exec(OpExecutor.java:118)
at org.apache.jena.sparql.engine.main.OpExecutor.execute(OpExecutor.java:412)
at org.apache.jena.sparql.engine.main.ExecutionDispatch.visit(ExecutionDispatch.java:275)
at org.apache.jena.sparql.algebra.op.OpDistinct.visit(OpDistinct.java:47)
at org.apache.jena.sparql.engine.main.ExecutionDispatch.exec(ExecutionDispatch.java:46)
at org.apache.jena.sparql.engine.main.OpExecutor.exec(OpExecutor.java:118)
at org.apache.jena.sparql.engine.main.OpExecutor.execute(OpExecutor.java:400)
at org.apache.jena.sparql.engine.main.ExecutionDispatch.visit(ExecutionDispatch.java:307)
at org.apache.jena.sparql.algebra.op.OpSlice.visit(OpSlice.java:50)
at org.apache.jena.sparql.engine.main.ExecutionDispatch.exec(ExecutionDispatch.java:46)
at org.apache.jena.sparql.engine.main.OpExecutor.exec(OpExecutor.java:118)
at org.apache.jena.sparql.engine.main.OpExecutor.execute(OpExecutor.java:89)
at org.apache.jena.sparql.engine.main.QC.execute(QC.java:53)
at org.apache.jena.sparql.engine.main.QueryEngineMain.eval(QueryEngineMain.java:55)
at org.apache.jena.sparql.engine.QueryEngineBase.evaluate(QueryEngineBase.java:176)
at org.apache.jena.sparql.engine.QueryEngineBase.createPlan(QueryEngineBase.java:132)
at org.apache.jena.sparql.engine.QueryEngineBase.getPlan(QueryEngineBase.java:113)
at org.apache.jena.sparql.engine.main.QueryEngineMain$QueryEngineMainFactory.create(QueryEngineMain.java:90)
at org.apache.jena.sparql.engine.QueryExecutionBase.getPlan(QueryExecutionBase.java:622)
at org.apache.jena.sparql.engine.QueryExecutionBase.startQueryIterator(QueryExecutionBase.java:556)
at org.apache.jena.sparql.engine.QueryExecutionBase.execResultSet(QueryExecutionBase.java:612)
at org.apache.jena.sparql.engine.QueryExecutionBase.execSelect(QueryExecutionBase.java:198)
at com.github.sparqlanything.cli.SPARQLAnything.executeQuery(SPARQLAnything.java:95)
at com.github.sparqlanything.cli.SPARQLAnything.main(SPARQLAnything.java:512)
Caused by: java.io.IOException: java.lang.StringIndexOutOfBoundsException: Range [0, -1) out of bounds for length 19
at com.github.sparqlanything.engine.DatasetGraphCreator.triplify(DatasetGraphCreator.java:209)
at com.github.sparqlanything.engine.DatasetGraphCreator.getDatasetGraph(DatasetGraphCreator.java:80)
at com.github.sparqlanything.engine.FacadeXOpExecutor.executeDefaultFacadeX(FacadeXOpExecutor.java:152)
at com.github.sparqlanything.engine.FacadeXOpExecutor.execute(FacadeXOpExecutor.java:64)
... 32 more
Caused by: java.lang.StringIndexOutOfBoundsException: Range [0, -1) out of bounds for length 19
at java.base/jdk.internal.util.Preconditions$1.apply(Preconditions.java:55)
at java.base/jdk.internal.util.Preconditions$1.apply(Preconditions.java:52)
at java.base/jdk.internal.util.Preconditions$4.apply(Preconditions.java:213)
at java.base/jdk.internal.util.Preconditions$4.apply(Preconditions.java:210)
at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:98)
at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckFromToIndex(Preconditions.java:112)
at java.base/jdk.internal.util.Preconditions.checkFromToIndex(Preconditions.java:349)
at java.base/java.lang.String.checkBoundsBeginEnd(String.java:4602)
at java.base/java.lang.String.substring(String.java:2715)
at com.github.sparqlanything.rdf.RDFTriplifier.getRDFLang(RDFTriplifier.java:85)
at com.github.sparqlanything.rdf.RDFTriplifier.triplify(RDFTriplifier.java:75)
at com.github.sparqlanything.engine.DatasetGraphCreator.triplify(DatasetGraphCreator.java:197)
... 35 more
Workaround
I have to go back to v0.7.0 (0.8.0 not tested) to get the expected results:
$ java -jar ~/.local/share/java/sparql-anything-0.7.0.jar -q pflu_query_005.rq
[main] INFO com.github.sparqlanything.cli.SPARQLAnything - SPARQL anything
[main] INFO com.github.sparqlanything.rdf.RDFTriplifier - URL http://pflu.evolbio.mpg.de/web-services/content/v0.1
s,p,o
http://pflu.evolbio.mpg.de/web-services/content/v0.1/Heritable_Phenotypic_Marker,http://www.w3.org/2000/01/rdf-schema#label,Heritable Phenotypic Marker Collection
http://pflu.evolbio.mpg.de/web-services/content/v0.1/Heritable_Phenotypic_Marker,http://www.w3.org/2000/01/rdf-schema#comment,A collection of Heritable Phenotypic Marker resources: a biological_region characterized as a single heritable trait in a phenotype screen. The heritable phenotype may be mapped to a chromosome but generally has not been characterized to a specific gene locus. [JAX:hdene]
http://pflu.evolbio.mpg.de/web-services/content/v0.1/Heritable_Phenotypic_Marker,http://www.w3.org/1999/02/22-rdf-syntax-ns#type,http://pflu.evolbio.mpg.de/web-services/doc/v0.1#Heritable_Phenotypic_Marker_Collection
http://pflu.evolbio.mpg.de/web-services/content/v0.1/Signal_Peptide,http://www.w3.org/2000/01/rdf-schema#label,Signal Peptide Collection
http://pflu.evolbio.mpg.de/web-services/content/v0.1/Signal_Peptide,http://www.w3.org/2000/01/rdf-schema#comment,A collection of Signal Peptide resources: the signal_peptide is a short region of the peptide located at the N-terminus that directs the protein to be secreted or part of membrane components. [http://www.insdc.org/files/feature_table.html]
http://pflu.evolbio.mpg.de/web-services/content/v0.1/Signal_Peptide,http://www.w3.org/1999/02/22-rdf-syntax-ns#type,http://pflu.evolbio.mpg.de/web-services/doc/v0.1#Signal_Peptide_Collection
http://pflu.evolbio.mpg.de/web-services/content/v0.1/mRNA,http://www.w3.org/2000/01/rdf-schema#label,mRNA Collection
http://pflu.evolbio.mpg.de/web-services/content/v0.1/mRNA,http://www.w3.org/2000/01/rdf-schema#comment,A collection of mRNA resources: messenger RNA is the intermediate molecule between DNA and protein. It includes UTR and coding sequences. It does not contain introns. [SO:ma]
http://pflu.evolbio.mpg.de/web-services/content/v0.1/mRNA,http://www.w3.org/1999/02/22-rdf-syntax-ns#type,http://pflu.evolbio.mpg.de/web-services/doc/v0.1#mRNA_Collection
http://pflu.evolbio.mpg.de/web-services/content/v0.1/Repeat_Region,http://www.w3.org/2000/01/rdf-schema#label,Repeat Region Collection
Environment:
OS: ubuntu-22.04
java:
$ java --version
openjdk 19.0.2 2023-01-17
OpenJDK Runtime Environment (build 19.0.2+7-Ubuntu-0ubuntu322.04)
OpenJDK 64-Bit Server VM (build 19.0.2+7-Ubuntu-0ubuntu322.04, mixed mode, sharing)
The text was updated successfully, but these errors were encountered:
This bug was introduced when we reworked the RDF connector after v0.8.1. The problem was solved in #317, so the next release will include the fix.
However, when I try the query with the current development version the query works from a Java Test but the result set from the CLI is empty. This needs to be investigated.
This last problem was a side effect of #339 where we wanted to load files with extension .json as jsonld documents (because the -l option expects the content to be RDF)
The problem should be fixed in the v0.9-DEV branch. I opened #357 to leave a review of the current approach for the future, as this solution feels a bit convoluted.
Summary
Running a simple query with sparql-anything client on a online json-ld document fails if version 0.8.1 is used.
To reproduce:
run this query with
sparql-anything-0.8.1.jar
:The queried resource is a (public) online json-ld document.
With sparql-anything client v0.8.1, I get this trace:
Workaround
I have to go back to v0.7.0 (0.8.0 not tested) to get the expected results:
Environment:
OS: ubuntu-22.04
java:
The text was updated successfully, but these errors were encountered: