COM759-2024/2025
Protégé
Build your ontology
guideline
Week 6
1
COM759-2024/2025
Recall: Roadmap to Create an Ontology
• Find out what the goals of the application are.
• Define the scope of the ontology.
• Gather knowledge about the domain.
• Define all entities of the ontology.
• Define all axioms of the ontology.
• Evaluate the ontology against the goals.
2
COM759-2024/2025
Tasks expected to be completed in CW2
1. Analysis of your domain
2. Concepts and Concept Hierarchies
3. Relations (Properties) and Relation Hierarchies
4. Defining Semantic Axioms of Domain
5. Modelling Concepts and Relations in Protégé
6. Evaluation of OWL File
Each is detailed in subsequent slide
3
COM759-2024/2025
T1: Analysis of your domain
• Identify and discuss the key concepts and relations of your
domain.
• Briefly explain what kind of queries your domain should be
capable of assisting a domain expert to answer.
• List some (say, 4 or 5) queries that you expect your
ontology to be capable of answering.
• e.g. about university related ontology,
Which course(s) does a student take?
Which lecturer(s) teach a specific student?
What are the courses offered in first semester?
4
COM759-2024/2025
T1: Analysis of your domain
• Find out what the goals of the application are.
• Define the scope of the ontology.
• Gather knowledge about the domain.
5
COM759-2024/2025
Competency questions: 4 or 5 questions
• Questions that an ontology must be able to answer
Informal description of the goals of the ontology
First insights into the domain vocabulary
The final ontology must answer the competency
questions (evaluation).
• Example competency questions:
What kinds of biological processes are there?
Which genes are involved in biological processes in the
brain?
List all genes that are involved in three or more biological
processes.
Which are the high-value customers?
Are basic kinship relations like parentage, grandparents,
siblings represented? 6
COM759-2024/2025
Formalizing competency questions
• To evaluate competency questions over the final
ontology, they need to be formalized.
What are the subclasses of BiologicalProcess?
What are the instances of ∃annotatedWith.∃
annotationProcess.∃situatedIn.Brain?
What are the instances of (≥ 3 annotatedWith.T)?
What are the instances of HighValueCustomer?
Does the ontology contain the relations hasParent,
hasGrandparent, hasSibling?
• This can only be done once the vocabulary of the
ontology is determined.
7
COM759-2024/2025
Knowledge acquisition
We may need to acquire knowledge from:
• Domain experts
– know a lot of the domain (coverage)
– are highly reliable (accuracy)
– typically don’t know much about ontology engineering
• Documents
– cover parts of the domain
– may be outdated
– cannot answer questions
– need to be interpreted
• Databases
– large amount of knowledge about individuals
– restricted knowledge about classes, relations, and axioms
– easy to import automatically
Knowledge Elicitation: Extract relevant knowledge in dialog with
the domain experts. 8
COM759-2024/2025
An example: Animals
• Task: Generate a small ontology to describe the content
of a children’s book about animals.
• Competency Questions:
What are the types of animals?
Where do the animals live?
What do they eat?
Are they dangerous?
Are they big or small?
Basic anatomy: legs, wings? feathers, fur?
. . . whatever else may be in the book 9
COM759-2024/2025
Terms extracted from knowledge elicitation
Horse Bear
Wild Wolf
Trout Gold1sh
Farmed Sheep
Grass Shark
Cow Herring
Dangerous Human
Cat Pet
Wheat Dog
Carnivorous Tree
10
COM759-2024/2025
Card sorting
• An informal procedure that identifies similarities
between terms
Write down each concept on a card
Organize them into piles
Identify what the pile represents -> new concept ->
new card
Link the piles together
Record the reasons for the sorting and the links
Repeat
11
COM759-2024/2025
Example: Animals
Animal: Plant: Fish: Property:
• Horse • Wheat • Herring • Pet
• Cat • Grass • Shark • Dangerous
• Wolf • Tree • Trout • Carnivorous
• Cow • Gold1sh • Wild
• Bear • Farmed
• Dog
• Sheep
Links:
• Fish are also animals.
• Some animals eat plants.
12
COM759-2024/2025
Three cards trick
• Select 3 cards at random
• Identify which 2 cards are the most similar
• Write down why-> new term?
• Write down why the 3rd is different -> new term?
Shark Wolf Goldfish
New terms:
• Scales / Fur
• Fins / Feet
• Water / Land
• Swimming / Walking
• Carnivorous / Herbivorous
• Large / Small
• Gray / Gold 13
COM759-2024/2025
Questions
Is it a living thing? yes
Is it a plant? no
Is it an animal? yes
Is it a mammal? . . .
We now know that plants and animals are living things,
they are possibly disjoint, and mammals are animals.
14
COM759-2024/2025
Organize terms
• Identify classes (nouns and adjectives) and relations (verbs)
• Organize terms into rough categories
General Animal Categories: Animal, Mammal
Specific Animals: Cat, Dog, Horse, Trout, Shark
Properties of Animals: Wild, Dangerous, Carnivorous, Pet
Plants: Tree, Grass, Wheat
Relations: eats, hasBodyPart, hasColor
15
COM759-2024/2025
Class hierarchy
Before adding complex axioms, first define the class
hierarchy (SubClassOf/ axioms).
• Flesh out the hierarchy with common superconcepts,
missing siblings.
• Ideally, much of this information was already elicited
16
COM759-2024/2025
Example: Class Hierarchy
Living Thing
• Animal
– Mammal
– Cat
–...
– Fish
– Trout
–...
– Carnivorous
– Herbivorous
– Omnivorous
• Plant
– Tree
– Grass
– Wheat Once the class hierarchy is fixed, we can add definitions. 17
COM759-2024/2025
T2: Concepts and Concept Hierarchies
• Identify the most significant concepts (classes) that exist
among objects in your domain.
• Identify any concept hierarchies (class/sub-class) that exist.
• Concepts can be physical objects or intangible notions of
objects which exists within the domain.
• The number of concepts, concept hierarchies, disjoint
classes and equivalent classes in addition to the examples
given reflect the complexity of your ontology built
e.g., at least: 8 concepts, 5 concept hierarchies, 4 disjoint classes
and 3 equivalent classes
But you should have no more than 30 concepts, subclasses, disjoint
and equivalence classes in total.
18
COM759-2024/2025
T3: Relations (Properties) and Relation Hierarchies
• Identify the most significant relations (both object properties and
data properties) that hold among objects in your domain.
• Identify any relation hierarchies that exist, where one relation
between two objects is more general than another.
• You will also identify inverse relations of some object properties.
• You could represent your identified relations and relation
hierarchies in Description Logic. Explain or describe the meaning
of each in a line or two of plain text.
• The number of object properties and data properties, inverse
properties and relation hierarchies reflects also the complexity of
your work. You should also indicate the correct domains and
ranges for properties.
e.g., at least: 5 object properties and 2 data properties, 2 inverse
properties and 2 relation hierarchies.
19
COM759-2024/2025
T4: Defining Semantic Axioms of Domain
• In order to give meaning to your ontology, you have to
define theoretical axioms that link several concepts in your
domain.
• You should also use axioms to give meaning to new
concepts in terms of logical combinations of other concepts
in your domain.
• You could encode your axioms using Description Logic.
e.g., in FOL, we can give meaning to a concept Teacher as:
∀x[Teacher(x) Staff(x) ∧ ∃y[ Course(y) ∧ teaches(x,y)]]
• Again, the number of axioms formally defined and
explained using the concepts and relations already defined
in your model reflects the complexity of your work.
e.g., at least 5 axioms
20
COM759-2024/2025
T5: Modelling Concepts and Relations in Protégé
• Using Protégé, create your ontology by specifying your
concept, class hierarchies, relations, relation
hierarchies and axioms of the domain.
• Illustrate with some screenshot on the above (avoid
repeat the same kind of screenshots)
• Include at least one instance of each concept in your
vocabulary.
• Generate a visual output of your ontology in Protégé.
• Your OWL script should be valid and be capable of
answering queries.
• You will submit the OWL script that Protege generates
(copy and paste it to the end of your report).
21
COM759-2024/2025
T6: Evaluation of OWL File
• Evaluate the correctness of your ontology by generating
queries in Protégé to check the output of your answers.
• Using the 5 queries listed in T1, query your ontology using
the DL Query Tab in Protégé and save the output
generated.
• Creating queries which require the use of at least one
axiom will earn you extra marks.
• You can use the default reasoner in Protégé, or download
one if your installation of Protégé has no reasoner.
• You should explain each query and the results.
In no more than two sentences for each query, explain
whether or not the Protégé outputs of your query are correct
based on the formalized vocabulary.
• Show any limitations of your vocabulary or axioms.
22
COM759-2024/2025
T6: Evaluation of OWL File
• Evaluate the correctness of your ontology by generating
queries in Protégé to check the output of your answers.
• Using the 5 queries listed in T1, query your ontology using
the DL Query Tab in Protégé and save the output
generated.
• Creating queries which require the use of at least one
axiom will earn you extra marks.
• You can use the default reasoner in Protégé, or download
one if your installation of Protégé has no reasoner.
• You should explain each query and the results.
In no more than two sentences for each query, explain
whether or not the Protégé outputs of your query are correct
based on the formalized vocabulary.
• Show any limitations of your vocabulary or axioms.
23
COM759-2024/2025
Further details
About Class Hierarchy
24
COM759-2024/2025
Class hierarchy
Before adding complex axioms, first define the class
hierarchy (SubClassOf/ axioms).
• Flesh out the hierarchy with common superconcepts,
missing siblings.
• Ideally, much of this information was already elicited
25
COM759-2024/2025
Example: Class Hierarchy
Living Thing
• Animal
– Mammal
– Cat
–...
– Fish
– Trout
–...
– Carnivorous
– Herbivorous
– Omnivorous
• Plant
– Tree
– Grass
– Wheat Once the class hierarchy is fixed, we can add definitions. 26
COM759-2024/2025
Class definitions
Identify which terms should be defined:
• Depends on the goals of the ontology.
• General terms like “Living Thing” probably don’t need a definition.
• Some terms are easier to de1ne than others, e.g., “Cat” vs.
“Carnivorous”.
• For some terms, the information about their place in the class
hierarchy is enough.
Intensional definitions consist of the superclass(es) and any
distinguishing characteristics.
A cat is a mammal that has claws, 4 legs, and a tail.
A carnivore is an animal that eats only meat.
A pet is a domesticated animal that lives with humans.
Extensional definitions:
EU ≡ {UK} {France} {Germany} …
27
COM759-2024/2025
Class definitions
Distinguish between full definitions (≡) and partial definitions ()!
Animal ≡ LivingThing ∃eats.LivingThing
Pet ≡ Animal ∃livesWith.Human
Herbivorous ≡ Animal ∀eats.Plant
Cow Mammal ∀eats.Grass
28
COM759-2024/2025
Class hierarchy (II)
• In general, the class hierarchy is not a simple tree, but a directed
acyclic graph (there is multiple inheritance).
Cow Mammal Cow Herbivorous
(Mammal and Herbivorous are unrelated)
• Instead of specifying all subclass-superclass relationships, it is
easier to specify only a tree and let the reasoner infer the
implicit ones.
Grass Plant
Herbivorous Animal ∀eats.Plant
Cow Mammal ∀ eats.Grass
• This entails Cow Herbivorous, so we do not have to explicitly
add this axiom to the ontology.
Definitions can affect the (inferred) class hierarchy.
29
COM759-2024/2025
“Some” does not mean “Only”
• When writing definitions, it is not trivial to find the correct
one.
• A common modelling error is to swap ∀ and ∃:
Grass Plant
Herbivorous Animal ∀ eats.Plant
Cow Mammal ∃ eats.Grass
Cow is not subsumed by Herbivorous!
(A cow must eat “at least 1 Grass”, but could eat other things.)
30
COM759-2024/2025
“Only” does not mean “Some”
Cow ∀eats.Grass
Cow is not subsumed by ∃eats.Grass, not even ∃eats.T.
(A cow can eat only Grass, but does not have to eat anything.)
Animal ≡ LivingThing ∃eats.LivingThing
Mammal Animal
Cow Mammal ∀eats.Grass
entails Cow ∃eats.Grass.
31
COM759-2024/2025
“And” does not mean “Or”
“Cows eat grass and grain.”
Cow ∀eats.(Grass Grain) Grass ¬Grain
Cow and ∃eats.T are disjoint!
(A cow can eat only things that are at the same time Grass and
Grain, which do not exist.)
Cow ∀eats.(Grass Grain) Grass ¬Grain
32
COM759-2024/2025
General axioms and annotations
• Declare disjoint classes!
• Declare domains and ranges, transitivity, . . . for object
properties!
• Encode more specific knowledge, e.g., complex role inclusions.
• Comment all entities and axioms, justify design choices (shared
conceptualization)!
Dom(eats) LivingThing
Ran(eats) LivingThing
"We ignore the difference between living things and
parts of living things that are eaten (e.g., meat)."
33
COM759-2024/2025
Domain and range restrictions
Be careful of declared domains and ranges. They affect all class
expressions using the property:
Ran(eats) LivingThing (T ∀eats.LivingThing)
Bird ∃eats.Stone
means that some stones are living things (those that are eaten by
birds).
If Stone and LivingThing are disjoint, then the ontology is
inconsistent.
Dom(eats) LivingThing (∃eats.T LivingThing)
StoneEater ∃eats:Stone
entails StoneEater LivingThing.
If StoneEater and LivingThing are disjoint, then StoneEater is
unsatisfiable.
34
COM759-2024/2025
Mereology
Mereology: The theory of parts, wholes, and their relations.
Partonomies (part-of hierarchies), are as important as taxonomies
(class hierarchies).
A partonomy is modeled by a dedicated object property (partOf).
Generally accepted properties:
Ref(partOf) Tra(partOf) Asy(partOf)
In other words, partOf is a partial order.
However, not all part-of relations are the same:
“The tail is part of the cat.”
“The tree is part of the garden.”
“The wheat is part of the bread.”
35
COM759-2024/2025
Properties of Part-of Relations
Part-of relations can be classi1ed according to the following
properties:
• Functional: Are parts restricted by their function or placement?
• Homeomeric: Are parts the same kinds of things as the whole?
• Separable: Can the parts be removed from the whole?
36
COM759-2024/2025
Functional, Non-Homeomeric
Component-Object relation:
• separable
• “What are its parts?”
branch - tree
scene - movie
Material-Object relation:
• non-separable
• “What is it made of?”
wood - tree
flour - bread
37
COM759-2024/2025
Functional, Homeomeric
Portion-Object relation:
• separable
• not integral, but measurable parts; “some of”
slice - bread
meter - kilometer
Place-Area relation:
• non-separable
• usually between places and locations
garden - estate
Dresden - Germany
38
COM759-2024/2025
Non-Functional, Non-Homeomeric
Member-Collection relation:
• separable
• characterized by spatial/social/temporal proximity, not by
similarity
tree - forest
Stefan Borgwardt - TU Dresden
Member-Partnership relation:
• non-separable
• members are de1ning parts of the whole
Ernie - Bert and Ernie
John - married couple
39
COM759-2024/2025
Several Part-of Relations
In an ontology, these different relations are given informative names
to distinguish them, e.g., by referring to their domains.
bodyPartOf partOfRegion memberOfUniversity
Generally, transitivity holds only along the same part-of relation.
(Peter Hawne, UU) : memberOfUniversity
(UU, Ulster) : partOfRegion
. . . but sometimes also among different part-of relations.
materialOf o partOf materialOf
Sometimes it is more convenient to use the inverse (has-part)
relation.
Car ∃hasPart.Engine vs. Engine ∃partOf:Car
40
COM759-2024/2025
Not Part-of Relations
What is not a part-of relation:
Topological inclusion: “The wine is in the cellar.”
Class inclusion: “Frying is part of cooking.”
Attachment: “Fingers are part of the hand.” vs. “Earrings are part
of the ear.”
Ownership: “A bicycle has wheels.” vs. “I have a bicycle.”
Logic-
41
COM759-2024/2025
Direct Part-of
Often, it is more useful to refer to the direct parts only, instead of
all (indirect) sub-parts.
Piston ∃ directPartOf.Engine Engine ∃ directPartOf.Car
directPartOf is not transitive!
directPartOf partOf Tra(partOf)
This separation allows us to use directPartOf in number
restrictions.
T ≤1 directPartOf:T Car ≤ 4 hasDirectPart.Wheel …
This is not possible for partOf, since non-simple roles are not
allowed in number restrictions!
42
COM759-2024/2025
When to Introduce a New Class?
If a class expression is used often, introduce a new named class:
Shark Fish ∃hasRisk.(∃hasSeverity.Deadly)
Lion Mammal ∃hasRisk.(∃hasSeverity.Deadly)
Shark Fish Dangerous
Lion Mammal Dangerous
Dangerous ≡∃hasRisk.DeadlyRisk
DeadlyRisk ≡∃hasSeverity.Deadly
This keeps the ontology more readable, but is not necessary for
more specific characteristics of individuals:
Scout : Horse Scout : Agressive
There is no need for AgressiveHorse, unless this concept plays an
important role in the ontology.
43
COM759-2024/2025
Protégé
Pizza Case Study Tutorial
(in details)
Week 6
44
COM759-2024/2025
Pizza case study in details
• A Practical Guide to Building OWL Ontologies Using Protégé 4
Pizza example illustration in details (see Week 6 Lab folder)
• A useful reading with example: Ontology Development 101: A Guide to
Creating Your First Ontology. Stanford University, 2000.
Today’s Practical Exercise (follow it step by step in Protégé)
• A Practical Tutorial in Video using Protégé 5.5
Pizza Example using Protégé available at YouTube
https://www.youtube.com/watch?v=ZgTR2B1gkdM
45