Reasoning with Ontologies

Last verification: 20180914
Tools required for this lab: Protégé Desktop 5.0
Pellet 2.3.1 (pellet-2.3.1.zip)

Introduction

  • OWL is based on Description Logics formalism – if you want to know more about it, you can familiarize yourself with optional Intro to Description Logics lab.

Lab instructions

2.3 TBox and ABox [10 minutes]

  • The knowledge base in OWL (which is based on Description Logics) consists of two types of concepts:
    • TBox - terminology, intensional representation
    • ABox - assertions about individuals, extensional representation
  • 8-) Let's check if you understand this difference properly: Take your ontology from Protégé lab. Identify which statements belong to Terminology (TBox) and World Description (ABox). Put them in the report divided into two sections: TBox and ABox (5 statements for each section).

2.4 OWL Reasoning - Class Inference [10 minutes]

  • In Description Logics on which the OWL language is based there are the following reasoning tasks for classes (terminology, TBox):
    1. Class subsumption (Structuring the knowledge base)
    2. Class equivalence (Are two classes in fact the same class?)
    3. Class disjointness (Do classes A and B have common members?)
    4. Class consistency (Isn't class A empty?)
  1. Model the following ontology axioms in Protege:
    Class: bus_driver
        EquivalentTo: 
            person
            that drives some bus
    
    Class: driver
        EquivalentTo: 
            person
            that drives some vehicle
    
    Class: bus
        SubClassOf: 
            vehicle


    Hints:

    1. To build the first axiom:
      1. Create appropriate classes

      2. and ObjectProperties:

      3. Define the BusDriver class with Equivalent classes button
    2. Build the second axiom analogously:

    3. Build the third axiom using the SubClass of button:

  2. Start the reasoner (Reasoner → start reasoner) and observe the inferred class hierarchy. What conclusions have been drawn?

    1. 8-) Include the modified ontology in the report.
    2. 8-) Explain the inferred relations and conclusions.
  3. Analyze the reasoning examples given here in „Class Inferences” section.

2.5 OWL Reasoning - Instance Inferences [10 minutes]

  • In Description Logics on which the OWL language is based there are the following reasoning tasks for instances (world description, ABox):
    1. Class membership (is instance a contained in class C?)
    2. Instance retrieval (find all (known) individuals belonging to a given class)
  • and for the whole Knowledge Base (ABox+TBox):
    1. Global consistency of a knowledge base (Is the knowledge base meaningful?)
  1. Download the pre-prepared ontology and load it in Protege (NB: the ontology classes and those on screenshots may differ a little).
  2. Model the following ontology axioms in Protege:
    Individual: Daily_Mirror
        Types: 
            owl:Thing
    
    Individual: Q123ABC
        Types: 
            van,
            white_thing
    
    Individual: Mick
        Types: 
            man
        Facts: 
            reads  Daily_Mirror,
            drives  Q123ABC
    
    Class: white_van_man
        EquivalentTo: 
            man
            that drives some (van
            and white_thing)
        SubClassOf: 
            reads only tabloid


    For those not familiar with UK culture, White Van Man is a stereotype used to describe a particular kind of driver. Wikipedia provides an entry with some additional information and references.
    Hints:

    1. Create appropriate instances in Individuals tab
    2. If the instance is of 2 types, create it only once and then add the second type:
    3. Add object properties to connect individuals:
    4. Define the class:
  3. Start the reasoner (Reasoner → start reasoner) and observe the inferred class hierarchy. Where is the white_van_man? What conclusions have been drawn?
    1. 8-) Include the modified ontology in the report.
    2. 8-) Explain the inferred relations and conclusions.
  4. Analyze the reasoning examples given here in „Instance Inferences” section.

2.6 OWL Reasoning - Reasoners [5 minutes]

DL reasoners may be integrated with other tools - as in the case of Protege presented before - as well as run independently via various interfaces. Popular DL reasoners include: FaCT++, Pellet, HermiT, RacerPro and many others.

We will use the Pellet reasoner.

  1. Unpack the zip.
  2. Run pellet.sh help to get familiar with available commands.
  3. Try pellet.sh consistency <ontology> where the <ontology> is:
    1. Your ontology from previous lab
    2. people+pets.owl ontology provided with Pellet in examples/data/ directory
      and observe the results.
  4. Try pellet.sh classify <ontology> with the two above mentioned ontologies and observe the results.
    1. 8-) What are the results? Write them down or provide a screenshot of the answer in the report.

2.7 Advanced OWL reasoning [50 minutes]

These instructions are based on the The Family History Knowledge Base Tutorial1) by The University of Manchester, School of Computer Science.

  1. Download the ontologies.zip pack.
  2. Open Protege (type protege in command line on lab316 laptop).

2.7.1 Warm up

  1. Open (Family-tree-0.owl)
  2. It contains Sex, Female, Male, Person, Man and Woman Classes.
  3. Create hasSex property, Set domain and ranges on hasSex (Person/Sex), make it functional.
  4. Create restrictions on Person hasSex some Sex.
  5. Make Man and Woman defined (use Equivalent classes): Man EquivalentTo Person that hasSex some Male etc.
  6. Import plain-individuals, observe that none of them have any assertions on them. (Active Ontology tab → Imported ontologiesDirect imports).
  7. Choose an individual, add Types: Person and (hasSex some Male)
  8. Using the Reasoner menu in Protege (Reasoner → Start/Synchronize reasoner), classify the ontology. What inferences are made? Write them in the report 8-)

2.7.2 Characteristics of properties

  1. Close the previous ontology. Load Family-tree-1.owl. Check how Man and Woman classes are defined.
  2. Create object properties: hasFather, hasMother, make them functional, add domain and range: Person, Man/Woman, add inverse properties:
  3. Create restrictions on Person: has Mother some Woman, hasFather some Man
  4. Load individuals-1-parantage.owl file.
  5. Classify the ontology. What inferences are made? Write them in the report 8-)

2.7.3 Datatype properties

  1. Close the previous ontology. Load Family-tree-2.owl.
  2. Create or find datatype properties: birthYear, deathYear, make them functional.
  3. Create Victorian class: Person and birthYear some integer[>=1837, ⇐1901]
  4. Classify the ontology. How many individuals have been classified as Victorians? 8-)

2.7.4 Transitive properties

  1. Close the previous ontology. Load Family-tree-3.owl.
  2. Create a new super-property of hasParent called hasAncestor,
  3. Make it transitive and create inverse property.
  4. Clasify, look at property hierarchy. What do we know about Robert? 8-)
  5. Close the previous ontology. Load Family-tree-4.owl.
  6. Model the information about David:
  7. Classify the ontology. Answer the questions:
    1. What type does David_bright_1934 have? 8-)
    2. How many children does he have? 8-)

2.7.5 Property chains

  1. Close the previous ontology. Load Family-tree-5.owl.
  2. Add hasGrandParent sub prop of hasAncestor (inverse grandparentOf)
  3. Add domain and ranges
  4. Add sub properties hasGrandMother/Father + domains and ranges
  5. Add property chain hasParent o hasFather/Mother → hasGrandFather/Mother
  6. Classify the ontology. What do we learn about Robert? 8-)

2.7.6 Classes with Individuals, Open World Assumption

  1. Close the previous ontology. Load Family-tree-6.owl.
  2. Make class of all ancestors and class of robert's ancestors.
  3. Classify. What are the results?
  4. Make class of people with min 3 children.
  5. Classify the ontology, do we find parents with 3 children? Why? 8-)
  6. How to really find parents that have 3 children? 8-)
  7. How to make individuals different from each other? 8-)

Materials

1)
Updated version of the tutorial is available here.
pl/dydaktyka/semweb/lab-onto-reasoning.txt · ostatnio zmienione: 2018/09/14 13:58 przez kkutt
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0