Internal Server Error when using resoning

When attempting to run a query with reasoning enabled, I get Internal Server Error.
I have tried it in a the Web Console and in the Command Line.

What could be the issue and how to fix it?

Can you display your query and the Error.

…and anything in stardog.log

I tried the sample query from star dog documentation “SELECT ?s { ?s a :C } LIMIT 10”

Using DL reasoning

ERROR 2018-02-06 03:14:08,827 [stardog-user-28] com.complexible.stardog.protocols.http.server.StardogHttpServiceLoader:accept(231): An unexpected exception was handled by the server
org.openrdf.query.QueryEvaluationException: null
at com.complexible.common.rdf.query.IteratorAsTupleQueryResult.hasNext(IteratorAsTupleQueryResult.java:81) ~[stardog-utils-rdf-5.2.0.jar:?]
at org.openrdf.query.QueryResults.report(QueryResults.java:158) ~[sesame-query-4.0.0.jar:?]
at org.openrdf.query.resultio.QueryResultIO.writeTuple(QueryResultIO.java:449) ~[sesame-queryresultio-api-4.0.0.jar:?]
at com.complexible.stardog.protocols.http.server.ProtocolUtils.writeTupleResponse(ProtocolUtils.java:563) ~[stardog-protocols-http-server-5.2.0.jar:?]
at com.complexible.stardog.protocols.http.server.ProtocolUtils.executeReadQuery(ProtocolUtils.java:470) ~[stardog-protocols-http-server-5.2.0.jar:?]
at com.complexible.stardog.protocols.http.annex.QueryPanelService.executeQuery(QueryPanelService.java:179) ~[stardog-webconsole-annex-5.2.0.jar:?]
at com.complexible.stardog.protocols.http.annex.QueryPanelService.post(QueryPanelService.java:120) ~[stardog-webconsole-annex-5.2.0.jar:?]
at com.stardog.http.server.undertow.jaxrs.ExtractRoutes.lambda$handleIt$5(ExtractRoutes.java:196) ~[stardog-protocols-http-server-5.2.0.jar:?]
at org.apache.shiro.subject.support.SubjectRunnable.doRun(SubjectRunnable.java:120) ~[shiro-core-1.2.3.jar:1.2.3]
at org.apache.shiro.subject.support.SubjectRunnable.run(SubjectRunnable.java:108) ~[shiro-core-1.2.3.jar:1.2.3]
at com.stardog.http.server.undertow.ErrorHandling.lambda$safeDispatch$1(ErrorHandling.java:71) ~[stardog-protocols-http-server-5.2.0.jar:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_151]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_151]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_151]
Caused by: com.clarkparsia.pellet.api.exceptions.InconsistentOntologyException
at com.clarkparsia.pellet.api.query.impl.DefaultQueryEngine.execute(DefaultQueryEngine.java:80) ~[stardog-reasoning-shared-5.2.0.jar:?]
at com.clarkparsia.pellet.api.query.impl.AbstractQueryEngine.visit(AbstractQueryEngine.java:104) ~[stardog-reasoning-shared-5.2.0.jar:?]
at com.clarkparsia.pellet.api.query.impl.AbstractQueryEngine.visit(AbstractQueryEngine.java:33) ~[stardog-reasoning-shared-5.2.0.jar:?]
at com.clarkparsia.pellet.api.query.impl.SelectQueryImpl.accept(SelectQueryImpl.java:43) ~[stardog-reasoning-shared-5.2.0.jar:?]
at com.clarkparsia.pellet.api.query.impl.AbstractQueryEngine.execute(AbstractQueryEngine.java:42) ~[stardog-reasoning-shared-5.2.0.jar:?]
at com.complexible.stardog.reasoning.pellet.PelletUtils.executeQuery(PelletUtils.java:88) ~[stardog-reasoning-core-5.2.0.jar:?]
at com.complexible.stardog.reasoning.pellet.PelletOp.computeNext(PelletOp.java:84) ~[stardog-reasoning-core-5.2.0.jar:?]
at com.complexible.stardog.reasoning.pellet.PelletOp.computeNext(PelletOp.java:35) ~[stardog-reasoning-core-5.2.0.jar:?]
at com.complexible.common.collect.AbstractSkippingIterator.tryToComputeNext(AbstractSkippingIterator.java:143) ~[stardog-utils-common-5.2.0.jar:?]
at com.complexible.common.collect.AbstractSkippingIterator.hasNext(AbstractSkippingIterator.java:130) ~[stardog-utils-common-5.2.0.jar:?]
at com.complexible.stardog.plan.eval.operator.impl.SingleProjectionOp.computeNext(SingleProjectionOp.java:71) ~[stardog-5.2.0.jar:?]
at com.complexible.stardog.plan.eval.operator.impl.SingleProjectionOp.computeNext(SingleProjectionOp.java:30) ~[stardog-5.2.0.jar:?]
at com.complexible.common.collect.AbstractSkippingIterator.tryToComputeNext(AbstractSkippingIterator.java:143) ~[stardog-utils-common-5.2.0.jar:?]
at com.complexible.common.collect.AbstractSkippingIterator.hasNext(AbstractSkippingIterator.java:130) ~[stardog-utils-common-5.2.0.jar:?]
at com.complexible.stardog.plan.eval.operator.impl.SliceOp._hasNext(SliceOp.java:87) ~[stardog-5.2.0.jar:?]
at com.complexible.stardog.plan.eval.operator.impl.SliceOp.computeNext(SliceOp.java:95) ~[stardog-5.2.0.jar:?]
at com.complexible.stardog.plan.eval.operator.impl.SliceOp.computeNext(SliceOp.java:26) ~[stardog-5.2.0.jar:?]
at com.complexible.common.collect.AbstractSkippingIterator.tryToComputeNext(AbstractSkippingIterator.java:143) ~[stardog-utils-common-5.2.0.jar:?]
at com.complexible.common.collect.AbstractSkippingIterator.hasNext(AbstractSkippingIterator.java:130) ~[stardog-utils-common-5.2.0.jar:?]
at com.complexible.stardog.plan.eval.operator.util.AutoCloseOperator.computeNext(AutoCloseOperator.java:112) ~[stardog-5.2.0.jar:?]
at com.complexible.stardog.plan.eval.operator.util.AutoCloseOperator.computeNext(AutoCloseOperator.java:25) ~[stardog-5.2.0.jar:?]
at com.complexible.common.collect.AbstractSkippingIterator.tryToComputeNext(AbstractSkippingIterator.java:143) ~[stardog-utils-common-5.2.0.jar:?]
at com.complexible.common.collect.AbstractSkippingIterator.hasNext(AbstractSkippingIterator.java:130) ~[stardog-utils-common-5.2.0.jar:?]
at com.complexible.stardog.plan.eval.operator.util.OpBasedBindingSetIteration.computeNext(OpBasedBindingSetIteration.java:110) ~[stardog-5.2.0.jar:?]
at com.complexible.stardog.plan.eval.operator.util.OpBasedBindingSetIteration.computeNext(OpBasedBindingSetIteration.java:34) ~[stardog-5.2.0.jar:?]
at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:143) ~[guava-18.0.jar:?]
at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:138) ~[guava-18.0.jar:?]
at com.complexible.common.rdf.query.IteratorAsTupleQueryResult.hasNext(IteratorAsTupleQueryResult.java:77) ~[stardog-utils-rdf-5.2.0.jar:?]
… 13 more

I think that the clause “where” is missing

try this: SELECT ?s WHERE{ ?s a :C } LIMIT 10

We’ll improve the error message but the ultimate problem is that your ontology is inconsistent. You can use the stardog reasoning consistency myDb command to double check it or stardog reasoning explain --inconsistency to explain it.

Best,
Pavel

WHERE keyword is optional in SELECT queries in SPARQL.

Best,
Pavel

./stardog reasoning explain -v myDB --inconsistency

Resulted in this:
Java heap space
The detailed stack trace for the error is:
com.complexible.stardog.cli.CliException: Java heap space
at com.complexible.stardog.cli.impl.ConnectionCommand.call(ConnectionCommand.java:80)
at com.complexible.stardog.cli.CLIBase.execute(CLIBase.java:55)
at com.complexible.stardog.cli.CLI.main(CLI.java:120)
Caused by: com.complexible.stardog.protocols.http.client.BaseHttpClient$HttpClientException: Java heap space
at com.complexible.stardog.protocols.http.client.BaseHttpClient.checkResponseCode(BaseHttpClient.java:486)
at com.complexible.stardog.protocols.http.client.BaseHttpClient.execute(BaseHttpClient.java:320)
at com.complexible.stardog.protocols.http.client.HttpClientImpl.connect(HttpClientImpl.java:171)
at com.complexible.stardog.protocols.http.client.HttpConnection.create(HttpConnection.java:89)
at com.complexible.stardog.protocols.http.client.HttpDriver.connect(HttpDriver.java:72)
at com.complexible.stardog.api.DriverManager.getConnection(DriverManager.java:83)
at com.complexible.stardog.api.ConnectionConfiguration.connect(ConnectionConfiguration.java:130)
at com.complexible.stardog.cli.impl.ConnectionCommand.connect(ConnectionCommand.java:129)
at com.complexible.stardog.cli.impl.ConnectionCommand.call(ConnectionCommand.java:67)
… 2 more

So, finally I made sure that the dataset is consistent.
My query:

SELECT (COUNT(*) as ?instanceCount) WHERE { ?s <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> ?o. ?o <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> ?s. }
This returns Internal Server Error. No new log in Stardog.log
Using SL reasoning

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.