Re: what functions should we include in SPARQL 1.1?

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 UTC