Some OWL snippets:

  <rdf:Description rdf:about="">
    <p:knows rdf:resource="" />
    <p:name>Jane Doe</p:name>

Describes Jane ==
Jane’s name is Jane Doe. Jane is a person. Jane knows

<rdf:RDF xml:base=""
  <p:Person rdf:about="#jane">
    <p:knows rdf:resource="" />
    <p:name>Jane Doe</p:name>

Represents the same info as previous but uses base attr and relative references.

<!DOCTYPE rdf:RDF [<!ENTITY owl "">]>
<rdf:RDF xmlns:owl=""
    <owl:Ontology rdf:about="">
        <rdfs:label>My Ontology</rdfs:label>
        <rdfs:comment>An example ontology</rdfs:comment>

    <owl:Class rdf:ID="Person"/>

    <owl:Class rdf:ID="Man"/>
        <rdfs:subClassOf rdf:resource="#Person"/>

    <owl:ObjectProperty rdf:ID="hasChild"/>

    <owl:ObjectProperty rdf:ID="hasDaughter">
        <rdfs:subPropertyOf rdf:resource="#hasChild"/>

    <owl:DatatypeProperty rdf:ID="age"/>

    <owl:ObjectProperty rdf:ID="isParentOf">
        <owl:inverseOf rdf:resource="#isChildOf"/>

    <owl:ObjectProperty rdf:ID="isTallerThan">
        <rdf:type rdf:resource="&owl;TransitiveProperty"/>

    <owl:ObjectProperty rdf:ID="isFriendOf">
        <rdf:type rdf:resource="&owl;SymmetricProperty"/>

    <owl:ObjectProperty rdf:ID="hasSSN">
        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
        <rdf:type rdf:resource="&owl;InverseFunctionalProperty"/>

Object properties specify relationships between pairs of resources. Datatype properties, on the other hand, specify a relation between a resource and a data type value.

…owl:InverseFunctionalProperty specifies a property that can be used as a primary key.

  • Man is a Person.
  • hasDaughter is a subclass of hasChild.
  • age: not an ObjectProperty. it is a data property.
  • isParentOf and isChildOf: if A isParentOf B –> B isChildOf A
  • isTallerThan: if A>B and B>C –> A>C
  • isFriendOf: if A♥B –> B♥A
  • hasSSN is both an owl:FunctionalProperty (because each person has at most one Social Security Number) and an owl:InverseFunctionalProperty (because a Social Security Number can be used to uniquely identify U.S. citizens).

<p:Person rdf:about=” >
         rdf:resource=”” />

They’re the same thing.

   <owl:distinctMembers rdf:parseType=”Collection”>
      <p:Person rdf:about=”#Bob” />
      <p:Person rdf:about=”#Sue” />
      <p:Person rdf:about=”#Mary” />

These are all different

<owl:Class rdf:ID=”Father”>
   <owl:intersectionOf rdf:parseType=”Collection”>
      <owl:Class rdf:about=”#Parent” />
      <owl:Class rdf:about=”#Male” />

Father is a male and parent. Didn’t use subClassOf Parent && subClassOf Male here since we want to show that someone is father just because of the gender and parenthood. Using subClassOf like that would mean all fathers must be parent and male. It doesn’t mean fatherhood is gained with being a male and a parent.

<owl:Class rdf:ID=”Man”>
  <owl:intersectionOf rdf:parseType=”Collection”>
    <owl:Class rdf:about=”#Person”>
       <owl:complementOf rdf:resource=”#Woman” />

Any person not woman are man. It is important to intersect with Person as well. Because, not a piece of bread is not a woman but not a man too.

<owl:Class rdf:ID=”Band”>
       <owl:onProperty rdf:resource=”#hasMember” />
       <owl:allValuesFrom rdf:resource=”#Musician” />

Band is a subClassOf the anonymous class defined by the restriction. The restriction says a band member must be a musician.

Snippet above doesn’t say though, a group of musicians is a band.

<owl:Class rdf:ID=”Male”>
    <owl:disjointWith rdf:resource=”#Female”>

This is not the same with complementOf. complementOf would mean anything that is not male is female. A piece of wood is not male nor female!

<owl:Class rdf:ID=”PrimaryColor”>
    <owl:oneOf rdf:parseType=”Collection”>
        <owl:Thing rdf:about=”#Red” />
        <owl:Thing rdf:about=”#Blue” />
        <owl:Thing rdf:about=”#Yellow” />

Self explanatory…

<owl:Ontology rdf:about="">
  <rdfs:label>News Ontology, v. 2.0</rdfs:label>
          rdf:resource="" />
          rdf:resource=”” />

Imports person ontology.

<p:Person rdf:about=”#Bob”>
   <p:hasMom rdf:resource=”#Sue” />
   <p:hasMom rdf:resource=”#Mary” />

OWL doesn’t make unique names assumption. Statement above infers that Sue and Mary is the same person.

OWL/Ontology terms


  • Individuals, represent objects in the domain in which we are interested (e.g. Matt, US, Turkey, Fido, Fluffy)
  • OWL classes are interpreted as sets that contain individuals (e.g. country, person)
  • Properties are binary relations3 on individuals - i.e. properties link two individuals together (e.g. Matt livesIn Turkey, Matt hasPet Fluffy)
  • The word concept is sometimes used in place of class. Classes are a concrete representation of concepts.
  • A class hierarchy may also be called a taxonomy.
  • OWL Properties represent relationships. There are two main types of properties, Object properties and Datatype properties.
    • Object properties are relationships between two individuals. (Matt hasSister Jane)
    • Data properties: (Matt hasAge 31)
    • OWL also has a third type of property – Annotation properties: can be used to add information (metadata — data about data) to classes, individuals and object/datatype properties. (JetEngine dc:creator Matthew Somebody)
  • property characteristics
    • Functional Properties:
      • Functional properties are also known as single valued properties and also features. ()
      • for a given individual, there can be at most one individual that is related to the individual via the property
      • e.g. Jean hasBirthMother Margaret
    • Inverse Functional Properties:
      • inverse property is functional
      • e.g. isBirthMotherOf is inverse functional
    • Transitive Properties
      • If the individual Matthew has an ancestor that is Peter, and Peter has an ancestor that is William, then we can infer that Matthew has an ancestor that is William
      • If a property is transitive then its inverse property should also be transitive.
      • if a property is transitive then it cannot be functional
    • Symmetric Properties
      • Matt hasSibling Jane
      • Jane hasSibling Matt
    • Asymmetric properties
      • Robert is a child of David, then David cannot be a child of Robert
    • Reflexive properties
      • A property P is said to be reflexive when the property must relate individual a to itself
        • George knows George
        • George knows Matt
      • e.g. isBirthMotherOf cannot be reflexive
    • Irreflexive properties
      • it can be described as a property that relates an individual a to individual b, where individual a and individual b are not the same
      • e.g. isBirthMotherOf
  • Properties link individuals from the domain to individuals from the range.
    • domain of the hasTopping property is Pizza
    • range of the hasTopping property PizzaTopping (w/ subclass hierarchy)
  • In general, domain for a property is the range for its inverse, and the range for a property is the domain for its inverse.

  • Property Restrictions
    • Quantifier Restrictions
      • existential restrictions
        • by far the most common type of restrictions in OWL ontologies.
        • Existential restrictions describe classes of individuals that participate in at least one relationship along a specified property to individuals that are members of a specified class.
        • hasTopping some MozzarellaTopping: This restriction describes the class of individuals that have at least one topping that is Mozzarella.
        • hasBase some PizzaBase: all of the individuals that have at least one pizza base
      • universal restrictions
        • Universal restrictions describe classes of individuals that for a given property only have relationships along this property to individuals that are members of a specified class.
        • Individuals that are members of VegetarianPizza can only have toppings that are CheeseTopping or VegetableTopping.
    • Cardinality Restrictions
      • class of individuals that have at least, at most or exactly a specified number of relationships with other individuals or datatype values
    • hasValue Restrictions
      • they describe relationships between an individual and data values.
  • necessary conditions : Cheesy pizza is a pizza and it has cheese topping
    • With necessary conditions alone, we cannot say that, “If something fulfills these conditions then it must be a member of this class”
    • Primitive class: a class that only has necessary conditions
    • Necessary conditions are called Superclasses in Protege
  • necessary and sufficient conditions :
    • Cheesy pizza is a pizza and it has cheese topping and anything that is pizza and that has cheese topping is a cheesy pizza
    • necessary and sufficient conditions are called Equivalent classes in Protege
    • Defined Class: a class that has at least one set of necessary and sufficient conditions
comments powered by Disqus