sqrt [was: Wishlist for SPARQL 1.2: Compatible query-hints, extra math operators]

On 30/07/13 15:05, Jerven Bolleman wrote:
...
> The second is an expansion of the basic math operators to include at
> least (square)root. (square)root is very hard to implement using the
> current SPARQL constructs yet is a very useful function. (even if not
> exact)

The SPARQL 1.1 library was decided mainly by taking the non-sequence 
related functions from XQuery/XPath Functions and Operators (F&O), 
sorting out a few details of RDF/SPARQL evaluation, and adding some 
SPARQL specific functions (e.g. STRDT).

F&O is an excellent resource because it defines exactly what all the 
operations do.  It is (oddly?) lacking on numeric operations like sqrt 
and similar but there may be a good reason for that.

I agree it would be good to have sqrt.  Let's hope that implementations 
add it as an URI-callable function.

If we implementers decide on the URI, then queries will be portable.

http://www.w3.org/ns/sparql is supposed to be populated with URIs for 
every function with a keyword in SPARQL.  That action (389) got lost.

So ...

prefix http://www.w3.org/ns/sparql#

sfn:sqrt(numeric) -> double.

What else (within reason!)?

	Andy

Received on Wednesday, 31 July 2013 09:06:44 UTC