W3C home > Mailing lists > Public > public-sparql-dev@w3.org > July to September 2009

Re: SPARQL Query Problem - perhaps solvable in 1.1?

From: Lee Feigenbaum <lee@thefigtrees.net>
Date: Tue, 25 Aug 2009 09:01:33 -0400
Message-ID: <4A93E0AD.90207@thefigtrees.net>
To: Toby Inkster <tai@g5n.co.uk>
CC: public-sparql-dev@w3.org
Toby Inkster wrote:
> A very simple solution, which would solve the ordering problem (and also
> greatly simplify the filter) would be for SPARQL to borrow the COALESCE
> function from SQL. For those not familiar with COALESCE, it takes a
> variable number of arguments, and returns the first of those arguments
> which is not null. (In the SPARQL case, it would be the first which is
> bound.)
> 
> That would make my filter as simple as:
> 
> 	FILTER (inRange(COALESCE(?date1,?date2,?date3,?date4)))
> 
> And my sorting as easy as:
> 
> 	ORDER BY (COALESCE(?date1,?date2,?date3,?date4))
> 

I should also mention that implementations are, of course, free to 
extend SPARQL with arbitrary functions, which could include COALESCE.

Lee
Received on Tuesday, 25 August 2009 13:02:13 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 25 August 2009 13:02:13 GMT