ldk r logics for data and knowledge representation ontology building using protégé : a tutorial...
TRANSCRIPT
LLogics for DData and KKnowledgeRRepresentation
Ontology Building using Protégé : A Tutorial
Fausto Giunchiglia and Biswanath Dutta
Outline Introduction Ontology OWL Constructors Protégé and Protégé-OWL Ontology Building
Class Hierarchy (subsumption) Disjoint Consistency Check Property Graphical representation Restriction Polyhierarchy Individuals
2
Description Logic (DL) Family
OWL Mapping to equivalent DL OWL Lite closely corresponds to SHIF(D) OWL DL closely corresponds to SHOIN(D)
There are many varieties of DL and there is an informal naming convention, roughly describing the operators allowed.
INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING
3
Terminology Box (TBox) A terminology box (or TBox) is a set of definitions and specializations Can be seen as a set of “schema” axioms (sentences) Terminological axioms express constraints on the concepts of the
language, i.e. they limit the possible models The TBox is the set of all the constraints on the possible models
4
PhD ≡ Postgraduate ⊓ ≥3Publish.Paper
Parent ≡ Person ⊓ ∃hasChild.PersonhasGrandChild ⊑ hasChild
Equality axiomDefinition
Inclusion axiomSpecialization
TBOX
Subsumption
Equivalence
INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING
Assertion Box (ABox) In an ABox one introduces individuals, by giving them names, and
one asserts properties about them. We denote individual names as a, b, c,… An assertion with concept C is called concept assertion (or simply
assertion) in the form:
C(a), C(b), C(c), … An assertion with Role R is called role assertion in the form:
R(a, b), R(b, c), … So, an ABox is a set of “data” axioms (ground facts)
5
Student(paul)Professor(fausto)
Teaches(Fausto, LDKR)
INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING
Knowledge Base (KB)
A Knowledge Base (KB) = TBox + Abox
INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING
6
Ontology An ontology describes the concepts and relationships that
are important in a particular domain, providing a vocabulary for that domain as well as a computerized specification of the meaning of terms used in the vocabulary
Ontologies are ranges from: taxonomies and classifications, database schemas, to fully axiomatized theories
Used in many business and scientific communities as a way to share, reuse and process domain knowledge
Central to many applications such as, scientific knowledge portals, information management and integration systems, electronic commerce, semantic web services, and so forth
INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING
7
Ontology : Basic Principle Ontology building is a fun!!!
Before starting modelling an ontology, we need an application in our mind
INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING
8
Naming ConventionsThere are no such standard conventions Different practices are found, like,
HumanBeing humanBeing Human_being
Use whatever you like Important: try to be consistent
INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING
9
OWL Constructs: Classes Classes (concept, category) are sets of Individuals Membership of a class is depend on its logical description, NOT on
its name Classes do not have to be named – they can be logical expressions
– e.g., book with yellow cover page A class is to be described in a way that it is possible for it to
contain Individuals, except that you have some specific requirement where it is to represent the empty class
E.g., Human being, Person, Building, Personal moment, Vacation, Religious residence
INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING
10
OWL defines the properties, Object property- relate individuals to other individuals
(e.g., isTaughtBy, supervises, isStudentOf, isLocatedIn) Datatype property- relate individuals to datatype
values (e.g. , author, title, phone, age, etc.) Annotation property- use to add uninterpreted
information (e.g., versioning information, comment) to classes, properties and individuals
Relationships in OWL are binary N-ary relations???
OWL Constructs: Properties
INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING
11
OWL Constructs: Individuals Individuals (Instance, Object) are the objects in the domain
An individual may be (and are likely to be) a member of multiple Classes
E.g., me, you, this tutorial, this room, this university, my house
INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING
12
Special Properties owl:TransitiveProperty (transitive property)
E.g. “has better grade than”, “is ancestor of” owl:SymmetricProperty (symmetry)
E.g. “has same grade as”, “is sibling of” owl:FunctionalProperty defines a property that
has at most one value for each object E.g. “age”, “height”, “directSupervisor”
owl:InverseFunctionalProperty defines a property for which two different objects cannot have the same value
INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING
13
Restriction Types
Existential, someValuesFrom “Some”, “At least one”
Universal, allValuesFrom “Only”
hasValue “equals x”
Cardinality “Exactly n”
Max Cardinality “At most n”
Min Cardinality “At least n”
INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING
14
Protégé Is developed by Stanford Medical Informatics
(http://protege.stanford.edu/) Is a free, open-source software Has large and growing user community base Implements a rich set of knowledge-modeling structures Supports the creation, visualization, and manipulation of
ontologies in various representation formats In core, Protégé is based on Frames (object oriented)
modelling Supports OWL through the Protégé-OWL plugin Can be customized to provide domain-friendly support for
creating knowledge models and entering data Supports development of plugins to allow backend /
interface extensions
INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING
15
Protégé-OWL
The Protégé-OWL editor enables users to: Load and save OWL and RDF ontologies Edit and visualize classes, properties, and SWRL
(Semantic Web Rule Language) rules Define logical class characteristics as OWL
expressions Execute reasoners such as description logic classifiers Edit OWL individuals for Semantic Web markup
Protégé supports SHOIN(D)
INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING
16
Saving OWL Files
Two files:
.pprj – the project filestores information about
the GUI and the workspace
.owl – the OWL fileactual ontology is stored
in RDF/OWL format
INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING
17
Protégé-OWL : Metadata Window
Ontology(ies)
Ontology property
Ontology URI
Namespaces
Default Namespaces
INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING
18
Protégé-OWL : Class Building Window
Subsumption hierarchy
owl:Thing, a root class
Asserted hierarchy as asserted by the ontology engineer
Asserted Conditions Widget
Class description widget
Disjoint widgetClass-specific tools (find usage
etc)
INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING
19
Ontology Building Basic infrastructure (recall!)
Classes/ concepts Properties/ roles
Object property Datatype property Annotation property [optional]
Individuals/ objects/ instances [mandatory ???]
INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING
20
Basic Things Step 1:
Open Protégé Create a new project Select OWL/RDF files as Project type Define the Ontology URI Select OWL DL as Language profile Click to Finish Save the project
Important: it is always good to save the ontology after each operation you do while building the ontology
INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING
21
Class Hierarchy (subsumption) Step 2:
Go to the OWL Classes tab Create the following two
classes: Agent, MindProduct (as subClass
of owl:Thing) Add the following subClasses
under the class Agent Developer, Producer,
Programmer Add the following subClasses
under the class MindProduct Document, Music, Program, Song
Under Document, create the following subClasses Book, Magazine
INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING
22
Disjoint In the previous slide, we
organized the kind-of classes in a hierarchy (subsumption)
Note: human mind can easily process that, say, classes, Agent and MindProduct are not the same kind-of objects (and that’s why we kept them separately)
Step 3: We explicitly mention say the same, i.e., Agent and MindProduct are disjoint classes in our ontology using the disjoint wizard Select class Agent Click on Add all siblings in the
Disjoints wizard Select Mutually between all
siblings
INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING
23
Similarly we make classes, i.e., Developer, Producer, Programmer as disjoint classes
In a similar way, we make the classes, Document, Music, Program, Song as disjoint classes
Also make the classes, Book and Magazine as disjoint classes
E.g.,
Disjoint
INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING
24
What is Next? So, what we have done till now:
Created a new project file Gave a name to this new ontology and save into
our local system Created the class hierarchies Explicitly stated the not-kind of classes
(disjointness)
So, what we do next We first check the consistency of our ontology by
running the reasoner Before check the consistency we do another step
(see next slide)
INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING
25
Consistency Check Step 4: We add a new class, called,
InconsistentClass_1 under the class Agent
Make InconsistentClass_1 as disjoint class with all its siblings
As per the inheritance rule, InconsistenceClass_1 has a parent Agent
Now make this class such that it has multi-parents
To do this, Select class InconsistentClass_1 Click on the Add named classes from
the Asserted Conditions widget Select the class Development from
list Press Ok
Add named classes
INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING
26
Now run the consistency check
To do this we use the Pellet reasoner (integrated with the Protégé-OWL editor)
Consistency Check
Classify taxonomy(and check
consistency)
Check consistency (for efficiency)
Compute inferred types
(for individuals)
INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING
27
Consistency Check Now make the classes InconsistentClass_1 and
Developer as non-disjoint classes How to do this?
Select the class InconsistentClass_1 Go to the Disjoints widget and select the class
Developer Click on “Delete selected row”
Save the ontology Run the consistency check again
INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING
28
Next step? So, what is next? Step 5 : we add the following properties
Object property write, download, produce
Datatype property name, dateOfBirth, title
Annotation property dc:title, dc:creator, dc:date
Set the domain and range of those properties Assign the special properties to those
properties (wherever needed)
INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING
29
Object Property
Domain
Range
Important: properties can also be built in a hierarchy (not shown here)
INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING
30
Datatype Property
Domain
Range
INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING
31
Graphical View of the Asserted Classes The (Asserted) class hierarchy view
OWL Viz
INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING
33
Restrictions Next, we add class restrictions… (Step 6) This we do from the Asserted Conditions widget
INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING
34
Create restrictionFiller
Restricted property Restriction
Expression construct palette
Restrictions
INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING
35
Restrictions : Necessary Conditions
We create the following condition: Programmer ⊑ ∃write.Programs Producer ⊑ ∀produce.(Music ⊔ Song) Program ⊑ ∀download.Developer
Important: Restrictions are a type of Anonymous Class Each class restrictions on a class become a superclass to that class In the above picture, produce(Music or Song) become a
superclass of class Produce
INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING
36
Now assume that, we have some few more agents, like, Hacker, Tracker, Computer Guru, Inventor
We add these agents by creating a new class, called MixedAgent
Why we are considering them as mixed, because of their following features Hackers and Trackers are basically the Programmer Computer Guru - an authority on computers and computing Inventor - who is the first to think of or make something
What is Next?
INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING
37
Class Restrictions Now, from the newly added class description (see
previous slide), we see that the classes, Hacker and Tracker are the programmers, which implies that they write Program
We explicitly state this knowledge into our ontology in the form of restrictions
INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING
38
Polyhierarchy Now it is obvious that since Hacker and Tracker
are the programmers, we can say that these two classes are also be the child of class Programmer This leads to the polyhierarchy
BUT, we do not state this knowledge manually We will use reasoner to do this for us
Let reasoner infer this knowledge automatically To get this job done by the reasoner, we need to
do one more step
INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING
39
We make the following Necessary Condition as Necessary and Sufficient Condition Programmer ⊑ ∃write.Programs
How to make this? Click on the class Programmer Select the following Necessary Condition (in the Asserted
Condition widget)
Drag and drop it to the Necessary and Sufficient Condition block
Polyhierarchy
INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING
40
Now run the reasoner You see the following
In the Inferred Hierarchy window, classes with blue colors represent the newly REorganized classes
Classify taxonomy (and check consistency)
Polyhierarchy
INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING
41
REorganized Class Hierarchy
INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING
42