require 'sparql'
query = SPARQL.parse(<<~QUERY)
SELECT * WHERE {
?s ?p ?o
VALUES ?s { } # Notice the empty values list
}
QUERY
The parser fails with the following error.
NoMethodError: undefined method `each' for nil:NilClass
from /home/richard/dev/.bundle/gems/sparql-2.2.2/lib/sparql/grammar/parser11.rb:706:in `block in <class:Parser>'
from /home/richard/dev/.bundle/gems/ebnf-1.1.1/lib/ebnf/ll1/parser.rb:600:in `block in onFinish'
from /home/richard/dev/.bundle/gems/ebnf-1.1.1/lib/ebnf/ll1/parser.rb:118:in `block in eval_with_binding'
from /home/richard/dev/.bundle/gems/ebnf-1.1.1/lib/ebnf/ll1/parser.rb:118:in `instance_eval'
from /home/richard/dev/.bundle/gems/ebnf-1.1.1/lib/ebnf/ll1/parser.rb:118:in `eval_with_binding'
from /home/richard/dev/.bundle/gems/ebnf-1.1.1/lib/ebnf/ll1/parser.rb:599:in `onFinish'
from /home/richard/dev/.bundle/gems/ebnf-1.1.1/lib/ebnf/ll1/parser.rb:402:in `parse'
from /home/richard/dev/.bundle/gems/sparql-2.2.2/lib/sparql/grammar/parser11.rb:1525:in `parse'
from /home/richard/dev/.bundle/gems/sparql-2.2.2/lib/sparql.rb:32:in `parse'
This is caused by the values list being empty, as you can see given the following counter-example:
Hi,
Considering the following valid SPARQL query:
The parser fails with the following error.
This is caused by the values list being empty, as you can see given the following counter-example: