Re: "Unbound" in SPARQL (was Re: [TF-LIB] COALESCE is an unhelpful choice of name)

On 17 Nov 2009, at 12:03, Andy Seaborne wrote:
> On 17/11/2009 11:44, Steve Harris wrote:
>>
>> - Steve, hoping sparql:noValue wasn't supposed to be a URI :)
>
> It can be a URI :)  The other alternative is a literal that is in a  
> value space disjoint from all others.

What about

SELECT ?x
WHERE {
   ?x :p :o .
   OPTIONAL {
     ?x :doesnotexist ?y .
   }
   FILTER(?y = sparql:noValue)
}

v's

SELECT * WHERE {
{ SELECT (MAX(?y) AS ?max)
WHERE {
   ?x :p :o .
   OPTIONAL {
     ?x :doesnotexist ?y .
   }
} GROUP BY ?x }
FILTER(?max = sparql:noValue) }

It potentially has the opposite confusion problem to SQLs infamous  
WHERE x = NULL.

It might be easier to make it same value that can't be written down,  
then users can't distinguish it from the "unbound" value.

- Steve

-- 
Steve Harris, CTO, Garlik Limited
2 Sheen Road, Richmond, TW9 1AE, UK
+44(0)20 8973 2465  http://www.garlik.com/
Registered in England and Wales 535 7233 VAT # 849 0517 11
Registered office: Thames House, Portsmouth Road, Esher, Surrey, KT10  
9AD

Received on Tuesday, 17 November 2009 12:29:20 UTC