OWL for schema, OWL for reasoning

A popular perception is that OWL is a schema language for RDF, but it is also quite a bit more. Given an OWL ontology and some RDF data, an OWL Reasoner can actually infer the presence of data that is not explicitly defined in the data. In particular, the reasoner can infer that a particular individual in the data is a member of a class it hasn't been explicitly assigned to.

Unfortunately, the constructs that usually appear in ontologies designed to be used as schema for RDF data aren't suitable for this kind of reasoning. For example, consider this OWL class:

<owl:Class rdf:ID="ClassForSchema">
  <rdf:subClassOf>
    <owl:Restriction>
      <owl:onProperty rdf:resource="#property"/>
      <owl:allValuesFrom rdf:resource="&xsd;int"/>
    </owl:Restriction>
  </rdf:subClassOf>
</owl:Class>

This OWL fragments says that all members of the class ClassForSchema have values of property that are integers. This means that an OWL reasoner will recognize that this instance...

<owl:Individual rdf:ID="assertedInstance">
  <rdf:type rdf:resource="#ClassForSchema"/>
  <property rdf:datatype="&xsd;int">1729</property>
  <rdfs:comment>
      This individual has a class asserted and is consistent with that
      class definition.
  </rdfs:comment>
</owl:Individual>

...is consistent (it has a value of property that is an integer), but that this instance...

<owl:Individual rdf:ID="incorrectlyAssertedInstance">
  <rdf:type rdf:resource="#ClassForSchema"/>
  <property>This is not an integer...</property>
  <rdfs:comment>
      This individual has a class asserted, but is not consistent with that
      class definition because it has a plain literal value of #property.
  </rdfs:comment>
</owl:Individual>

...is inconsistent (it has a value of property that is not an integer). Importantly, both of these individuals are explicitly members of the ClassForSchema class, indicated by the value of the rdf:type property.

Now consider this instance:

<owl:Individual rdf:ID="reasonedInstance">
  <property rdf:datatype="&xsd;int">1729</property>
  <rdfs:comment>
      This individual has no class asserted, but is dynamically found to be
      an instance of #ClassForReasoning
  </rdfs:comment>
</owl:Individual>

Note that it has a value of property that is an integer, but it is not explicitly a member of any class1. An OWL reasoner, given the definition of ClassForSchema above, won't recognize that #reasonedInstance is an instance of ClassForSchema because the class is specified as an rdfs:subClassOf the restriction on property. This indicates that the restriction is necessary for membership in the class, but not sufficient.

Now consider this class definition:

<owl:Class rdf:ID="ClassForReasoning">
  <owl:equivalentClass>
    <owl:Restriction>
      <owl:onProperty rdf:resource="#property" />
      <owl:allValuesFrom rdf:resource="&xsd;int" />
    </owl:Restriction>
  </owl:equivalentClass>
</owl:Class>

Note that in this case, the class is specified as an owl:equivalentClass of the restriction on property. This indicates that the restriction is both necessary and sufficient for membership in the class. Given this definition, an OWL reasoner will recognize that #reasonedInstance is an instance of ClassForReasoning, even though it has no explicit type.

The owl:equivalentClass construct is required for this inferred-type style of reasoning.

1well, except owl:Individual, but we don't have to worry about that...