Datatyping Foibles

From: Peter F. Patel-Schneider (
Date: 11/21/01

Pat's proposal for datatypes
(, and
other messages) has the following peculiarity.

Suppose you have two datatypes, say integer and fraction, where integer is
interpreted in the usual way but fraction is interpreted as 1/1+n.  Then it
is possible to interpret the following:

<age> <rdfs:type> <integer> .
<John> <age> "0" .

as having John's age be 1, by making the datatype of the node for the "0"
be fraction.

The problem is that the datatype of the node for "0" can be any datatype
that maps "0" into an integer, and not the intended datatype, integer.  

One fix is to have multiple datatypes for the node for "0".  That is,
as "0" maps to 1, then it has two datatypes, integer and fraction, because
1 is in the range of both integer and fraction.  This does not result in an
interpretation as the integer mapping for "0" is to 0, not to 1.
This works, but disallows some datatypeing schemes, including full XML
Schema datatypes, because union types don't satisfy the requirement just
above.  (Think of string union integer versus integer union string.)  

The problem is, I think, that there are too few entities in the model
theory to support the typing involved.  In essence, 7 as an integer union
string has to be different from 7 as a string union integer.

Note that the scheme that uses rdf:type and rdf:value to type literals
falls prey to this problem as well.  The scheme that uses xsi:integer links
doesn't, but only because it is a syntactic variant of the xsi:integer:7

There are two possiblities that I see:


Place restrictions on the datatype scheme.  Basically the requirement is
that two datatypes whose value spaces overlap cannot disagree on mappings
that go into that overlap.  More formally,

	Let DT be the collection of datatypes
	A datatype, d in DT, is a triple <L,V,LV>
		where L is its literal space
		      V is its value space
		      LV is its mapping from literals to values
	DT is a datatype scheme if
	for d in DT, d' in DT
	for v in V(d) intersection V(d')
	for l in L(d) intersection L(d')
	if LV(d')(l) = v then LV(d)(l) = v 

This prevents any bad use of one datatype's (d') mapping when another
datatype (d) is meant.


Don't only use the value of a literal node to determine if the datatyping
is correct.

For example, you could do something like

	if < x , I(n) > in I(r)
	and < r , d > in I(rdfs:range)
	then I(n) = LV(d)(label(n))

This means that if you have two datatypes, d and d', that are both the
range of r, and that they disagree on label(n) above, then there is no
possible model.


This archive was generated by hypermail 2.1.4 : 04/02/02 EST