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

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