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

Re: what functions should we include in SPARQL 1.1?

From: Paul Gearon <gearon@ieee.org>
Date: Tue, 2 Nov 2010 20:46:38 -0400
Message-ID: <AANLkTimmSqsUo7dC2_VPZ8pbCzzqTxkNF_MmR1H_=am1@mail.gmail.com>
To: Steve Harris <steve.harris@garlik.com>
Cc: Lee Feigenbaum <lee@thefigtrees.net>, SPARQL Working Group <public-rdf-dawg@w3.org>
On Tue, Nov 2, 2010 at 6:25 PM, Steve Harris <steve.harris@garlik.com> wrote:
> It's not in XPath (as far as I can tell), but I'd like a RAND() function, it's incredibly useful, e.g.
>
> SELECT ?s WHERE { ?s a <Foo> } ORDER BY RAND() LIMIT 10
>
> SQL's RAND() returns a floating point number between 0 and 1, which works fine. You can also pass it a constant seed value as an argument, but that always struck me as a bit of a strange way of doing it.

Random seeds are useful for unit tests. You get essentially random,
but deterministic, results.

Paul
Received on Wednesday, 3 November 2010 00:47:12 GMT

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