Choosing a Syntax for User Defined Datatypes in OWL
by Mike Smith
I’ve been representing C&P in the W3 OWL working group, and my recent focus has been on methods for defining and reusing user-defined unary datatypes in an ontology. The OWL 1.1 documents, which were taken as a working group input, allow users to define restrictions on built-in datatypes in-line using a custom syntax. The following snippet used in the description of Child from the family.owl example provides an example:
<owl:Restriction>
<owl:onProperty rdf:resource="#hasAge"/>
<owl:allValuesFrom>
<owl:DataRange>
<owl11:onDataRange rdf:resource="xsd:nonNegativeInteger"/>
<owl11:maxExclusive>10</owl11>
</owl:DataRange>
</owl:allValuesFrom>
</owl:Restriction>
Note the use of the owl11 namespace and new vocabulary onDataRange and maxExclusive. This recycles some of XML Schema, notably constraining facets, without re-using the XML Schema syntax. An alternative approach, which embeds the XML Schema syntax directly into RDF/XML might yield the following revision to the example
<owl:Restriction>
<owl:onProperty rdf:resource="#hasAge"/>
<owl:allValuesFrom>
<owl:DataRange rdf:parseType="Literal">
<xsd:SimpleType>
<xsd:restriction base="&xsd;nonNegativeInteger">
<xsd:maxExclusive value="10"/>
</xsd:restriction>
</xsd:SimpleType>
</owl:DataRange>
</owl:allValuesFrom>
</owl:Restriction>
Such reuse has warts in some cases, but it’s believed these can be worked around. It’s notable too that these warts only appear in OWL/RDF, not in OWL/XML.
It’s too early to tell which datatype syntax will be used in the specifications. The custom syntax is more accessible to RDF tools and makes adding constraining facets in the future easy because they’re just URIs. On the other hand, the benefit of embedding the XML Schema syntax is reuse of that community’s tools, which due to time and industry support, are more mature than the RDF alternatives. I suspect that additional pros and cons will come out soon.
If you’re interested in this part of OWL, please provide thoughts on the alternatives in comments here or on the pellet-users or public-owl-dev mailing lists. I’m happy to relay them into the WG discussion.




