- From: Lee Feigenbaum <lee@thefigtrees.net>
- Date: Tue, 25 Aug 2009 09:01:33 -0400
- 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 UTC