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: Mon, 16 Nov 2009 20:35:00 +0000
Cc: "public-rdf-dawg@w3.org Group" <public-rdf-dawg@w3.org>
Message-Id: <93FC316A-34C9-41C6-A25F-05DE4F8A8442@garlik.com>
To: Andy Seaborne <andy.seaborne@talis.com>
On 16 Nov 2009, at 20:14, Andy Seaborne wrote:
...
>> ?x = :alice, ?bestDay = 12
>> ?x = :bob, ?bestDay = 8
>> [no row for :carol because we can't return "unbound"/null from MAX(? 
>> sales)]
>>
>
> Would this work?
>
> SELECT ?x ( TRY(MAX(?sales), -1) AS ?bestDay)
>
> or other choice of marker for no value.

Yes, in this case, but it's a pretty poor substitute.

I wonder if there's some wording where unbound expressions can be  
projected, it seems a little odd that SELECT ?sales produces rows,  
whereas SELECT COALESCE(?sales) doesn't.

Probably if you chase this deep enough though you end up changing  
SPARQL 1.0 results :( I guess we should have bitten the bullet and  
gone with a tri-value logic to start with.

- Steve

PS I really don't like TRY() as a name, though I can see the logic in  
it.

-- 
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 Monday, 16 November 2009 20:35:30 GMT

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