W3C home > Mailing lists > Public > public-rdf-dawg@w3.org > January to March 2011

Re: ACTION-419: Sync with Birte on Datatypes for canonicalisation

From: Bijan Parsia <bparsia@cs.man.ac.uk>
Date: Tue, 29 Mar 2011 18:04:54 +0100
Cc: Matthew Perry <matthew.perry@oracle.com>, Andy Seaborne <andy.seaborne@epimorphics.com>, W3C SPARQL Working Group <public-rdf-dawg@w3.org>
Message-Id: <F1F6C86F-4774-45E3-8354-8750A3313043@cs.man.ac.uk>
To: Birte Glimm <birte.glimm@comlab.ox.ac.uk>
On 29 Mar 2011, at 17:54, Birte Glimm wrote:

> Hm, so "01"^^xsd:integer becomes "1.0"^^xsd:decimal?
> That's what we do in HermiT since otherwise you wouldn't be able to
> properly implement OWL reasoning with facets, but then I don't
> understand the XML Schema Datatypes spec, which seems to suggest that
> "1" is the canonical form of "01" for integers (definitely not "1.0").
> In other places the spec says, however, that derived types inherit the
> canonical forms from the primitive type and for integer the primitive
> type is decimal, so from that one could understand "1.0" as decimal to
> be the canonical representation of integer "01".

Are you using Schema 1.1 (recommended even though not a recommendation!).

By that spec, you cannot consider "1.0" as decimal to be the canonical representation for "1" as integer. Heck, it's not the canonical representation for "1.0" as decimal!

http://www.w3.org/TR/xmlschema11-2/#decimal
"The definition of the ·canonical representation· has the effect of prohibiting certain options from the Lexical Mapping (§3.3.3.1).  Specifically, for integers, the decimal point and fractional part are prohibited. "

Algorithm is given in:

	http://www.w3.org/TR/xmlschema11-2/#f-decimalLexmap

Which dispatches to:
	http://www.w3.org/TR/xmlschema11-2/#nt-noDecNuml

And this seems to be what Oracle does (from Matthew's email):

"All the following go to xsd:decimal normalized to remove all leading and trailing 
zeros. Decimal point is not included if fractional part is zero.:"

So, "01"^^xsd:integer and "1.0"^^xsd:decimal both go to "1"^^xsd:decimal.

Cheers,
Bijan.
Received on Tuesday, 29 March 2011 17:05:36 GMT

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