Closed rubensworks closed 7 years ago
Thanks for reporting; we should do a query sanity check to see whether all demanded variables occur in the query body.
Note that the SPARQL specification says the following: If the evaluation of the expression produces an error, the variable remains unbound for that solution but the query evaluation continues. http://www.w3.org/TR/2013/REC-sparql11-query-20130321/#assignment
So wether it is unbound or not, it should be there, so option 1 seems the only valid option according to the spec.
Interesting find, @mielvds, although this only seems to hold in the case of expressions (BIND
, SELECT
, GROUP BY
), not triple patterns?
And even in those cases, would expect a difference though between an expression that can never be evaluated (because the variable does not occur anywhere else in the query) or an expression which has a variable that has no value (e.g., it comes from an OPTIONAL
clause). A quick search in the spec didn't reveal anything though.
This was fixed by fa7b517a7aebfcf6311a2b0dd14f4d005f13aeeb.
Executing a query like the following:
Will throw
TypeError: Cannot call method 'replace' of undefined
at theerror
event of the SparqlIterator. Most likely because the variables?initial ?final
are defined at the SELECT clause, but not inside the WHERE clause.Link to the hdt dataset + ldf-server config to replicate this error: http://cl.ly/082N451L2o0u
Possible solutions could be:
undefined
with these unbound variables.