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

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 UTC