Why do bnodes work in FILTER clauses but not in VALUES clauses?

1 view
Skip to first unread message

jrh...@thematix.com

unread,
Aug 19, 2015, 6:45:36 PM8/19/15
to Stardog
I would rather use VALUES clauses to bind SPARQL query variables to a set of values, some of which are bnodes.
The bnodes are not used to restrict the matching graph patterns, real IRIs are used.
On the other hand, I can construct an equivalent filter clause with the same set of IRIs and bnodes and get the correct results.
The SPARQL 1.1 spec does not say whether ot not bnodes are allowed in either clause type.
Why does Stardog allow them in FILTERS and ignore them in VALUES? 
If they really should not be in VALUES clauses for some reason, Stardog should probably return an error.
Thanks, Jim

Evren Sirin

unread,
Aug 19, 2015, 7:36:58 PM8/19/15
to Stardog
Bnodes are not allowed in VALUES clause (see [1] and [2] in the
grammar). And in general SPARQL treats bnodes in queries as variables
and they do not match the bnodes in data. Stardog adopts the commonly
used method of encoding bnodes as URIs so if you use <_:s> in the
query it would match the bnode _:s in the data. But this extension
currently does not cover VALUES clause. We'll add this feature in the
future.

Best,
Evren

[1] http://www.w3.org/TR/sparql11-query/#rValuesClause
[2] http://www.w3.org/TR/sparql11-query/#rDataBlockValue
> --
> -- --
> You received this message because you are subscribed to the C&P "Stardog"
> group.
> To post to this group, send email to sta...@clarkparsia.com
> To unsubscribe from this group, send email to
> stardog+u...@clarkparsia.com
> For more options, visit this group at
> http://groups.google.com/a/clarkparsia.com/group/stardog?hl=en

jrh...@thematix.com

unread,
Aug 21, 2015, 3:17:24 PM8/21/15
to Stardog
Do you think that Stardog should produce an error if a VALUES item matches the encoding of bnodes as URIs instead of just ignoring them?
What, if any, difference in query planning would result from allowing bnodes in VALUES as opposed to using them in FILTER expressions?
Thanks, Jim

Pavel Klinov

unread,
Aug 21, 2015, 3:58:33 PM8/21/15
to sta...@clarkparsia.com
On Fri, Aug 21, 2015 at 9:17 PM, <jrh...@thematix.com> wrote:
Do you think that Stardog should produce an error if a VALUES item matches the encoding of bnodes as URIs instead of just ignoring them?

No. As Evren said, Stardog supports querying for blank nodes so we'll just extend that support to cover VALUES. We created the ticket #2445 for that and it'll be fixed in the next release.
 
What, if any, difference in query planning would result from allowing bnodes in VALUES as opposed to using them in FILTER expressions?

None.

Best,
Pavel
Reply all
Reply to author
Forward
0 new messages