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

ASK WHERE {
	FILTER ("42"^^xsd:float > "8"^^xsd:float)
}

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

ASK WHERE {
	FILTER ("42"^^unit:Meter > "8"^^unit:Meter)
}

Could you please consider generalizing the Operator Mapping

http://www.w3.org/TR/2011/WD-sparql11-query-20110512/#OperatorMapping

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

ASK WHERE {
	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,
Holger
Received on Friday, 3 June 2011 05:42:57 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 3 June 2011 05:42:57 GMT