- From: Andy Seaborne <andy.seaborne@epimorphics.com>
- Date: Tue, 29 Mar 2011 18:19:41 +0100
- To: Bijan Parsia <bparsia@cs.man.ac.uk>
- CC: Birte Glimm <birte.glimm@comlab.ox.ac.uk>, Matthew Perry <matthew.perry@oracle.com>, W3C SPARQL Working Group <public-rdf-dawg@w3.org>
On 29/03/11 18:04, Bijan Parsia wrote: > 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!). Curious - why? (W3C question: as it's still a WD is it going to progress?) > 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. Oh ... a bit annoying ... http://www.w3.org/TR/xmlschema-2/#decimal-canonical-representation requires the decimal point. As does Turtle in the short form. Canonicalization and setting the datatype are different. Andy > > Cheers, > Bijan.
Received on Tuesday, 29 March 2011 17:20:25 UTC