Empty binding set result from query

4 views
Skip to first unread message

Andrea Westerinen

unread,
Dec 15, 2016, 8:17:43 PM12/15/16
to Stardog
I have had to modify several queries if a single variable would be the only binding returned from a query + if the variable was set 
by a query parameter. Specifically, all the other returned bindings were part of OPTIONAL clauses and had no values.

When this occurred, the query returned a null set, where in Stardog 3.1.4, it returned a binding with only one variable set.

So, for example, where I used to say ...

SELECT
?uriRef
?otherThings

WHERE {
OPTIONAL {
stuff to check about ?uriRef
}

OPTIONAL {
other stuff to check about ?uriRef
}
}

I now have to query ...

SELECT
?uriRef2
?otherThings

WHERE {
bind(?uriRef as ?uriRef2) .

OPTIONAL {
stuff to check about ?uriRef
}

OPTIONAL {
other stuff to check about ?uriRef
}
}

I am using the Spring Framework and the V4.1 SNARL Spring libraries.

Andrea

Evren Sirin

unread,
Dec 20, 2016, 5:40:10 PM12/20/16
to Stardog
Hi Andrea,

The behavior of query parameters changed slightly from 3.* to 4.
version. Right now the behavior should be roughly equivalent to having
a BIND for the query parameter in the scope the variable is defined.
That means there would be one BIND in each of the OPTIONALs in your
query instead of having one BIND outside as in your hand-written
version. This also means that if the OPTIONALs in your query do not
return any results then you wouldn't get any results for ?uriRef. If
you can share the exact query and some data to reproduce the behavior
you see we can take a look at it.

Best,
Evren
> --
> -- --
> 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
Reply all
Reply to author
Forward
0 new messages