Spis treści

Introduction to Description Logics

Last verification: 20180914
Tools required for this lab:

Introduction

1 Description Logics Intro

In Introduction to ontologies you have learnt basic ideas about ontologies.

The above information can be expressed in RDF Schema which is a simple ontology language for the Semantic Web.

However, more complex ontologies require more expressive language. For example:

  1. How to say that the range of a property hasChildren is Person when applied to a person and Elephant when applied to an elephant?
  2. How to say that all instances of person have a mother that is also a person, or that persons have exactly 2 parents?
  3. How to say that isPartOf is a transitive property, that hasPart is the inverse of isPartOf or that touches is symmetrical?

In this lab, you will get to know more advanced ontologies based on Description Logics (DL). You will learn the DL languages and understand how OWL corresponds to selected DL.

1.1 Description Logics Basics

semantic network example
Fig.1. Exemplary graph.

1.1.1 Examples of DL expressions

Assertions about individuals

  1. concept assertions e.g.
    •  person(Fred) - Fred is a person
    •   cat(Tibbs) Tibbs is a cat
  2. role assertions e.g.
    •   has\_pet(Fred, Tibbs) - Fred has a pet which is Tibbs

Statements about concepts

  1. concept definitions (necessary and sufficient conditions) e.g.
    •   man \equiv person \sqcap adult \sqcap male - A man is an adult male person
    •   cat\_liker \equiv person \sqcap \exists likes.cat - A cat liker is a person and there exists a cat that he/she likes
  2. relations between concepts e.g.
    •  likes(cat\_liker, cat) - (every) cat liker likes a cat
    •  eats\_only(sheep, grass) - (every) sheep eats only grass
  3. axioms e.g.
    •  cat \sqsubseteq animal a cat is an animal (hierarchy of concepts)
    •   sheep \sqsubseteq animal \sqcap \forall eats.grass a sheep is an animal which eats only grass (it's a necessary but not sufficient condition)

1.1.2 Relation to First Order Logic

Description DL syntax FOL syntax Set algebra
A man is a male and an adult and a person  C_{1} \sqcap ... \sqcap C_{n}  C_{1}(x) \land ... \land C_{n}(x)  C_{1} \cap ... \cap C_{n}
A newspaper is a broadsheet or a tabloid  C_{1} \sqcup ... \sqcup C_{n}  C_{1}(x) \lor ... \lor C_{n}(x)  C_{1} \cup ... \cup C_{n}
Everything a vegetarian eats is not an animal   \neg C   \neg C(x)  C^c (complement of set)
EU countries are: Germany, France, …, Poland   \lbrace x_{1} \rbrace \sqcup ... \sqcup \lbrace x_{n} \rbrace   x=x_{1} \lor ... \lor x=x_{n}   \lbrace x_{1} \rbrace \cup ... \cup \lbrace x_{n} \rbrace
An old lady has only cats   \forall P.C   \forall y.P(x,y) \rightarrow C(y)  \pi_Y(P) \subseteq C
A dog owner has some dog(s)   \exists P.C   \exists y.P(x,y) \land C(y) \pi_Y(P) \cap C \neq \emptyset (Π - projection)
A reasonable man has maximum 1 woman ;-)   \leq nP   \exists^{\leq n}y.P(x,y)  card(P)\leq n (card - cardinality)
An animal lover has minimun 3 pets   \geq nP   \exists^{\geq n}y.P(x,y)   card(P) \geq n
A kid is the same as a young person   C \equiv D   \forall x.C(x) \leftrightarrow D(x)   C \equiv D
Every cat is an animal   C \sqsubseteq D   \forall x.C(x) \rightarrow D(x)  C \subseteq D

1.2 Description Logic Languages

1.2.1 Basic DL language

AL (Attributive Language) - is a minimal language of practical interest

Constructor Syntax Semantics
(atomic concept)   A        A^{\mathcal{I}} = A^{\mathcal{I}} \subseteq \Delta^{\mathcal{I}}
(atomic role)   R        R^{\mathcal{I}} = R^{\mathcal{I}} \subseteq \Delta^{\mathcal{I}} \times \Delta^{\mathcal{I}}
(universal concept)    \top    \top^{\mathcal{I}} = \Delta^{\mathcal{I}}
(bottom concept)    \bot    \bot^{\mathcal{I}} = \emptyset
(atomic negation)    \neg A   (\neg A)^{\mathcal{I}} = \Delta^{\mathcal{I}} \setminus A^{\mathcal{I}}
(intersection)    C \sqcap D      (C \sqcap D)^{\mathcal{I}} = C^{\mathcal{I}} \cap D^{\mathcal{I}}
(value restriction)    \forall R.C     (\forall R.C)^\mathcal{I} = \lbrace a \in \Delta^\mathcal{I} \vert \forall b, (a,b) \in R^\mathcal{I} \rightarrow b \in C^{\mathcal{I}} \rbrace
(limited existential quantification)   \exists R.\top    (\exists R.\top)^\mathcal{I} = \lbrace a \in \Delta^\mathcal{I} \vert \exists b, (a,b) \in R^\mathcal{I} } \rbrace

Examples

Using the above constructors one can define classes e.g.:

1.2.1 More Description Logics

Constructor Syntax Semantics
 \mathcal{U} - union  C \sqcup D  (C \sqcup D)^\mathcal{I} = C^\mathcal{I} \cup D^\mathcal{I}
 \mathcal{E} - full existential quantification  \exists R.C (\exists R.C)^\mathcal{I} = \lbrace a \in \Delta^\mathcal{I} \vert \exists b, (a,b) \in R^\mathcal{I} \land b \in C^{\mathcal{I}} \rbrace
 \mathcal{N} - number restrictions:  \geq n R
 \leq n R
 (\geq n R)^\mathcal{I} = \lbrace a \in \Delta^\mathcal{I} \arrowvert { \mid\lbrace b \mid (a,b) \in R^\mathcal{I} \rbrace \mid \geq n } \rbrace
 (\leq n R)^\mathcal{I} = \lbrace a \in \Delta^\mathcal{I} \arrowvert { \mid\lbrace b \mid (a,b) \in R^\mathcal{I} \rbrace \mid \leq n } \rbrace
 \mathcal{C} - negation   \neg C  ( \neg C)^\mathcal{I} = \Delta^\mathcal{I} \setminus C^\mathcal{I}

Resulting languages:   \mathcal{AL} [ \mathcal{U}][ \mathcal{E} ][\mathcal{N} ][\mathcal{C} ]

1.2.2 Nominals in TBox

1.2.3 Language extensions

Base DL is ALC (≈ALUE). Additional letters indicate language extensions:

  1. regarding concept constructors
    •  \mathcal{F} for functional number restrictions (e.g., ≤1hasMother)
    •  \mathcal{N} for number restrictions (graded modalities, e.g., ≥2hasChild, ≤3hasChild)
    •  \mathcal{Q} for qualified number restrictions (graded modalities, e.g., ≥2hasChild.Doctor))
    •  \mathcal{O} for nominals/singleton classes (e.g., {Italy})
  2. regarding role constructors
    • role intersection: R∩S, role union: R∪S, complement roles: ¬R, chain (composition) of roles: RoS
    •  \mathcal{I} for inverse roles (e.g.,  isChildOf \equiv hasChild^{–})
  3. additional role axioms
    •  \mathcal{S} Role transitivity - often used for  \mathcal{ALC} extended with transitive roles
    •  \mathcal{H} Role hierarchy (e.g.,  hasDaughter \sqsubseteq hasChild)
    •  \mathcal{R} Complex role inclusions: RoS ⊆ R, RoS ⊆ S
  4. other
    •   ^{(\mathcal{D})} Use of datatype properties, data values or data types

Expressiveness of the language influence its reasoning complexity: DL complexity navigator

1.3 Knowledge Representation systems based on DL

KRS

1.3.1 Terminologies (TBox)

TBox semantics:

TBox Example

 
\\
Animal \sqsubseteq \exists eats. \top \\
\mathit{Giraffe}  \sqsubseteq  Animal\\
Giraffe  \sqsubseteq  \forall eats.Leaf\\


\\
Vegetarian \equiv (\forall eats.(\neg (\exists partOf.Animal))) \sqcap (\forall eats.(\neg Animal)) \sqcap Animal\\
Cow \sqsubseteq Vegetarian\\
MadCow \equiv \exists eats.(\exists partOf.Sheep \sqcap Brain) \sqcap Cow \\

 
\\
Elderly \sqsubseteq  Adult\\
OldLady \equiv Elderly \sqcap Female \sqcap Person \\

 
\\
OldLady \sqsubseteq  \exists hasPet.Animal \sqcap \forall hasPet.Cat \\ 
DogOwner \equiv Person \sqcap \exists hasPet.Dog \\
AnimalLover \equiv Person \sqcap \geq 3 hasPet \\

1.3.2 World Description (ABox)

ABox semantics

ABox Example

 
\\Cat(Tibbs)\\
Dog(Fido)\\
Cow(Flossie)\\
\\
Person(Fred)\\
Person(Joe)\\
\leq 1 hasPet(Joe)\\
Female(Minnie)\\
Male(Mick)\\
\\
hasPet(Joe, Fido)\\
hasPet(Fred,Tibbs)\\
isPetOf(Rex,Mick)\\
\\
reads(Mick, DailyMirror)\\
drives(Mick, Q123ABC)\\
\\
Van(Q123ABC)\\
WhiteThing(Q123ABC)\\

1.3.3 Unique name assumption and Closed-world assumption

There are two features of Description Logic that are not shared by most other data description formalisms: DL does not make the Unique name assumption (UNA) or the Closed-world assumption (CWA):

1.4 OWL (Web Ontology Language) and DL

1.4.1 OWL and DL Syntax Compared


OWL and DL constructs


OWL and DL axioms

Example

  1. Pizza ontology fragment in DL:
  2. The same fragment in OWL Abstract syntax:
    Namespace(p = <http://example.com/pizzas.owl#>)
          Ontology( <http://example.com/pizzas.owl#>
            Class(p:Pizza partial
              restriction(p:hasBase someValuesFrom(p:PizzaBase)))
            DisjointClasses(p:Pizza p:PizzaBase)
            Class(p:NonVegetarianPizza complete
              intersectionOf(p:Pizza complementOf(p:VegetarianPizza)))
            ObjectProperty(p:isIngredientOf Transitive
              inverseOf(p:hasIngredient))
          )

1.4.2 OWL - Abstract syntax

Using the tables above translate the following class descriptions into DL syntax:

Ontology(
 Class(pp:male partial)
 Class(pp:adult partial)
 Class(pp:elderly partial pp:adult)

 Class(pp:pet complete restriction(pp:is_pet_of someValuesFrom(owl:Thing)))

 Class(pp:animal partial restriction(pp:eats someValuesFrom(owl:Thing)))

 /* Vegetarians do not eat animals or parts of animals */

 Class(pp:vegetarian complete 
    intersectionOf(pp:animal
      restriction(pp:eats allValuesFrom(complementOf(pp:animal)))
      restriction(pp:eats 
	 allValuesFrom(complementOf(restriction(pp:part_of 
					        someValuesFrom(pp:animal)))))))

 DisjointClasses(pp:dog pp:cat)

 ObjectProperty(pp:eaten_by)
 ObjectProperty(pp:eats inverseOf(pp:eaten_by) domain(pp:animal)) 

 SubPropertyOf(pp:has_pet pp:likes)

 Individual(pp:Tom type(owl:Thing))
 Individual(pp:Tibbs type(pp:cat))

1.4.3 OWL - XML syntax

<owl:Class>
  <owl:intersectionOf rdf:parseType="collection">
    <owl:Class rdf:about="#Person"/>
    <owl:Restriction>
      <owl:onProperty rdf:resource="#hasChild"/>
      <owl:toClass>
        <owl:unionOf rdf:parseType="collection">
          <owl:Class rdf:about="#Doctor"/>
          <owl:Restriction>
            <owl:onProperty rdf:resource="#hasChild"/>
            <owl:hasClass rdf:resource="#Doctor"/>
          </owl:Restriction>
        </owl:unionOf>
      </owl:toClass>
    </owl:Restriction>
  </owl:intersectionOf>
</owl:Class>

1.4.4 Species of OWL

OWL 1:

  1. OWL Full is union of OWL syntax and RDF
    • RDF semantics extended with relevant semantic conditions and axiomatic triples
  2. OWL DL is restricted to FOL fragment
    • Has standard (First Order) model theoretic semantics
    • Equivalent to SHOIN(D): role transitivity(S) + role hierarchy (H) + nominals (O) + inverse (I) + number restrictions (N) + datatype properties, data values or data types (D) = SHOIN(D)
  3. OWL Lite is „simpler” subset of OWL DL
    • Equivalent to SHIF(D): role transitivity(S) + role hierarchy (H) + inverse (I) + functionality (F) + datatype properties, data values or data types (D)= SHIF(D)

OWL 2:

2 Lab instructions

2.1 Description Logics - TBox and ABox

Here we will do some Description Logics „with pen and paper”.

2.2 Description Logics - Reasoning

TBox
Directory \sqsubseteq \forall dir\_child.(Directory \sqcup File) \sqcap (\leq 1\ dir\_child^{-}.\top)
File \sqsubseteq ( \forall dir\_child.\bot)\ \sqcap \neg Directory \sqcap (\leq 1\ dir\_child^{-}.\top)
FileSysRoot \sqsubseteq Directory \sqcap \forall dir\_child^{-}.\bot
FileSysElement \equiv ( \exists (dir\_child^{-})^{*}.FileSysRoot ) \sqcup ( FileSysRoot )
ABox
dir\_child(a,b)
dir\_child(a,c)
dir\_child(c,a)
dir\_child(MyDir,Research)
dir\_child(MyDir,Teaching)
dir\_child(Research,Semweb.tex)
FileSysElement(Semweb.tex)
File(Semweb.tex)

If you want to know more

Lecture:

Description Logics: