Re: Unbound vars as blank nodes

Geoff Chappell wrote:
> Has the working group considered treating the unbound vars that arise from
> malformed queries, optionals, and disjunctions as blank nodes? At first
> glance, it seems to make logical sense, gets rid of the need for the
> logically ugly isbound function, and provides a sound path to resolving
> ordering dependencies with optionals.
> (all examples assume graph {:BK1 dc10:title "Moby Dick"})
> Consider:
> SELECT ?x ?y
>    WHERE  { ?book dc10:title ?x }
> Logically speaking projection vars are existentially quantified, right? And
> that's what a blank node is, so it seems logically correct to return: 
> 	?x="Moby Dick", ?y=_:b1. 
> I.e. the sentence:
> 	There exists ?x,?y such that ?x is the title of something
> essentially becomes:
> 	There exists ?y such that "Moby Dick" is the title of BK1 

Yikes! Apart from the fact that the above query should be flagged as
illegal (see my previous posting to this list), generating new bnodes
for unbound variables will make the QL even more complex than it already
is. Developers have learned to live with NULL values in the context of
SQL, so why would this be problematic for SPARQL?

> Now for optionals....
> SELECT ?x ?y
>    WHERE  { ?book dc10:title ?x. OPTIONAL  ?book ex:author ?y.}
> The result:
> 	?x="Moby Dick"  	?y=_:b1
> seems reasonable - i.e. we know the book has an author (that's what we've
> implied by using optional) we just don't know what it is.

This is not true: the optional implies that the book can have an author,
not that it actually has one. From a developer POV, it's important to
make this distinction. Returning bnodes for unbound variables suggests
that it actually was bound.



Aduna BV -
Prinses Julianaplein 14-b, 3817 CS Amersfoort, The Netherlands
tel. +31-(0)33-4659987  fax. +31-(0)33-4659987

Received on Wednesday, 23 March 2005 10:52:28 UTC