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

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 UTC