W3C

Representing Classes As Property Values on the Semantic Web

W3C Working Group Note 5 April 2005

This version:
http://www.w3.org/TR/2005/NOTE-swbp-classes-as-values-20050405
Latest version:
http://www.w3.org/TR/swbp-classes-as-values
Previous version:
http://www.w3.org/TR/2004/WD-swbp-classes-as-values-20040721
Editor:
Natasha Noy, Stanford University
Contributors:
Michael Uschold, Boeing
Chris Welty, IBM Research
 
Also see Acknowledgements.

Abstract

This document addresses the issue of using classes as property values in OWL and RDF Schema. It is often convenient to put a class (e.g., Animal) as a property value (e.g., topic or book subject) when building an ontology. While OWL Full and RDF Schema do not put any restriction on using classes as property values, in OWL DL and OWL Lite most properties cannot have classes as their values. We illustrate the direct approach for representing classes as property values in OWL-Full and RDF Schema. We present various alternative mechanisms for representing the required information in OWL DL and OWL Lite. For each approach, we discuss various considerations that the users should keep in mind when choosing the best approach for their purposes.

Status of this Document

This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at http://www.w3.org/TR/.

This document is a Working Group Note, produced by the Ontology Engineering and Patterns Task Force in the Semantic Web Best Practices and Deployment Working Group, part of the W3C Semantic Web Activity. This document is one of a series of documents that is produced by the task force. Comments on this document may be sent to public-swbp-wg@w3.org, a mailing list with a public archive.

Publication as a Working Group Note does not imply endorsement by the W3C Membership. This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress.


General issue

It is often convenient to put a class (e.g., Animal) as a property value (e.g., topic or book subject) when building an ontology. While OWL Full [OWL Overview] and RDF Schema [RDFS] do not put any restriction on using classes as property values, in OWL DL and OWL Lite most properties cannot have classes as their values.

Use case example

Suppose we have a set of books about animals, and a catalog of these books.  We want to annotate each catalog entry with its subject, which is a particular species or class of animal that the book is about. Further, we want to be able to infer that a book about African lions is also a book about lions. For example, when retrieving all books about lions from a repository, we want books that are annotated as books about African lions to be included in the results.

More specifically, consider two book examples: (1) "Lions: Life in the Pride", which is a book that "presents an introduction to lions describing their physical characteristics, habitat, young, food, predators, and relationship to people"; and (2) "The African Lion," which "describes the physical characteristics, habitat, and behavior of the" African lions. We would like to specify that the first book describes the animal species of lion, and the second describes a species of African lion. We also want to retrieve the second book when a query is about lions, not just African lions.

We consider species of animals to be subjects of the books and would like to use the Dublin Core property dc:subject for this annotation.  Furthermore, we would like to use as our subjects various species from an existing class hierarchy of different animal species.

We examine representation of this information in OWL and RDF Schema and suggest different ways of capturing this information in OWL DL and OWL Lite.

One goal of the web publisher is to enable maximum reuse of published information. It will be common on the Semantic Web to import and reuse other published ontologies. Any reuse of existing ontologies on the Semantic Web (in our case, a hierarchy of animal species) should preserve the original intended semantics in the new context. If the semantics changes, other applications already using the ontology may be adversely affected. Interoperation with existing applications using this ontology will also be error-prone (since there will be two different interpretations of the same ontology). Some of the patterns that we suggest below change the interpretation of the hierarchy of classes used for property values. We suggest that users take this approach only if they know that no one will be adversely affected by such re-interpretation.

Other use case scenarios

This issue arises in general when we have a hierarchy of classes and would like to use it as a terminology to annotate other classes or individuals. Consider using a hierarchy of different genres to annotate music CDs, or linking classes or individuals in an ontology to the corresponding terms in a standard reference terminology.  For example, UMLS is a standard reference terminology for many medical applications. One may want to have a hasDiagnosis relation from an instance of a patient to a class representing a disease indicating the patient was diagnosed with that disease.  Other use cases for using classes as property values include meta-modeling and semantic interoperability between systems. 

This note uses a particular example (classes as the subjects of books) to illustrate a more general representation issue: using classes as property values.  This note should not be interpreted as a general discussion of how to represent subject hierarchies or terminologies on the semantic web.

Notations

In all the figures below, ovals represent classes and rectangles represent individuals. The orange color signifies classes or individuals that are specific to a particular approach. Green arrows with green labels are OWL annotation properties. We use N3 syntax to represent the examples.

Approaches

Approach 1: Use classes directly as property 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 Book to represent all books. For simplicity, in the hierarchy of animals, we omit classes for other animals, such as mammals and felines (Figure 1).

Using classes directly as values

Figure 1. Using classes directly as property values.

Here is a definition of an individual (a specific book that we are annotating) with the corresponding subject (for simplicity, we assume that each book discusses only one species of animal):

:LionsLifeInThePrideBook
      a       :Book ;
      rdfs:seeAlso <http://isbn.nu/0736809643> ;
      :bookTitle "Lions: Life in the Pride" ;
      dc:subject :Lion .
The book "The African Lion" will be represented as:
:TheAfricanLionBook
      a       :Book ;
      rdfs:seeAlso <http://isbn.nu/089686328X> ;
      :bookTitle "The African Lion" ;
      dc:subject :AfricanLion  .
And the class AfricanLion is a subclass of the class Lion:
:AfricanLion
      a       owl:Class;
      rdfs:subClassOf :Lion .

Considerations when choosing approach 1:

OWL code for approach 1

[N3] [RDF/XML]

Summary of 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 also need to use classes as subjects to implement this restriction.

Approach 2: Create special instances of the class to be used as property values

We can treat the hierarchy of animal species as a hierarchy of subjects, create individuals corresponding to all the subjects and use these individuals as values for the dc:subject property (Figure 2).

Creating a hierarchy of subjects and a parallel set of subject individuals

Figure 2. Using a hierarchy of subjects and a parallel set of subject individuals.

Thus, we will have, for example, an individual LionSubject that will be an instance of the Lion class:

  :LionSubject
      a       :Lion .
We can then use the LionSubject as the value of the property dc:subject for the LionsLifeInThePrideBook individual:
:LionsLifeInThePrideBook
      a       :Book ;
      rdfs:seeAlso <http://isbn.nu/0736809643> ;
      :bookTitle "Lions: Life in the Pride" ;
      dc:subject :LionSubject .

Considerations when choosing approach 2:

OWL code for approach 2

[N3] [RDF/XML]

Summary of approach 2

This approach results in an OWL DL ontology and may be a good one 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 books with a subject "lion" to books with a subject "African lions", for example. Furthermore, if the hierarchy of animals is imported and the source uses the hierarchy to describe actual animals, using this approach is inconsistent with this interpretation. You need to maintain consistency between the set of classes representing subjects and the set of corresponding individuals.

Approach 3: Create a parallel hierarchy of instances as property values

We can create a single class Subject and make all the subjects to be individuals that are instances of this class Subject (Figure 3):
 :LionSubject
      a       :Subject ;
      rdfs:seeAlso :Lion .
using a property other than rdfs:subclassOf to organize the subject hierarchy

Figure 3. Using a property other than rdfs:subClassOf to organize the subject hierarchy

We can use the annotation property rdfs:seeAlso to link the LionSubject individual to the Lion class. Note that rdfs:seeAlso is an annotation property and hence giving it a value that is a class does not take us out of OWL DL. In this approach, we are essentially using individuals as surrogates for classes.

We can then create explicit relations between different subjects, which will re-create the hierarchy for animals that we have in mind.

 :parentSubject
      a       owl:TransitiveProperty , owl:ObjectProperty ;
      rdfs:domain :Subject ;
      rdfs:range :Subject ;
      rdfs:seeAlso <http://www.w3.org/2004/02/skos/core#broader> .

:AfricanLionSubject
      a       :Subject ;
      rdfs:seeAlso :AfricanLion ;
      :parentSubject :LionSubject .
While we create our own property parentSubject, we can also use the corresponding properties from the SKOS-Core 1.0 schema, which is an RDF schema for representing thesauri and similar types of knowledge organization systems. So, for example parentSubject is similar to skos:broader. The SKOS schema provides a rich vocabulary for handling subject hierarchy, with additional properties such as skos:narrower, skos:related, and so on.

Considerations when choosing Approach 3

OWL code for approach 3

[N3] [RDF/XML]

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: Create a special restriction in lieu of using a specific value

This approach enables us to use a DL reasoner to infer, for example, that a book that has Lion as a subject also has Animal as its subject. In this approach, we create a new class to represent a class of all books with a particular subject. For example, we create a class BookAboutLions to represent all books that have Lion as one of their subjects. We then assign a subject to a specific book by making the book an instance of one of these classes, instead of explicitly setting a property value for the instance. Thus, for example the individual LionsLifeInThePrideBook will be an instance of the class BookAboutLions (Figure 4). We create similar classes for any subject category of books that we are interested in, such as BookAboutAnimals, BookAboutAfricanLions .

using members of a class as values for the property

Figure 4. Using members of a class as values for properties.

The key in this pattern is the definition of the new book classes. Because these classes represent all the books about a particular subject, we include subject in the definition. The following, for example, is the definition of the class BookAboutLions:

:BookAboutLions
      a       owl:Class ;
      owl:equivalentClass
              [ a       owl:Class ;
                owl:intersectionOf ([ a       owl:Restriction ;
                                              owl:onProperty dc:subject ;
                                              owl:someValuesFrom :Lion
                                    ] 
                                    :Book)
              ] .
A specific instance of this class LionsLifeInThePrideBook would then be defined as follows:
:LionsLifeInThePrideBook
      a       :BookAboutLions ;
      rdfs:seeAlso <http://isbn.nu/0736809643> ;
      :bookTitle "Lions: Life in the Pride" .

The code above says, literally, that this book instance (LionsLifeInThePrideBook) is an instance of a class, all of whose members have at least one instance of the class Lion as the value for the dc:subject property. In OWL, it is not necessary to create any explicit instances of these classes that we use in the someValuesFrom restriction (e.g., Lion above). In Figure 4, we include these instances in the diagram as if they were explicit, and use dotted lines to denote that they may not actually exist.

This approach approximates the interpretation that we used in the previous approaches by using unspecified members of a class rather than the class itself as property values (Figure 4). We define the class BookAboutAnimals as a class of books where the subject is some (unidentified) animal or animals. Similarly, a BookAboutLions class will be a class of books where a subject is some (unidentified) lion or lions.

A DL reasoner will be able to classify LionsLifeInThePrideBook as an instance of the class BookAboutAnimals.

Note that there a correspondence between the hierarchy of classes of books on specific subjects (such as BookAboutAnimals, BookAboutLions, and BookAboutAfricanLions) and the classes in the species hierarchy that we use as subjects (Animal, Lion, AfricanLion). The hierarchy of books essentially parallels the hierarchy of subjects, although it does not have to have a book class corresponding to each subjects—only the subjects that we are interested in. If the book classes are defined as above, a DL reasoner will be able to infer automatically the hierarchy of book classes, based on the hierarchy of subjects.

There is a variant to this approach in which we merge the two steps into one. Instead of creating an explicit named class, BookAboutLions, and then creating an instance of this class, we create the instance and assign its type to be an anonymous class of type owl:Restriction. In this variant, there is no explicitly named class corresponding to BookAboutLions. For example, we can define LionsLifeInThePrideBook as follows:

:LionsLifeInThePrideBook
      a       :Book;
      [ a       owl:Restriction ;
                owl:onProperty dc:subject ;
                owl:someValuesFrom :Lion
      ];
      rdfs:seeAlso <http://isbn.nu/0736809643> ;
      :bookTitle "Lions: Life in the Pride" .

Considerations when choosing Approach 4

OWL code for approach 4

[N3] [RDF/XML]

Summary of approach 4

This approach can make the most use of DL reasoners. It represents a different interpretation of the subject as being a prototypical instance of a class rather than a whole class of things or a specific subject corresponding to that class. With the understanding that you are using a different interpretation, this approach may be a good one to use if using DL reasoners to classify individuals based on their subjects (or another property used in its place) is important.

Approach 5: Use classes directly as annotation property values

Another way to stay in OWL DL is to use classes as values for annotation properties (Figure 5). This approach is very similar to approach 1, but it treats dc:subject as an annotation property:

 

dc:subject
      a       owl:AnnotationProperty .
:LionsLifeInThePrideBook
      a       :Book ;
      rdfs:seeAlso <http://isbn.nu/0736809643> ;
      :bookTitle "Lions: Life In The Pride" ;
      dc:subject :Lion  .

Using classes as values for annotation properties

Figure 5. Using classes as values for annotation properties.

Considerations when choosing Approach 5

OWL code for approach 5

[N3] [RDF/XML]

Summary of approach 5

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.

References

[N3]
Primer: Getting into RDF and Semantic Web using N3, http://www.w3.org/2000/10/swap/Primer .
[OWL Overview]
OWL Web Ontology Language Overview, Deborah L. McGuinness and Frank van Harmelen, Editors, W3C Recommendation, 10 February 2004, http://www.w3.org/TR/2004/REC-owl-features-20040210/ . Latest version available at http://www.w3.org/TR/owl-features/ .
[OWL Guide]
OWL Web Ontology Language Guide, Michael K. Smith, Chris Welty, and Deborah L. McGuinness, Editors, W3C Recommendation, 10 February 2004, http://www.w3.org/TR/2004/REC-owl-guide-20040210/ . Latest version available at http://www.w3.org/TR/owl-guide/ .
[OWL Semantics and Abstract Syntax]
OWL Web Ontology Language Semantics and Abstract Syntax, Peter F. Patel-Schneider, Patrick Hayes, and Ian Horrocks, Editors, W3C Recommendation, 10 February 2004, http://www.w3.org/TR/2004/REC-owl-semantics-20040210/ . Latest version available at http://www.w3.org/TR/owl-semantics/ .
[RDF]
Resource Description Framework (RDF) Model and Syntax Specification , Ora Lassila, Ralph R. Swick, Editors. World Wide Web Consortium Recommendation, 1999,
http://www.w3.org/TR/1999/REC-rdf-syntax-19990222/.
Latest version available at http://www.w3.org/TR/REC-rdf-syntax/.
[RDFS]
RDF Vocabulary Description Language 1.0: RDF Schema , Dan Brickley and R.V. Guha, Editors. W3C Recommendation, 10 February 2004,
http://www.w3.org/TR/2004/REC-rdf-schema-20040210/ .
Latest version available at http://www.w3.org/TR/rdf-schema/.
[RDF Semantics]
RDF Semantics, Pat Hayes, Editor, W3C Recommendation, 10 February 2004, http://www.w3.org/TR/2004/REC-rdf-mt-20040210/ . Latest version available at http://www.w3.org/TR/rdf-mt/ .
[RDF Vocabulary]
RDF Vocabulary Description Language 1.0: RDF Schema, Dan Brickley and R. V. Guha, Editors, W3C Recommendation, 10 February 2004, http://www.w3.org/TR/2004/REC-rdf-schema-20040210/ . Latest version available at http://www.w3.org/TR/rdf-schema/ .

Acknowledgements

The editor would like to thank the following Working Group members for their contributions to this document: Aldo Gangemi, Pat Hayes, Aditya Kalyanpur, Brian McBride, Alan Rector, Bernard Vatant. Atanas Kiryakov, Peter Mika, and York Sure have also contributed to the document.

This document is a product of the Ontology Engineering and Patterns Task Force of the Semantic Web Best Practices and Deployment Working Group.


Valid HTML 4.01! Valid CSS!