Internal Server Error on Query with TransitiveProperty

I upgraded from Stardog 5.0.3 to 5.1.0 and now I am getting an Internal Server Error on the query below with reasoning on:

select ?o where {
  <http://example.com/LL/lagin.ttl#RossRuad> rel:ancestorOf ?o
}

The query works on Stardog 5.0.3 and produces the expected results.

The error when I run the query:

ERROR 2018-01-07 15:30:57,972 [XNIO-1 task-36] com.complexible.stardog.protocols.http.server.StardogHttpServiceLoader:accept(231): An unexpected exception was handled by the server
org.openrdf.query.QueryEvaluationException: Invalid plan node argument: Empty
	at com.complexible.common.rdf.query.IteratorAsTupleQueryResult.hasNext(IteratorAsTupleQueryResult.java:81) ~[stardog-utils-rdf-5.1.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.1.0.jar:?]
	at com.complexible.stardog.protocols.http.server.ProtocolUtils.executeReadQuery(ProtocolUtils.java:470) ~[stardog-protocols-http-server-5.1.0.jar:?]
	at com.complexible.stardog.protocols.http.annex.QueryPanelService.executeQuery(QueryPanelService.java:179) ~[stardog-webconsole-annex-5.1.0.jar:?]
	at com.complexible.stardog.protocols.http.annex.QueryPanelService.post(QueryPanelService.java:120) ~[stardog-webconsole-annex-5.1.0.jar:?]
	at com.stardog.http.server.undertow.jaxrs.ExtractRoutes.lambda$handleIt$5(ExtractRoutes.java:192) ~[stardog-protocols-http-server-5.1.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.1.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: java.lang.IllegalArgumentException: Invalid plan node argument: Empty
	at com.google.common.base.Preconditions.checkArgument(Preconditions.java:145) ~[guava-18.0.jar:?]
	at com.complexible.stardog.reasoning.equality.CanonicalizePlanNode.<init>(CanonicalizePlanNode.java:36) ~[stardog-reasoning-core-5.1.0.jar:?]
	at com.complexible.stardog.reasoning.equality.CanonicalizePlanNode.<init>(CanonicalizePlanNode.java:25) ~[stardog-reasoning-core-5.1.0.jar:?]
	at com.complexible.stardog.reasoning.equality.CanonicalizePlanNode$Builder.createNode(CanonicalizePlanNode.java:89) ~[stardog-reasoning-core-5.1.0.jar:?]
	at com.complexible.stardog.reasoning.equality.CanonicalizePlanNode$Builder.createNode(CanonicalizePlanNode.java:84) ~[stardog-reasoning-core-5.1.0.jar:?]
	at com.complexible.stardog.plan.AbstractPlanNodeBuilder.build(AbstractPlanNodeBuilder.java:87) ~[stardog-5.1.0.jar:?]
	at com.complexible.stardog.plan.TransformingPlanNodeVisitor.unaryTransform(TransformingPlanNodeVisitor.java:82) ~[stardog-5.1.0.jar:?]
	at com.complexible.stardog.plan.TransformingPlanNodeVisitor.transform(TransformingPlanNodeVisitor.java:182) ~[stardog-5.1.0.jar:?]
	at com.complexible.stardog.plan.TransformingPlanNodeVisitor.visit(TransformingPlanNodeVisitor.java:764) ~[stardog-5.1.0.jar:?]
	at com.complexible.stardog.plan.AbstractReasoningPlanNode.accept(AbstractReasoningPlanNode.java:121) ~[stardog-5.1.0.jar:?]
	at com.complexible.stardog.plan.TransformingPlanNodeVisitor.unaryVisit(TransformingPlanNodeVisitor.java:598) ~[stardog-5.1.0.jar:?]
	at com.complexible.stardog.plan.TransformingPlanNodeVisitor.unaryTransform(TransformingPlanNodeVisitor.java:80) ~[stardog-5.1.0.jar:?]
	at com.complexible.stardog.plan.TransformingPlanNodeVisitor.transform(TransformingPlanNodeVisitor.java:132) ~[stardog-5.1.0.jar:?]
	at com.complexible.stardog.plan.TransformingPlanNodeVisitor.visit(TransformingPlanNodeVisitor.java:844) ~[stardog-5.1.0.jar:?]
	at com.complexible.stardog.plan.BindPlanNodeImpl.accept(BindPlanNodeImpl.java:130) ~[stardog-5.1.0.jar:?]
	at com.complexible.stardog.plan.TransformingPlanNodeVisitor.binaryVisit(TransformingPlanNodeVisitor.java:615) ~[stardog-5.1.0.jar:?]
	at com.complexible.stardog.plan.TransformingPlanNodeVisitor.binaryTransform(TransformingPlanNodeVisitor.java:88) ~[stardog-5.1.0.jar:?]
	at com.complexible.stardog.plan.TransformingPlanNodeVisitor.transform(TransformingPlanNodeVisitor.java:122) ~[stardog-5.1.0.jar:?]
	at com.complexible.stardog.plan.TransformingPlanNodeVisitor.visit(TransformingPlanNodeVisitor.java:804) ~[stardog-5.1.0.jar:?]
	at com.complexible.stardog.plan.UnionPlanNodeImpl.accept(UnionPlanNodeImpl.java:88) ~[stardog-5.1.0.jar:?]
	at com.complexible.stardog.plan.TransformingPlanNodeVisitor.unaryVisit(TransformingPlanNodeVisitor.java:598) ~[stardog-5.1.0.jar:?]
	at com.complexible.stardog.plan.TransformingPlanNodeVisitor.unaryTransform(TransformingPlanNodeVisitor.java:80) ~[stardog-5.1.0.jar:?]
	at com.complexible.stardog.plan.TransformingPlanNodeVisitor.transform(TransformingPlanNodeVisitor.java:182) ~[stardog-5.1.0.jar:?]
	at com.complexible.stardog.plan.TransformingPlanNodeVisitor.visit(TransformingPlanNodeVisitor.java:764) ~[stardog-5.1.0.jar:?]
	at com.complexible.stardog.plan.AbstractReasoningPlanNode.accept(AbstractReasoningPlanNode.java:121) ~[stardog-5.1.0.jar:?]
	at com.complexible.stardog.plan.optimizer.VisitingPlanNodeOptimizer.optimize(VisitingPlanNodeOptimizer.java:33) ~[stardog-5.1.0.jar:?]
	at com.complexible.stardog.plan.optimizer.OptimizationPipeline.execute(OptimizationPipeline.java:124) ~[stardog-5.1.0.jar:?]
	at com.complexible.stardog.plan.eval.operator.impl.RecursiveOperators.optimize(RecursiveOperators.java:610) ~[stardog-5.1.0.jar:?]
	at com.complexible.stardog.plan.eval.operator.impl.RecursiveOperators.access$100(RecursiveOperators.java:102) ~[stardog-5.1.0.jar:?]
	at com.complexible.stardog.plan.eval.operator.impl.RecursiveOperators$GeneralAdjacentNodeIteratorProvider.getIteratorOverAdjacentNodes(RecursiveOperators.java:682) ~[stardog-5.1.0.jar:?]
	at com.complexible.stardog.plan.eval.operator.impl.RecursiveOperators$PathStartIteratorProviderImpl.getIteratorOverAdjacentNodes(RecursiveOperators.java:901) ~[stardog-5.1.0.jar:?]
	at com.complexible.stardog.query.paths.PathStartIteratorProvider.getIteratorOverAdjacentNodes(PathStartIteratorProvider.java:22) ~[stardog-5.1.0.jar:?]
	at com.complexible.stardog.query.paths.PredicatePlusChainIteratorImpl.getIteratorOverAdjacentNodes(PredicatePlusChainIteratorImpl.java:158) ~[stardog-5.1.0.jar:?]
	at com.complexible.stardog.query.paths.PredicatePlusChainIteratorImpl.nextEndIterator(PredicatePlusChainIteratorImpl.java:152) ~[stardog-5.1.0.jar:?]
	at com.complexible.stardog.query.paths.PredicatePlusChainIteratorImpl.hasNext(PredicatePlusChainIteratorImpl.java:87) ~[stardog-5.1.0.jar:?]
	at com.complexible.stardog.plan.eval.operator.impl.PropertyPathOpImpl.computeNext(PropertyPathOpImpl.java:74) ~[stardog-5.1.0.jar:?]
	at com.complexible.stardog.plan.eval.operator.impl.PropertyPathOpImpl.computeNext(PropertyPathOpImpl.java:25) ~[stardog-5.1.0.jar:?]
	at com.complexible.common.collect.AbstractSkippingIterator.tryToComputeNext(AbstractSkippingIterator.java:143) ~[stardog-utils-common-5.1.0.jar:?]
	at com.complexible.common.collect.AbstractSkippingIterator.hasNext(AbstractSkippingIterator.java:130) ~[stardog-utils-common-5.1.0.jar:?]
	at com.complexible.stardog.reasoning.equality.CanonicalizeOperator.getNextNonCanonical(CanonicalizeOperator.java:186) ~[stardog-reasoning-core-5.1.0.jar:?]
	at com.complexible.stardog.reasoning.equality.CanonicalizeOperator.computeNext(CanonicalizeOperator.java:142) ~[stardog-reasoning-core-5.1.0.jar:?]
	at com.complexible.stardog.reasoning.equality.CanonicalizeOperator.computeNext(CanonicalizeOperator.java:39) ~[stardog-reasoning-core-5.1.0.jar:?]
	at com.complexible.common.collect.AbstractSkippingIterator.tryToComputeNext(AbstractSkippingIterator.java:143) ~[stardog-utils-common-5.1.0.jar:?]
	at com.complexible.common.collect.AbstractSkippingIterator.hasNext(AbstractSkippingIterator.java:130) ~[stardog-utils-common-5.1.0.jar:?]
	at com.complexible.stardog.plan.eval.operator.impl.UnionOp.computeNext(UnionOp.java:82) ~[stardog-5.1.0.jar:?]
	at com.complexible.stardog.plan.eval.operator.impl.UnionOp.computeNext(UnionOp.java:22) ~[stardog-5.1.0.jar:?]
	at com.complexible.common.collect.AbstractSkippingIterator.tryToComputeNext(AbstractSkippingIterator.java:143) ~[stardog-utils-common-5.1.0.jar:?]
	at com.complexible.common.collect.AbstractSkippingIterator.hasNext(AbstractSkippingIterator.java:130) ~[stardog-utils-common-5.1.0.jar:?]
	at com.complexible.stardog.plan.eval.operator.impl.UnionOp.computeNext(UnionOp.java:85) ~[stardog-5.1.0.jar:?]
	at com.complexible.stardog.plan.eval.operator.impl.UnionOp.computeNext(UnionOp.java:22) ~[stardog-5.1.0.jar:?]
	at com.complexible.common.collect.AbstractSkippingIterator.tryToComputeNext(AbstractSkippingIterator.java:143) ~[stardog-utils-common-5.1.0.jar:?]
	at com.complexible.common.collect.AbstractSkippingIterator.hasNext(AbstractSkippingIterator.java:130) ~[stardog-utils-common-5.1.0.jar:?]
	at com.complexible.stardog.plan.eval.operator.impl.UnionOp.computeNext(UnionOp.java:82) ~[stardog-5.1.0.jar:?]
	at com.complexible.stardog.plan.eval.operator.impl.UnionOp.computeNext(UnionOp.java:22) ~[stardog-5.1.0.jar:?]
	at com.complexible.common.collect.AbstractSkippingIterator.tryToComputeNext(AbstractSkippingIterator.java:143) ~[stardog-utils-common-5.1.0.jar:?]
	at com.complexible.common.collect.AbstractSkippingIterator.hasNext(AbstractSkippingIterator.java:130) ~[stardog-utils-common-5.1.0.jar:?]
	at com.complexible.stardog.plan.eval.operator.impl.SingleProjectionOp.computeNext(SingleProjectionOp.java:71) ~[stardog-5.1.0.jar:?]
	at com.complexible.stardog.plan.eval.operator.impl.SingleProjectionOp.computeNext(SingleProjectionOp.java:30) ~[stardog-5.1.0.jar:?]
	at com.complexible.common.collect.AbstractSkippingIterator.tryToComputeNext(AbstractSkippingIterator.java:143) ~[stardog-utils-common-5.1.0.jar:?]
	at com.complexible.common.collect.AbstractSkippingIterator.hasNext(AbstractSkippingIterator.java:130) ~[stardog-utils-common-5.1.0.jar:?]
	at com.complexible.stardog.plan.eval.operator.impl.LazyUnsortedGroupify$1.computeNext(GroupifyAlgorithms.java:146) ~[stardog-5.1.0.jar:?]
	at com.complexible.stardog.plan.eval.operator.impl.LazyUnsortedGroupify$1.computeNext(GroupifyAlgorithms.java:137) ~[stardog-5.1.0.jar:?]
	at com.complexible.common.collect.AbstractSkippingIterator.tryToComputeNext(AbstractSkippingIterator.java:143) ~[stardog-utils-common-5.1.0.jar:?]
	at com.complexible.common.collect.AbstractSkippingIterator.hasNext(AbstractSkippingIterator.java:130) ~[stardog-utils-common-5.1.0.jar:?]
	at com.complexible.stardog.plan.eval.operator.impl.AbstractGroupOp.computeNext(AbstractGroupOp.java:133) ~[stardog-5.1.0.jar:?]
	at com.complexible.stardog.plan.eval.operator.impl.AbstractGroupOp.computeNext(AbstractGroupOp.java:31) ~[stardog-5.1.0.jar:?]
	at com.complexible.common.collect.AbstractSkippingIterator.tryToComputeNext(AbstractSkippingIterator.java:143) ~[stardog-utils-common-5.1.0.jar:?]
	at com.complexible.common.collect.AbstractSkippingIterator.hasNext(AbstractSkippingIterator.java:130) ~[stardog-utils-common-5.1.0.jar:?]
	at com.complexible.stardog.plan.eval.operator.impl.DistinctOp.computeNext(DistinctOp.java:53) ~[stardog-5.1.0.jar:?]
	at com.complexible.stardog.plan.eval.operator.impl.DistinctOp.computeNext(DistinctOp.java:21) ~[stardog-5.1.0.jar:?]
	at com.complexible.common.collect.AbstractSkippingIterator.tryToComputeNext(AbstractSkippingIterator.java:143) ~[stardog-utils-common-5.1.0.jar:?]
	at com.complexible.common.collect.AbstractSkippingIterator.hasNext(AbstractSkippingIterator.java:130) ~[stardog-utils-common-5.1.0.jar:?]
	at com.complexible.stardog.plan.eval.operator.impl.SliceOp._hasNext(SliceOp.java:87) ~[stardog-5.1.0.jar:?]
	at com.complexible.stardog.plan.eval.operator.impl.SliceOp.computeNext(SliceOp.java:95) ~[stardog-5.1.0.jar:?]
	at com.complexible.stardog.plan.eval.operator.impl.SliceOp.computeNext(SliceOp.java:26) ~[stardog-5.1.0.jar:?]
	at com.complexible.common.collect.AbstractSkippingIterator.tryToComputeNext(AbstractSkippingIterator.java:143) ~[stardog-utils-common-5.1.0.jar:?]
	at com.complexible.common.collect.AbstractSkippingIterator.hasNext(AbstractSkippingIterator.java:130) ~[stardog-utils-common-5.1.0.jar:?]
	at com.complexible.stardog.plan.eval.operator.util.AutoCloseOperator.computeNext(AutoCloseOperator.java:112) ~[stardog-5.1.0.jar:?]
	at com.complexible.stardog.plan.eval.operator.util.AutoCloseOperator.computeNext(AutoCloseOperator.java:25) ~[stardog-5.1.0.jar:?]
	at com.complexible.common.collect.AbstractSkippingIterator.tryToComputeNext(AbstractSkippingIterator.java:143) ~[stardog-utils-common-5.1.0.jar:?]
	at com.complexible.common.collect.AbstractSkippingIterator.hasNext(AbstractSkippingIterator.java:130) ~[stardog-utils-common-5.1.0.jar:?]
	at com.complexible.stardog.plan.eval.operator.util.OpBasedBindingSetIteration.computeNext(OpBasedBindingSetIteration.java:110) ~[stardog-5.1.0.jar:?]
	at com.complexible.stardog.plan.eval.operator.util.OpBasedBindingSetIteration.computeNext(OpBasedBindingSetIteration.java:34) ~[stardog-5.1.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.1.0.jar:?]
	... 13 more

I then ran query plan and obtained this:

Explaining Query:

select ?o where {<http://example.com/LL/lagin.ttl#RossRuad> rel:ancestorOf ?o}

The Query Plan:

Projection(?o) [#1]
─ Scan[SPOC](<http://example.com/LL/lagin.ttl#RossRuad>, <http://purl.org/vocab/relationship/ancestorOf>, ?o) [#1]

I have attempted to give a smaller example with no luck. You will need to download my database from github then use the foaf and relationship ontologies (RELATIONSHIP: A vocabulary for describing relationships between people) with the following additional axiom:

rel:parentOf rdfs:subPropertyOf rel:ancestorOf.

You will also need to set the sameAs to FULL.

Any chance you could do an export of your database (stardog data export command) and send to us?

Thanks,
Pavel

Sure, no problem. Just let me know where to send it.

If the archive is reasonably small, you can just email to me (pavel at stardog) or upload to your github. If it’s too big, something like Dropbox would do.

Thanks,
Pavel