W3C home > Mailing lists > Public > public-rdf-dawg-comments@w3.org > June 2011

Comparison with non-standard datatypes

From: Holger Knublauch <holger@topquadrant.com>
Date: Fri, 3 Jun 2011 15:42:21 +1000
Message-Id: <BA6E40BA-29A4-41BC-B2F3-ABCD76BA22D5@topquadrant.com>
To: public-rdf-dawg-comments@w3.org
Dear working group,

I would like to suggest to add more openness and flexibility to SPARQL's handling of typed literals. Currently

	FILTER ("42"^^xsd:float > "8"^^xsd:float)

returns true. However, the following query with user-defined datatypes (here: unit:Meter) does not work

	FILTER ("42"^^unit:Meter > "8"^^unit:Meter)

Could you please consider generalizing the Operator Mapping


so that all unknown datatypes default to 'numeric' treatment, so that their literal lexical form is mapped to decimal numbers? I guess the same algorithm would be needed in places like ORDER BY.

We have real-world use cases where we would like to exchange product data with units, and all of them are essentially numeric. The current work-around

	FILTER (xsd:float("42"^^unit:Meter) > xsd:float("8"^^unit:Meter))

(which works) looks overly complex and not generic. I believe opening this up will future-proof SPARQL before it gets frozen again for many years.

Thanks for your consideration,

Received on Friday, 3 June 2011 05:42:57 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:01:29 UTC