Using Classes As Property Values

General issue

When and how to use classes as values for properties? What are advantages and drawbacks? What are different approachs and workarounds? Which solutions are in OWL DL (and hence OWL Lite) and which solutions are in OWL Full?

Use case example

Suppose we want to annotate animal images with the classes describing the animal species. We want to be able to say that an image of a Lion is also an image of a Mammal (For example, when retrieving all images of mammals from a repository, we want images of lions to be included in the results). We consider animals to be subjects of the images and would like to use the Dublin Core property dc:subject for this annotation.

Other use case scenarios

This issue arises in general when we have a hierarchy of concepts and would like to use it as a terminology to annotate other classes or individuals. Consider using a hierarchy of book subjects to annotate books or linking classes or individuals in an ontology to the corresponding concepts in a standard reference terminology (e.g., UMLS is such standard reference terminology for many medical applications).

Approaches

Approach 1: using classes directly as values

In the first approach, we can simply use classes from the subject hierarchy as values for properties (in our example, as values for the dc:subject property). We can define a class AnimalImage of all images of animals. Here is a definition of an individual that is an instance of the AnimalImage class with the corresponding subject:

  <AnimalImage rdf:ID="LionImage">
<dc:subject rdf:resource="#Lion"/>
</Image>

where the class Lion is defined in the following way:

 <owl:Class rdf:ID="Lion">
<rdfs:subClassOf>
<owl:Class rdf:about="#Mammal"/>
</rdfs:subClassOf>
</owl:Class>
 

Considerations when choosing approach 1:

Summary for Approach 1

This approach is a good one to use if you care about simplicity, do not have to be in OWL DL, and either do not need to limit the range of the dc:subject values or do not care that you need to have subjects as instances of a subclass of owl:Class to implement this restriction.

Approach 2: using individuals for subjects

One of the ways to avoid having the resulting ontology in OWL Full, is to create a set of individuals to represent the subjects. There are a couple of possible options.

  1. We can create individuals corresponding to all the subjects and use these individuals as values for the dc:subject property. Thus, we will have, for example, an individual LionSubject that will be an instance of the Lion class. We can then use the LionSubject as the value of the property dc:subject for the LionImage individual:
  2.   <Lion rdf:ID="LionSubject"/>

  3. Alternatively, we can create a single class Subject and make all the subjects to be individuals that are instances of this class Concept:

      <Concept rdf:ID="LionSubject"/>
    We can link these subjects to the classes in the hierarchy of Animal classes using rdf:isDefinedBy property:

    <Subject rdf:ID="LionSubject">
    <rdfs:isDefinedBy rdf:resource="#Lion"/>
    </Subject>

In both cases, the definition of the LionImage refers to the LionSubject individual (which will have a different rdf:type depending on which option of the two above you choose)

 <AnimalImage rdf:ID="LionImage">
<dc:subject rdf:resource="#LionSubject"/>
</AnimalImage> 

Considerations when choosing approach 2:

Summary of Approach 2

Both options for this approach are in OWL DL and may be good ones to use if staying in OWL DL is important. The approach has a potential disadvantage of having actual subject values be unrelated to one another and hence not allowing a general-purpose reasoner to relate images of mammals to images of lions, for example. You need to maintain consistency between the set of classes representing subjects and the set of corresponding individuals.

Approach 3: using a property other than rdfs:subclassOf to organize the subject hierarchy

We can take the second option in Approach 2, and take it one step further, creating explicit relations between different subjects, which will re-create the hierarchy for animals that we have in mind:

  <owl:TransitiveProperty 
rdf:ID="parentSubject">
<rdfs:range rdf:resource="#Subject"/>
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/>
<rdfs:domain rdf:resource="#Subject"/>
</owl:TransitiveProperty>
<Subject rdf:ID="LionSubject">
<parentSubject rdf:resource="#MammalSubject"/>
</Subject>

Considerations when choosing this approach

Summary of Approach 3

This approach may be a good one to use if staying within OWL DL is important. It also allows you to use a DL reasoner to infer transitive relationships between subjects. It does carry the penalty of having two parallel "hierarchies."

Approach 4: using classes as values for annotation properties

Another way to stay in OWL DL is to use classes as values for annotation properties:

  <owl:AnnotationProperty rdf:about="&dc;subject"/>

   <AnimalImage rdf:ID="LionImage">
<dc:subject rdf:resource="#Lion"/>
</AnimalImage>

Considerations when choosing this approach

Summary of Approach 4

This approach allows you to use classes directly as property values while staying in OWL DL. However, the properties that will have classes as values will have to be defined as annotations and therefore cannot have any additional restrictions defined on them (and should not be declared as object or datatype properties elsewhere). DL reasoners will not use values of annotation properties.