W3C home > Mailing lists > Public > public-rdf-dawg@w3.org > October to December 2009

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

From: Steve Harris <steve.harris@garlik.com>
Date: Tue, 17 Nov 2009 12:28:30 +0000
Cc: "public-rdf-dawg@w3.org Group" <public-rdf-dawg@w3.org>
Message-Id: <2D241929-DA51-4DDA-BD4A-208469C80246@garlik.com>
To: Andy Seaborne <andy.seaborne@talis.com>
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 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 16:15:40 GMT