Re: [XSCH] XPath eq, practical datatype issues and formal specification

Jeff Pan wrote:
> Jeremy,
> 
> Some early comments of the current version of 
> 
> http://www.w3.org/2001/sw/BestPractices/XSCH/xsch-sw/ .
> 
> 1) I am trying to understand the ~ relationship. Do you mean to say that ~ is a set of sets, each of which contains all  the typed literals corresponds to the a data value? Hence in RDF(S), 
> 

Yes, an equivalence relation can be viewed as the set of equivalence 
classes.

> ~ = {X| X = IL^-1(lv) for each lv in LV},
> 
> and in OWL DL, 
> 
> ~ = {X| X = L^-1(lv) for each lv in LV}.
> 
> I understand the above definitions don't cover plain literals; anyway, it is not hard to extend IL and L to cover them. 
> 

We do need to cover plain literals because of the (informative) 
identification of plain literals with no lang tags with xsd:string (hmmm 
it might be normative, I think there is an RDF Test Case that covers that).



> 2)  In XML Schema Part 2, equality is CLEARLY defined as follows [1]:
> 
> ["Equality" in this Recommendation is defined to be "identity" (i.e., values that are identical in the ·value space· are equal and vice versa).]
> 
> Therefore we have 
> 
>  L2S(xsd:decimal)("3.2") = L2S(xsd:float)("3.2") 
> 
>  is true,

No it's not. "3.2"^^xsd:float gets rounded to the nearest member of the 
float value space, since 0.2 is not precisely represented this involves 
rounding, if you had had 3.25 the example would have worked.

I am still thinking about the rest ....

Jeremy

  but
> 
> L2S(xsd:float)("3.2") = L2S(xsd:decimal)("3.20000000000000000001") 
> 
> is false; the latter one is FALSE because L2S(xsd:decimal)("3.20000000000000000001")  is not in the value space of xsd:float. 
> 
> However, XML Schema Part 2 does not require that all its applications have to stick to the above definition of equality; on the contrary, applications "may use different definitions of equality for computational purposes". Accordingly, it suggests a  mapping between different data values as follows [1]:
> 

We can regard RDF and OWL as 'applications' of XML Schema if we so 
choose. The unwritten purist section:

http://www.w3.org/2001/sw/BestPractices/XSCH/xsch-sw/#sec-values-true

will follow

http://lists.w3.org/Archives/Public/www-archive/2002Nov/att-0092/

in which equality is treated as you are suggesting, but I am by no means 
clear that that is a good answer. It may be too 'ivory towers'.



> [A literal in the ·lexical space· representing a decimal number d maps to the normalized value in the ·value space· of float that is closest to d in the sense defined by [Clinger, WD (1990)]; if d is exactly halfway between two such values then the even value is chosen.]
> 
> Therefore, we have
> 
> "3.20000000000000000001"^^xsd:decimal mapsTo(xsd:decimal,xsd:float)  L2S(xsd:float)("3.2") 
> 
> is true, where mapsTo(xsd:decimal,xsd:float) is the mapping from xsd:decimal to xsd:float. 
> 
> Now if we want to use eq to cover both = and mapsTo,  we can constrain a D-interpretation  with the additional following condition:
> 
> if <aaa,x>, <aaa',x'> are in D then for any two typed literals "sss"^^ddd, "sss'"^^ddd' in V with I(ddd) = x and I(ddd')=x', such that 
> (i) sss is in the lexical space of x and sss' is in the lexical space of x', and 
> (ii) L2V(x)(sss) = L2V(x')(sss')  or <"sss"^^ddd, L2V(x')(sss')> is in mapsTo(ddd,ddd'),
> then <IL("sss"^^ddd), IL( "sss'"^^ddd' )> is in I(eq). 
> 
> Note that if sss is in the lexical space of x, IL("sss"^^ddd) = L2V(x)(sss), according to RDF Semantics [2].
> 
> Greetings,
> Jeff
> 
> --
> Dr. Jeff Z. Pan  ( http://DL-Web.man.ac.uk/ )
> School of Computer Science, The University of Manchester
> 
> 
> 
> [1] http://www.w3.org/TR/2004/REC-xmlschema-2-20041028/#float
> [2] http://www.w3.org/TR/2004/REC-rdf-mt-20040210/#DTYPEINTERP

Received on Tuesday, 30 November 2004 18:15:24 UTC