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

Re: function library summary and issues

From: Andy Seaborne <andy.seaborne@epimorphics.com>
Date: Wed, 24 Nov 2010 15:20:27 +0000
Message-ID: <4CED2D3B.9080401@epimorphics.com>
To: Axel Polleres <axel.polleres@deri.org>
CC: SPARQL Working Group <public-rdf-dawg@w3.org>
We are making slow progress on this.  This message is to put a more 
concrete proposal on the table for further WG modification, it's based 
on what I have heard/seen so far but I may well have missed something.

Decision point 1:
Is the list below agreed?

Decision point 2:
Whether to add keywords or whether to have only URIs.
Possible keywords below.

Decision point 3:
What URIs?
I'm assuming there will be URIs for all functions in SPARQL. We need 
sparqlfn: for the ones we have from SPARQL 1.0 and adding for SPARQL 1.1 
anyway (e.g. IRI())

Decision point 3:
What to do about xsd:string vs simple literal?

Practicality suggests simple literals are important.
We can overlay on XSD F&O so for example:

   CONCAT("a"^^xsd:string, "b"^^xsd:string) -> "ab"^^xsd:string
   CONCAT("a", "b") -> "ab"
   CONCAT("a"^^xsd:string, "b") -> "ab"^^xsd:string (?? choice point)
   CONCAT("a"@en, "b"@fr) -> error? (choice point [*])
   CONCAT(str("a"@en), str("b"@fr)) -> "ab"

[*] lang tag support in comparisons etc is not required by base SPARQL 
so it's an error. The question is whether to provide guidance to 
implementations that wish to provide it.

Whether the choice is by new URIs for the functions or punning on XSD 
F&O is part of this decision point.

1/ Keywords as below.  No dateTime functions.
2/ sparqlfn: URIs for all function (our namespace and URIs)
3/ Definition as XSD F&O except work on simple literals as noted.
4/ Documentation reference XSD F&O for each function.

I am not particularly fond is this way forward nor strongly advocating 
it.  It's a concrete proposal to move the discussion to a conclusion, I 


Numeric functions:

         6.4.1 fn:abs
         6.4.2 fn:ceiling
         6.4.3 fn:floor
         6.4.4 fn:round
         6.4.5 fn:round-half-to-even
Note precision argument.
See discussion at:

String functions:

         7.3.2 fn:compare
? Not needed as a keyword.
         7.4.1 fn:concat
         7.4.3 fn:substring
Two forms /2 and /3
Note it's one-based counting and it's (index, length) unlike some languages.

         7.4.4 fn:string-length
         7.4.7 fn:upper-case
         7.4.8 fn:lower-case
         7.4.10 fn:encode-for-uri
Note it's ENCODE(string) -> string

         7.5.1 fn:contains     (collation form optional)
No collation form as required SPARQL function.

         7.5.2 fn:starts-with
         7.5.3 fn:ends-with

DateTime functions:
? Drop
? Or what naming

         10.4.6 op:dateTime-equal
         10.4.7 op:dateTime-less-than
         10.4.8 op:dateTime-greater-than
         10.5.7 fn:year-from-dateTime
         10.5.8 fn:month-from-dateTime
         10.5.9 fn:day-from-dateTime
         10.5.10 fn:hours-from-dateTime
         10.5.11 fn:minutes-from-dateTime
         10.5.12 fn:seconds-from-dateTime
         10.5.13 fn:timezone-from-dateTime

Misc functions:

	3. fn:error
Received on Wednesday, 24 November 2010 15:21:00 UTC

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