Tools for Ontology Engineering
Martin G. Skjæveland, Leif Harald Karlsen, Daniel P. Lupp
1 / 11
Ontology Engineering
Discipline studying tools and methodologies for building and maintaining ontologies.
There are (at least) three main problems in ontology engineering:
1. Understanding the target domain, e.g., the domain of animals
2. Identifying relevant abstractions over the domain, e.g., “A panda is a mammal thateats only bamboo”
3. Formulating the abstractions in a formal language like description logics; e.g.:
Panda v Mammal u ∀ eats.Bamboo
2 / 11
Ontology Engineering
Discipline studying tools and methodologies for building and maintaining ontologies.
There are (at least) three main problems in ontology engineering:
1. Understanding the target domain, e.g., the domain of animals
2. Identifying relevant abstractions over the domain, e.g., “A panda is a mammal thateats only bamboo”
3. Formulating the abstractions in a formal language like description logics; e.g.:
Panda v Mammal u ∀ eats.Bamboo
2 / 11
Ontology Engineering
Discipline studying tools and methodologies for building and maintaining ontologies.
There are (at least) three main problems in ontology engineering:
1. Understanding the target domain, e.g., the domain of animals
2. Identifying relevant abstractions over the domain, e.g., “A panda is a mammal thateats only bamboo”
3. Formulating the abstractions in a formal language like description logics; e.g.:
Panda v Mammal u ∀ eats.Bamboo
2 / 11
Ontology Engineering
Discipline studying tools and methodologies for building and maintaining ontologies.
There are (at least) three main problems in ontology engineering:
1. Understanding the target domain, e.g., the domain of animals
2. Identifying relevant abstractions over the domain, e.g., “A panda is a mammal thateats only bamboo”
3. Formulating the abstractions in a formal language like description logics; e.g.:
Panda v Mammal u ∀ eats.Bamboo
2 / 11
Use case: Animals
Say we are tasked with creating an animal and plant ontology
• Add disjoint Animal and Plant subclasses of LivingThing
• Add disjoint Mammal and Bird subclasses of Animal
• Add disjoint Panda, Cat, Mouse, subclasses of Mammal
• Add disjoint Bamboo and Fruit subclasses of Plant
• Add eats role, with domain Animal, range LivingThing
• Add Carnivore, Herbivore, Omnivore subclasses to Animal
• Add that Carnivore eats only Animal
• Add that Herbivore eats only Plant
• Add that Omnivore eats some Plant and some Animal
• Reason!
3 / 11
Use case: Animals
Say we are tasked with creating an animal and plant ontology
• Add disjoint Animal and Plant subclasses of LivingThing
• Add disjoint Mammal and Bird subclasses of Animal
• Add disjoint Panda, Cat, Mouse, subclasses of Mammal
• Add disjoint Bamboo and Fruit subclasses of Plant
• Add eats role, with domain Animal, range LivingThing
• Add Carnivore, Herbivore, Omnivore subclasses to Animal
• Add that Carnivore eats only Animal
• Add that Herbivore eats only Plant
• Add that Omnivore eats some Plant and some Animal
• Reason!3 / 11
What was the problem?
• “Carnivore/Herbivore EquivalentTo eats only Animal/Plant” – not correct!
• By this definition, if something does not eat anything, it is a Carnivore, which resultsin:
∃eats.> v Animal (Domain of eats is Animal)
¬Animal v ∀eats.⊥ (Complement of Animal does not eat)
¬Animal v eats.⊥ v Carnivore v Animal (things that don’t eat are in Carnivore)
• This can only be true if Animal ≡ >.
• Cannot always simply translate what a domain expert says into logical axioms
• Need to really understand the domain and the consequences the axioms have
4 / 11
What was the problem?
• “Carnivore/Herbivore EquivalentTo eats only Animal/Plant” – not correct!
• By this definition, if something does not eat anything, it is a Carnivore, which resultsin:
∃eats.> v Animal (Domain of eats is Animal)
¬Animal v ∀eats.⊥ (Complement of Animal does not eat)
¬Animal v eats.⊥ v Carnivore v Animal (things that don’t eat are in Carnivore)
• This can only be true if Animal ≡ >.
• Cannot always simply translate what a domain expert says into logical axioms
• Need to really understand the domain and the consequences the axioms have
4 / 11
What was the problem?
• “Carnivore/Herbivore EquivalentTo eats only Animal/Plant” – not correct!
• By this definition, if something does not eat anything, it is a Carnivore, which resultsin:
∃eats.> v Animal (Domain of eats is Animal)
¬Animal v ∀eats.⊥ (Complement of Animal does not eat)
¬Animal v eats.⊥ v Carnivore v Animal (things that don’t eat are in Carnivore)
• This can only be true if Animal ≡ >.
• Cannot always simply translate what a domain expert says into logical axioms
• Need to really understand the domain and the consequences the axioms have
4 / 11
Correct vs correct enough
• Lets say we now want to introduce gender into our model
• Should we let Animal ≡ Male t Female and Male u Female v ⊥?
• What about hermaphrodites1?
• Will it be correct if we just drop Male u Female v ⊥?
• Clown fish can change their sex during their life
• So for correctness we need to add a temporal component...
• Correctness can be difficult or even impossible to achieve
• (Particularly in a restricted language, e.g. OWL)
Should strive for “correct enough” for the particular application
1See https://en.wikipedia.org/wiki/Hermaphrodite5 / 11
Correct vs correct enough
• Lets say we now want to introduce gender into our model
• Should we let Animal ≡ Male t Female and Male u Female v ⊥?
• What about hermaphrodites1?
• Will it be correct if we just drop Male u Female v ⊥?
• Clown fish can change their sex during their life
• So for correctness we need to add a temporal component...
• Correctness can be difficult or even impossible to achieve
• (Particularly in a restricted language, e.g. OWL)
Should strive for “correct enough” for the particular application
1See https://en.wikipedia.org/wiki/Hermaphrodite5 / 11
Correct vs correct enough
• Lets say we now want to introduce gender into our model
• Should we let Animal ≡ Male t Female and Male u Female v ⊥?
• What about hermaphrodites1?
• Will it be correct if we just drop Male u Female v ⊥?
• Clown fish can change their sex during their life
• So for correctness we need to add a temporal component...
• Correctness can be difficult or even impossible to achieve
• (Particularly in a restricted language, e.g. OWL)
Should strive for “correct enough” for the particular application
1See https://en.wikipedia.org/wiki/Hermaphrodite5 / 11
Correct vs correct enough
• Lets say we now want to introduce gender into our model
• Should we let Animal ≡ Male t Female and Male u Female v ⊥?
• What about hermaphrodites1?
• Will it be correct if we just drop Male u Female v ⊥?
• Clown fish can change their sex during their life
• So for correctness we need to add a temporal component...
• Correctness can be difficult or even impossible to achieve
• (Particularly in a restricted language, e.g. OWL)
Should strive for “correct enough” for the particular application
1See https://en.wikipedia.org/wiki/Hermaphrodite5 / 11
Correct vs correct enough
• Lets say we now want to introduce gender into our model
• Should we let Animal ≡ Male t Female and Male u Female v ⊥?
• What about hermaphrodites1?
• Will it be correct if we just drop Male u Female v ⊥?
• Clown fish can change their sex during their life
• So for correctness we need to add a temporal component...
• Correctness can be difficult or even impossible to achieve
• (Particularly in a restricted language, e.g. OWL)
Should strive for “correct enough” for the particular application
1See https://en.wikipedia.org/wiki/Hermaphrodite5 / 11
Correct vs correct enough
• Lets say we now want to introduce gender into our model
• Should we let Animal ≡ Male t Female and Male u Female v ⊥?
• What about hermaphrodites1?
• Will it be correct if we just drop Male u Female v ⊥?
• Clown fish can change their sex during their life
• So for correctness we need to add a temporal component...
• Correctness can be difficult or even impossible to achieve
• (Particularly in a restricted language, e.g. OWL)
Should strive for “correct enough” for the particular application
1See https://en.wikipedia.org/wiki/Hermaphrodite5 / 11
Correct vs correct enough
• Lets say we now want to introduce gender into our model
• Should we let Animal ≡ Male t Female and Male u Female v ⊥?
• What about hermaphrodites1?
• Will it be correct if we just drop Male u Female v ⊥?
• Clown fish can change their sex during their life
• So for correctness we need to add a temporal component...
• Correctness can be difficult or even impossible to achieve
• (Particularly in a restricted language, e.g. OWL)
Should strive for “correct enough” for the particular application
1See https://en.wikipedia.org/wiki/Hermaphrodite5 / 11
Correct vs correct enough
• Lets say we now want to introduce gender into our model
• Should we let Animal ≡ Male t Female and Male u Female v ⊥?
• What about hermaphrodites1?
• Will it be correct if we just drop Male u Female v ⊥?
• Clown fish can change their sex during their life
• So for correctness we need to add a temporal component...
• Correctness can be difficult or even impossible to achieve
• (Particularly in a restricted language, e.g. OWL)
Should strive for “correct enough” for the particular application
1See https://en.wikipedia.org/wiki/Hermaphrodite5 / 11
Scale matters
• There are many species of animals!
• Over 1.9 million formally described2 species!
• Most interesting domains are large:
• Medicine: SNOMED CT3 contains more than 311,000 classes and 1,360,000relationships
• Bioinformatics: GeneOntology4 contains around 50,000 classes
• Engineering: Lots of different screws, nuts, bolts, materials, pipes
• Ontologies built by many people, over long period of time
• Difficult to stay consistent in how one models things!
2https://en.wikipedia.org/wiki/Species_description3http://www.snomed.org/snomed-ct/why-snomed-ct4http://geneontology.org/
6 / 11
Scale matters
• There are many species of animals!
• Over 1.9 million formally described2 species!
• Most interesting domains are large:
• Medicine: SNOMED CT3 contains more than 311,000 classes and 1,360,000relationships
• Bioinformatics: GeneOntology4 contains around 50,000 classes
• Engineering: Lots of different screws, nuts, bolts, materials, pipes
• Ontologies built by many people, over long period of time
• Difficult to stay consistent in how one models things!
2https://en.wikipedia.org/wiki/Species_description3http://www.snomed.org/snomed-ct/why-snomed-ct4http://geneontology.org/
6 / 11
Scale matters
• There are many species of animals!
• Over 1.9 million formally described2 species!
• Most interesting domains are large:
• Medicine: SNOMED CT3 contains more than 311,000 classes and 1,360,000relationships
• Bioinformatics: GeneOntology4 contains around 50,000 classes
• Engineering: Lots of different screws, nuts, bolts, materials, pipes
• Ontologies built by many people, over long period of time
• Difficult to stay consistent in how one models things!
2https://en.wikipedia.org/wiki/Species_description3http://www.snomed.org/snomed-ct/why-snomed-ct4http://geneontology.org/
6 / 11
Scale matters
• There are many species of animals!
• Over 1.9 million formally described2 species!
• Most interesting domains are large:
• Medicine: SNOMED CT3 contains more than 311,000 classes and 1,360,000relationships
• Bioinformatics: GeneOntology4 contains around 50,000 classes
• Engineering: Lots of different screws, nuts, bolts, materials, pipes
• Ontologies built by many people, over long period of time
• Difficult to stay consistent in how one models things!
2https://en.wikipedia.org/wiki/Species_description3http://www.snomed.org/snomed-ct/why-snomed-ct4http://geneontology.org/
6 / 11
Modelling with large ontologies
• Try to open up a medium sized ontology in Protégé
• E.g. The Plant Ontology5
• Imagine trying to update the modelling of the different “stages” in this ontology
• Now, imagine doing this on one of the large ontologies
• Ontologies, just like source code needs to be modularized and well documented
5http://www.obofoundry.org/ontology/po.html7 / 11
Modelling with large ontologies
• Try to open up a medium sized ontology in Protégé
• E.g. The Plant Ontology5
• Imagine trying to update the modelling of the different “stages” in this ontology
• Now, imagine doing this on one of the large ontologies
• Ontologies, just like source code needs to be modularized and well documented
5http://www.obofoundry.org/ontology/po.html7 / 11
Modelling with large ontologies
• Try to open up a medium sized ontology in Protégé
• E.g. The Plant Ontology5
• Imagine trying to update the modelling of the different “stages” in this ontology
• Now, imagine doing this on one of the large ontologies
• Ontologies, just like source code needs to be modularized and well documented
5http://www.obofoundry.org/ontology/po.html7 / 11
Modelling with large ontologies
• Try to open up a medium sized ontology in Protégé
• E.g. The Plant Ontology5
• Imagine trying to update the modelling of the different “stages” in this ontology
• Now, imagine doing this on one of the large ontologies
• Ontologies, just like source code needs to be modularized and well documented
5http://www.obofoundry.org/ontology/po.html7 / 11
Difficulties in Ontology Engineering: Construction
Requires communication between ontology experts and domain experts
to determine:
• What to model
• E.g. only animals, or also plants, habitats, weather, etc.?
• “A panda is an animal”, “A panda eats only bamboo”
• No unnecessary axioms cluttering the model
• How to model
• “Every mammal is either male or female”⇒ Mammal v Male t Female orMammal v ∃hasGender .{male, female}
• Depends on how it will be used, e.g.. consitency checks, querying, documentation
• Uniform modelling (all animals modeled with the same info)
8 / 11
Difficulties in Ontology Engineering: Construction
Requires communication between ontology experts and domain experts to determine:
• What to model
• E.g. only animals, or also plants, habitats, weather, etc.?
• “A panda is an animal”, “A panda eats only bamboo”
• No unnecessary axioms cluttering the model
• How to model
• “Every mammal is either male or female”⇒ Mammal v Male t Female orMammal v ∃hasGender .{male, female}
• Depends on how it will be used, e.g.. consitency checks, querying, documentation
• Uniform modelling (all animals modeled with the same info)
8 / 11
Difficulties in Ontology Engineering: Construction
Requires communication between ontology experts and domain experts to determine:
• What to model
• E.g. only animals, or also plants, habitats, weather, etc.?
• “A panda is an animal”, “A panda eats only bamboo”
• No unnecessary axioms cluttering the model
• How to model
• “Every mammal is either male or female”⇒ Mammal v Male t Female orMammal v ∃hasGender .{male, female}
• Depends on how it will be used, e.g.. consitency checks, querying, documentation
• Uniform modelling (all animals modeled with the same info)
8 / 11
Difficulties in Ontology Engineering: Maintenance
• Debugging errors (inconsistencies, wrong modelling, etc.)
• E.g. our modelling error about carnivores, etc.
• Updating ontology to new use-cases
• E.g. might want to model dynamic knowledge (i.e. how animals’ behavior change overtime)
• Maintain readability of ontology
• E.g. navigation can be difficult in an ontology with thousands of classes
• Correct modularization, splitting ontology into reasonable pieces
• Keeping track of what is modeled, and how
9 / 11
Difficulties in Ontology Engineering: Maintenance
• Debugging errors (inconsistencies, wrong modelling, etc.)
• E.g. our modelling error about carnivores, etc.
• Updating ontology to new use-cases
• E.g. might want to model dynamic knowledge (i.e. how animals’ behavior change overtime)
• Maintain readability of ontology
• E.g. navigation can be difficult in an ontology with thousands of classes
• Correct modularization, splitting ontology into reasonable pieces
• Keeping track of what is modeled, and how
9 / 11
Difficulties in Ontology Engineering: Maintenance
• Debugging errors (inconsistencies, wrong modelling, etc.)
• E.g. our modelling error about carnivores, etc.
• Updating ontology to new use-cases
• E.g. might want to model dynamic knowledge (i.e. how animals’ behavior change overtime)
• Maintain readability of ontology
• E.g. navigation can be difficult in an ontology with thousands of classes
• Correct modularization, splitting ontology into reasonable pieces
• Keeping track of what is modeled, and how
9 / 11
Tools for Pattern-based Ontology Engineering
Luckily, there are many tools to aid in our modelling:
• Constraint languages (SHACL, SPIN, ShEx)
• Ontology Design Patterns (ODP, COP, DROP)
• Mapping tools (R2RML, RML, D2RQ)
• Ontology Scripting Languages (Tawny OWL, OPPL)
• Templating frameworks (GDOL, OTTR)
(Note: more tools exist!)
10 / 11
Tools for Pattern-based Ontology Engineering
Luckily, there are many tools to aid in our modelling:
• Constraint languages (SHACL, SPIN, ShEx)
• Ontology Design Patterns (ODP, COP, DROP)
• Mapping tools (R2RML, RML, D2RQ)
• Ontology Scripting Languages (Tawny OWL, OPPL)
• Templating frameworks (GDOL, OTTR)
(Note: more tools exist!)
10 / 11
Finding the right tools
• What to model• How to model• Communicate with
users• Debugging• Updating• Readability
→ ? ←
• Constraint languages• Ontology Design
Patterns• Mapping tools• Ontology Scripting
Languages• Templating frameworks
This lecture series about templating frameworks, specifically OTTR.
11 / 11
Finding the right tools
• What to model• How to model• Communicate with
users• Debugging• Updating• Readability
→ ? ←
• Constraint languages• Ontology Design
Patterns• Mapping tools• Ontology Scripting
Languages• Templating frameworks
This lecture series about templating frameworks, specifically OTTR.
11 / 11