Dear all,
I was updating my own code base to RDF4J 3.7.0, when I discovered what appears to be a bug in the handling of empty CLAUSES sections.
For your convenience, I provide a very simple test case showing the problem.
The following query works as expected (tested on a memory store)
It returns the following the solution:
In my code bases the VALUES clause is populated programmatically, and it can happen that it is empty, like in the query below:
The query fails with the following log:
java.util.NoSuchElementException: null
at java.util.ArrayList$Itr.next(ArrayList.java:864)
at org.eclipse.rdf4j.query.algebra.evaluation.impl.BindingSetAssignmentInliner$BindingSetAssignmentVisitor.meet(BindingSetAssignmentInliner.java:46)
at org.eclipse.rdf4j.query.algebra.BindingSetAssignment.visit(BindingSetAssignment.java:49)
at org.eclipse.rdf4j.query.algebra.UnaryTupleOperator.visitChildren(UnaryTupleOperator.java:79)
at org.eclipse.rdf4j.query.algebra.Filter.visitChildren(Filter.java:75)
at org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor.meetNode(AbstractQueryModelVisitor.java:572)
at org.eclipse.rdf4j.query.algebra.evaluation.impl.BindingSetAssignmentInliner$BindingSetAssignmentVisitor.meetNode(BindingSetAssignmentInliner.java:82)
at org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor.meetUnaryTupleOperator(AbstractQueryModelVisitor.java:592)
at org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor.meet(AbstractQueryModelVisitor.java:230)
at org.eclipse.rdf4j.query.algebra.evaluation.impl.BindingSetAssignmentInliner$BindingSetAssignmentVisitor.meet(BindingSetAssignmentInliner.java:63)
at org.eclipse.rdf4j.query.algebra.Filter.visit(Filter.java:69)
at org.eclipse.rdf4j.query.algebra.UnaryTupleOperator.visitChildren(UnaryTupleOperator.java:79)
at org.eclipse.rdf4j.query.algebra.Projection.visitChildren(Projection.java:81)
at org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor.meetNode(AbstractQueryModelVisitor.java:572)
at org.eclipse.rdf4j.query.algebra.evaluation.impl.BindingSetAssignmentInliner$BindingSetAssignmentVisitor.meetNode(BindingSetAssignmentInliner.java:82)
at org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor.meetUnaryTupleOperator(AbstractQueryModelVisitor.java:592)
at...
These queries were working on a previous version of RDF4J (3.2.3).
Regards,