W3C home > Mailing lists > Public > public-owl-wg@w3.org > January 2008

Re: ISSUE-95 (Datatype-facet compatibility in DatatypeRestriction): No compatibility restrictions between the datatype being restricted and the facets in the DatatypeRestriction construct

From: Michael Smith <msmith@clarkparsia.com>
Date: Tue, 22 Jan 2008 12:54:36 -0500
To: OWL Working Group WG <public-owl-wg@w3.org>
Message-Id: <1201024476.6526.38.camel@msmith-laptop>


On Sun, 2008-01-20 at 12:55 +0000, OWL Working Group Issue Tracker
wrote:
> 
> ISSUE-95 (Datatype-facet compatibility in DatatypeRestriction): No compatibility restrictions between the datatype being restricted and the facets in the DatatypeRestriction construct

> 1. Problem
> ----------
> 
> Currently, the DatatypeRestriction construct takes one dataRange and several facet-value pairs. Note two important points here:
> 
> - The data range can be complex.
> - There are no compatibility restrictions between the data range and the facets.
> 
> The first point makes it possible to write DatatypeRestriction( DataComplementOf(xsd:nonnegativeInteger) fractionDigits "2"^^xsd:integer). It is unclear how to interpret this datatype. The complement of xsd:nonnegativeInteger contains all data values that are not nonnegative integers, which includes, say, real numbers, but also includes all strings. It is unclear what restricting such a datatype to 2 precision digits means. Originally, a dataRange was used because this allowed one to specify, say, minInclusice and maxIncludive via nesting; with mutliple facets per DatatypeRestriction this is not necessary any more.
> 
> 
> The second point makes it possible to write DatatypeRestriction(xsd:string fractionDigits "2"^^xsd:integer). Again, it is unclear whether this is a syntax error or, if not, how to interpret this datatype.
> 
> 2. Possible solution
> --------------------
> 
> A possible solution would be to change the definition of DatatypeRestriction in the following way:
> 
> - Rather than taking a dataRange as an argument, we should make DatatypeRestriction take a Datatype as an argument.
> - We should specify compatibility between different datatypes and factes. For example, we would say that fractionDigits could be applied only to the xsd:float datatype.
> 
> This solution seems to be in line with the XML Schema way of handling things: if I am not mistaken, in XML Schema one cannot apply an arbitrary facet to an arbitrary datatype.

Yes - XML Schema provides normative treatment of the applicability of
constraining facets to built-in datatypes.  To the extent that we can
resolve the simple case by reference to the XML Schema specification,
doing so seems prudent.  It avoids us contradicting another rec - for
example, the XML Schema specification forbids application of
fractionDigits to float.

For the other cases (which include complex data ranges, and any new
"built-in" datatypes), perhaps we can leverage that facets are defined
as modifiers on value spaces.  If a data range has a value space for
which the facet is applicable, it should be allowed, otherwise not.  In
the example you provide above, DataComplementOf(xsd:nonNegativeInteger)
includes literals that do not map into the value space of xsd:decimal,
as such fractionDigits is not applicable.  I support treating this as a
syntax error.

I have concern that a solution which relies on an exhaustive list of
datatype + facet combinations unnecessarily limits extensibility.

-- 
Mike Smith

Clark & Parsia
Received on Tuesday, 22 January 2008 17:54:57 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 22 January 2008 17:54:58 GMT