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

literals as numbers (Was: Re: Comments on SPARQL draft)

From: Alberto Reggiori <alberto@asemantics.com>
Date: Wed, 3 Nov 2004 21:53:19 +0100
Message-Id: <64A79BEC-2DDA-11D9-90D4-0011242E4018@asemantics.com>
To: RDF Data Access Working Group <public-rdf-dawg@w3.org>

On Nov 3, 2004, at 9:14 PM, Janne Saarela wrote:

>
>> I propose that SPARQL does not require processing plain literals as
>> numbers if they just happen to look like numbers.  Implementations 
>> would
>> be free to provide this if they choose to but it is outside the rec
>> (i.e. SPARQL does not forbid it either).
>
> I would agree plain literals can only be compared as strings
> but cannot say what the implications are if it was forbidden.

+1

I would rather see the interpretation of literal as numbers as an 
indexing/storage problem rather then a search and retrieval one. 
Whether or not a storage would index each trimmed numerical string as a 
number is up to its stroage model. But the query language must provide 
a syntax to distinguish between the two cases.

> Would you have an example handy?

here is my attempt:

(?item some:prop "47")

would match the string "47" - while

(?item some:prop "47"^^xsd:integer)

would match the number 47 - but the above solution might imply the 
indexing of the rdf:datatype (even if not mandatory)

or use some function like

(?item some:prop "47")
(?item some:prop ?val) AND &isnum(?val)

default would be matching strings

Yours

Alberto

-
Alberto Reggiori, Senior Partner, R&D @Semantics S.R.L.
alberto@asemantics.com  www.asemantics.com
Milan Office, milano@asemantics.com,   +39 0332 667092
Received on Wednesday, 3 November 2004 20:53:24 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 16:15:21 GMT