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

Re: [TF-LIB] first text for new library built-in functions

From: Andy Seaborne <andy.seaborne@talis.com>
Date: Thu, 03 Jun 2010 20:34:19 +0100
Message-ID: <4C0803BB.30602@talis.com>
To: Gregory Williams <greg@evilfunhouse.com>
CC: SPARQL Working Group WG <public-rdf-dawg@w3.org>

On 03/06/2010 5:11 PM, Gregory Williams wrote:
> On Jun 3, 2010, at 8:47 AM, Andy Seaborne wrote:
>> I've added some text for the new SPARQL 1.1 library functions:
> Andy,
> Looking over the text for IN and NOT IN, I'm confused by the examples. The definitions say that the elements of the IN lists are rdfTerms, but the examples seem to use expressions (1/0). rdfTerms would certainly be easier to implement, but I would guess that the definition should be using expressions?


The prototype definitions define the types of arguments accepted by the 
function and that after evaluation of expressions.

c.f. defining the function log10: (This is actually from 

  double log10(double a)

means the argument is a double  and it returns a double.

You can write

	x = log10(1+5) ;

and the expression 1+5 will be evaluated to give 6, converted to 6 as a 
double then the function called.

For the SPARQL function whose functional syntax is IN:

    ?x IN (1, 2, 3+4)

and ?x is bound to 57

an implementation will pass down

   57 IN (1, 2, 7)

rdfterm is just the most general thing an expression can evaluate to.


The exceptions are the forms that take expressions (e.g. COALESCE, IF) 
because you can't evaluate the expressions then call the function - 
these behave differently, processing/evaluating arguments as needed 
based on the other arguments.

If you have suggestions for improving the presentation (appearance or 
wording), please do suggest them.  The general format is inherited from 
what was in the SPARQL 1.0 spec except the styling has been lost 
somewhere in all the reformatting.


> thanks,
> .greg
Received on Thursday, 3 June 2010 19:34:21 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:01:00 UTC