Potential bug in handling of empty VALUES clauses

8 views
Skip to first unread message

Manuel Fiorelli

unread,
Jun 1, 2021, 7:36:20 PM6/1/21
to rdf4j...@googlegroups.com
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)

SELECT * {  
  VALUES(?dataset ?urispace) {
    (<http://example.org/void.ttl#ExampleDataset> "http://example.org/")
  }
  FILTER(STRSTARTS(STR(<http://example.org/Person>), ?urispace))
}

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:

SELECT * {  
  VALUES(?dataset ?urispace) {
  }
  FILTER(STRSTARTS(STR(<http://example.org/Person>), ?urispace))
}

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,
Manuel Fiorelli

Jeen Broekstra

unread,
Jun 2, 2021, 5:24:27 AM6/2/21
to RDF4J Users
This is definitely a bug - could you log an issue for it please? It is probably a regression introduced by this improvement: https://github.com/eclipse/rdf4j/issues/3008 . 

Cheers,

Jeen
--
You received this message because you are subscribed to the Google Groups "RDF4J Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rdf4j-users...@googlegroups.com.

Manuel Fiorelli

unread,
Jun 4, 2021, 10:27:04 AM6/4/21
to rdf4j...@googlegroups.com
Hi Jeen

thank you for the prompt reply to this email and to the other one I sent yesterday. I filed two separate issues: https://github.com/eclipse/rdf4j/issues/3090 and https://github.com/eclipse/rdf4j/issues/3091

Regards
Manuel



--
Manuel Fiorelli
Reply all
Reply to author
Forward
0 new messages