In addition to the RDF datatypes, OWL provides one additional construct for
defining a range of data values, namely an enumerated datatype. This datatype
format makes use of the owl:oneOf construct.
In the case of an
enumerated datatype, the subject of owl:oneOf is a blank node of
class owl:DataRange and the object is a
list of literals.
<rdfs:Class rdf:ID="DataRange">
<rdfs:label>DataRange</rdfs:label>
</rdfs:Class>
The example below specifies the range of the property
tennisGameScore to be the list of integer values {0, 15, 30, 40}:.
<owl:DatatypeProperty rdf:ID="tennisGameScore">
<rdfs:range>
<owl:DataRange>
<owl:oneOf>
<rdf:List>
<rdf:first rdf:datatype="&xsd;integer">0</rdf:first>
<rdf:rest>
<rdf:List>
<rdf:first rdf:datatype="&xsd;integer">15</rdf:first>
<rdf:rest>
<rdf:List>
<rdf:first rdf:datatype="&xsd;integer">30</rdf:first>
<rdf:rest>
<rdf:List>
<rdf:first rdf:datatype="&xsd;integer">40</rdf:first>
<rdf:rest rdf:resource="&rdf;nil" />
</rdf:List>
</rdf:rest>
</rdf:List>
</rdf:rest>
</rdf:List>
</rdf:rest>
</rdf:List>
</owl:oneOf>
</owl:DataRange>
</rdfs:range>
</owl:DatatypeProperty>
Unfortunately, we cannot use the
rdf:parseType="Collection" idiom for specifying the literal list,
because RDF requires the collection to be a list of RDF node elements. Therefore
we have to specify the list of data values with the basic list constructs
rdf:first, rdf:rest and rdf:nil.
Triples with predicate rdfs:range should have as their subject
either an owl:ObjectProperty or an
owl:DatatypeProperty. In the case of the former, the object of the
triple should then be an owl:Class or owl:Restriction,
in the case of the latter, the object should be either an XML Schema datatype,
rdfs:Literal, or an owl:oneOf specifying a data range
with type owl:DataRange.
NOTE: Enumerated datatypes are not part of OWL Lite.