David R Newman

<< Back to PhD Homepage

How to Write Good OWL Ontologies

In my experience of reviewing other ontologies, reading papers on OWL and writing my own ontologies, I have found some good design practices and some really quite bad ones. Therefore, in this blog I intend to set out good design practices for OWL ontologies and why I believe these to be better than some of the practices that I have found.

Contents

Entries

<< Previous Entry | Next Entry >>

11/06/2007 Qualified Cardinality Restrictions: A New Feature of OWL 1.1

A Qualified Cardinality Restriction (QCR) is where there is a restriction on the cardinality for a particular range of objects, that is not the complete range of the property defined in the ontology. Take for example an ontology for defining the body. A typical human body has two legs, two arms, one head, etc. As part of the human body ontology you might want to restrict what properties a body object may have to be a valid body object, i.e. no more than two legs, two arms and one head. One way of going about this is to define three OWL properties, hasArm, hasLeg and hasHead. Within the definition of a body object class an OWL restriction could be defined that has a maximum cardinality of two for the hasArm and hasLeg properties and a cardinality of one for hasHead, something like the following:

<owl:Class rdf:id="Body">
  <rdfs:subClassOf>
    <owl:Restriction>
      <owl:onProperty>
        <owl:ObjectProperty rdf:about="#hasArm"/>
      </owl:onProperty>
      <owl:maxCardinality>2</owl:maxCardinality>
    </owl:Restriction>
  </rdfs:subClassOf>
  <rdfs:subClassOf>
    <owl:Restriction>
      <owl:onProperty>
        <owl:ObjectProperty rdf:about="#hasLeg"/>
      </owl:onProperty>
      <owl:maxCardinality>2</owl:maxCardinality>
    </owl:Restriction>
  </rdfs:subClassOf>
  <rdfs:subClassOf>
    <owl:Restriction>
      <owl:onProperty>
        <owl:ObjectProperty rdf:about="#hasHead"/>
      </owl:onProperty>
      <owl:cardinality>1</owl:cardinality>
    </owl:Restriction>
  </rdfs:subClassOf>
</owl:Class>

This initially seems quite an adequate solution but consider how many properties will need to be defined to cover every body part, this could potentially be huge. A better way of solving this problem is to only have one property that has a greater range but restiction this range in the OWL restriction in the class, this is a QCR. The problem is that OWL 1.0 does not support this. OWL 1.1 does support this but it is not yet a standard, it is currently a W3C sumission request. Below is the equivalent class definition but with out the need to define the three different properties for different body parts.

<owl11xml:OWLClass rdf:id="Body">
  <owl11xml:SubClassOf>
    <owl11xml:ObjectMaxCardinality owl11xml:cardinality="2">
      <owl11xml:ObjectProperty owl11xml:URI="#hasPart"/>
      <owl11xml:OWLClass owl11xml:URI="#Arm"/>
    </owl11:ObjectMaxCardinality>
    <owl11xml:ObjectMaxCardinality owl11xml:cardinality="2">
      <owl11xml:ObjectProperty owl11xml:URI="#hasPart"/>
      <owl11xml:OWLClass owl11xml:URI="#Leg"/>
    </owl11:ObjectMaxCardinality>
    <owl11xml:ObjectExactCardinality owl11xml:cardinality="1">
      <owl11xml:ObjectProperty owl11xml:URI="#hasPart"/>
      <owl11xml:OWLClass owl11xml:URI="#Head"/>
    </owl11:ObjectExactCardinality>
  </owl11xml:SubClassOf>
</owl11xml:OWLClass>

This syntax is based on QCR example found at http://www.w3.org/Submission/owl11-xml_syntax/. As an official release of the ontology has yet to me made this may not be the perfect syntax, it does however demonstrate how much quicker and easier it is to define the restrictions required to restrict what a human body must be. First, it only requires the definition of one property: hasPart, but also the definition of these restrictions can be more concise because OWL 1.1 allows these to be concatenated within one SubClassOf statement. The second of these is only really a syntactical thing for XML but this greater conciseness is beneficial in making the XML representation more human-readable. OWL 1.1 appears to have tried to tidy up how certain aspects of OWL are defined to make them more concise and easy to follow. In my experience representing an OWL ontology in XML is difficult because often there appears to be 2, 3, sometimes even half a dozen ways of appearing to achieve the same thing but it is difficult to be certain if these different ways actually represent exactly the same thing in the long run. I am not certain if OWL 1.1 is making any concerted effort to try to tackle this problem. The examples given in the previous URL are really the only significant XML example to go at the moment.

<< Back to PhD Homepage

Page written by David R Newman (drn[at]ecs.soton.ac.uk). Last updated June 27 2018 14:44:18.