Re: Comments on SPARQL (datatypes, valueTesting)

Dan Connolly wrote:
> On Mon, 2005-05-16 at 09:17 -0700, Ashok Malhotra wrote:
> 
>>Notes on SPARQL Query Language for RDF
>>W3C Working Draft 17 February 2005
> 
> 
> [...]
> 
>>Section 3.  Decimal values cannot be written as literals.  This seems like
 >>needless limitation.  Suggest SPARQL use the literal definitions in XPath,

Just to be clear, any RDF literal can be expressed in the SPARQL syntax using 
the full ^^ form : we are talking about the abbreviated forms for convenient 
expression of common numercial types.

> 
> 
> In XPath, 0.2 represents a decimal and not a float?
> I'm pretty sure that's not the case in XPath 1;
> checking http://www.w3.org/TR/2005/WD-xpath20-20050404/ ...
> 
> Sure enough...
> 
> "12.5 denotes the xs:decimal value twelve and one half."
>  -- http://www.w3.org/TR/2005/WD-xpath20-20050404/#id-literals
> 
> that's news to me!
> 
> Andy, Eric, Dave, did you know about that?

I wasn't aware that XPath 2 literals required 'e' for doubles, leaving 12.5 as 
a decimal.  The SPARQL syntax follows other RDF-related syntaxes (N3, Turtle, 
RDQL) providing a special, additional syntactic form for integers and doubles.

Checking, I find that SeRQL support decimals (? it does not explicitly say but 
the grammar production is called DECIMAL) and integers but not doubles with 
such forms.

> 
> 
>>Section 3.1 has a very brief section entitled "Matching Arbitrary Datatypes".
 >> There is no explanation for how this works.
> 
> 
> I leave that to the editors...

This will be done now that the design (details in sec11) are clearer.

Equality of two values is true if the processor definitely knows they are the 
same.  Having the same type and same lexicial form, for example.  Note that 
not equals is also defined to be where two values are definitely known to be 
different - it is not defined as "not(equals)".

	Andy

> 
> 
>>Presumably, RDF encodes metadata about data that is represented as XML.  If this is the case, why are all the XML Schema datatypes not supported?  See section 11.2.
> 
> 
> Queries over any datatype can be expressed,
> but support for functions and operators beyond
> integers and strings (and probably dates; the issue is still open)
> is optional.
> 
> 
> 
>>The RDF datatype URI is a restriction of the XML Schema datatype anyURI in that only absolute URIs are supported.
> 
> 
> Well, no; RDF doesn't define a URI datatype. It defines a type of term
> called URI, but this type of term isn't a literal at all; it's a name.
> 
> http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/#dfn-URI-reference
> 
> 
>>  It might have been simpler just to support the XML Schema datatype and call out this restriction.
>>Section 11.2.1.1 introduces the function URI-equal..  How is this different from a string compare?  Does it work if one of the URIs is escaped and the other is not?
> 
> 
> EricP, let's have a test for that, shall we?
> 
> 
>>Section 11.2.1.3 introduces the function isURI.  Is this necessary?  There is another function that returns the datatype of a variable.
> 
> 
> As I say, a literal of type xs:anyURI is a very different beast from a
> URI term.
> 
> 
>>As far as I can tell, string comparison is defined only using the code point collation.  Other collations are not supported.  This may be a significant limitation.
> 
> 
> Right.
> 
> 
>>There are a number of typos that we have not pointed out.
> 
> 
> Thanks for your review!
> 
> 
>>Ashok Malhotra for the XML Query and XSL WGs

Received on Monday, 16 May 2005 22:06:28 UTC