enumeration

XML schema also allows a simple type restriction to be defined by enumeration. OWL Enumerations allow classes to be defined extensionally, in terms of their membership. For data-types, the class of values is specified as an OWL DataRange, with OWL oneOf listing the permitted range of values.

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 
        targetNamespace="http://example.org/" xmlns="http://example.org/"
        elementFormDefault="qualified">
        
        <xs:element name="data">
                <xs:simpleType>
                        <xs:restriction base="xs:int">
                                <xs:enumeration value="0"/>
                                <xs:enumeration value="1"/>
                        </xs:restriction>
                </xs:simpleType>
        </xs:element>

        <xs:element name="objects">
                <xs:simpleType>
                        <xs:restriction base="xs:QName">
                                <xs:enumeration value="foo"/>
                                <xs:enumeration value="bar"/>
                        </xs:restriction>
                </xs:simpleType>
        </xs:element>

</xs:schema>

Because xs:QNames are not recommended for use in RDF (they depend on locally defined prefixes) they are fully expanded to form absolute URIs. The QNames that appear in the schema are unprefixed and so are defined in the default XML namespace.

# Base: http://example.org/enumeration.owl
@prefix ns1:     <http://example.org/> .
@prefix xs:      <http://www.w3.org/2001/XMLSchema> .
@prefix ns2:     <http://example.org/def/> .
@prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
@prefix daml:    <http://www.daml.org/2001/03/daml+oil#> .
@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xs_:     <http://www.w3.org/2001/XMLSchema#> .
@prefix :        <#> .
@prefix owl:     <http://www.w3.org/2002/07/owl#> .

ns1:objects
      a       owl:ObjectProperty , rdf:Property ;
      rdfs:range
              [ a       owl:Class ;
                owl:oneOf (ns1:foo ns1:bar)
              ] .

ns1:data
      a       owl:DatatypeProperty , rdf:Property ;
      rdfs:range
              [ a       owl:DataRange ;
                owl:oneOf ("0"^^xs_:int "1"^^xs_:int)
              ] .

<>    a       owl:Ontology .

Generated on Mon Jun 18 16:02:38 2007 for Gloze by  doxygen 1.5.0