OWL help to specify the domain for a property

I'm trying to build an ontology and am have some trouble trying to figure out how to specify the domain for a property.  This property is only available to certain classes in my ontology which are a subclass of another class.  In addition, I also want to have this property available to any subclass that is not defined in my ontology.  So I have defined the following owl:

xml:base="tag:ontology.org,2009:"

<owl:Class rdf:about="A" />

<owl:Class rdf:about="B">
  <rdfs:subClassOf rdf:resource="A" />
</owl:Class>

<owl:Class rdf:about="C">
  <rdfs:subClassOf rdf:resource="A" />
</owl:Class>

<owl:Class rdf:about="D">
  <rdfs:subClassOf rdf:resource="A" />
</owl:Class>

<owl:Class rdf:about="E">
  <rdfs:subClassOf rdf:resource="A" />
</owl:Class>

<owl:DatatypeProperty rdf:about="P">
  <rdfs:domain>
    <owl:Class>
      <owl:unionOf rdf:parseType="Collection">
        <!--
          These are classes in my ontology that are
          subclasses of A and should have this
          property.  So far, no problem.
          -->
        <owl:Class rdf:about="C" />
        <owl:Class rdf:about="E" />
        <!--
          Now I want any subclass of A that my
          ontology doesn't specifically subclass
          to have this property...  For example
          I want any subclass that isn't B, C, D
          and E.  C and E are already included
          above.  So I came up with the following, 
          but I am not sure that this is the correct 
          way to achive what I want...  Seems like
          I should be using some sort of restriction
          but I don't see how it might be constructed.
          -->
        <owl:Class>
          <rdfs:subClassOf rdf:resource="A" />
          <owl:unionOf rdf:parseType="Collection">
            <owl:complementOf rdf:about="B" />
            <owl:complementOf rdf:about="C" />
            <owl:complementOf rdf:about="D" />
            <owl:complementOf rdf:about="E" />
          </owl:unionOf>
        </owl:Class>
      </owl:unionOf>
    </owl:Class>
  </rdfs:domain>
</owl:DatatypeProperty>

So now if someone in a separate namespace declares:

xml:base="tag:example.org,2009:"

<owl:Class rdf:about="X">
  <rdfs:subClassOf rdf:resource="tag:ontology.org,2009:A />
</owl:Class>

Instances (individuals) of class X should be able to specify the datatype property P, based on whatever cardinality constraints are defined for datatype property P in X, which I have not shown in the above example.

Hope this makes sense... Andy.

Received on Tuesday, 25 August 2009 19:26:03 UTC