- From: Paul Gearon <gearon@ieee.org>
- Date: Wed, 31 Jul 2013 13:19:51 -0400
- To: Andy Seaborne <andy@apache.org>
- Cc: public-rdf-dawg-comments@w3.org
- Message-ID: <CAGZNPF=i3cLFD6WGKoue65W-YN8ZnTjPL778Xe53haUHbaG8xA@mail.gmail.com>
On Wed, Jul 31, 2013 at 5:06 AM, Andy Seaborne <andy@apache.org> wrote: > 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!)? When it comes to function extensions for common operations like math, I usually adopted the XPath functions myself. For sqrt, this appears in the math: namespace. math: http://www.w3.org/2005/xpath-functions/math The list for XQuery/XPath Operators 3.0 includes: math:pi, math:exp, math:exp10, math:log, math:log10, math:pow, math:sqrt, math:sin, math:cos, math:tan, math:asin, math:acos, math:atan, math:atan2 These are functions that are already defined by a W3C standard, and these standards should be compatible wherever possible. Why not use these? Paul
Received on Wednesday, 31 July 2013 17:20:19 UTC