Presentation is loading. Please wait.

Presentation is loading. Please wait.

Logics for Data and Knowledge Representation

Similar presentations


Presentation on theme: "Logics for Data and Knowledge Representation"— Presentation transcript:

1 Logics for Data and Knowledge Representation
Ontology Building using Protégé : A Tutorial Fausto Giunchiglia and Biswanath Dutta

2 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 Changed 2

3 Description Logic (DL) Family
INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING There are many varieties of DL and there is an informal naming convention, roughly describing the operators allowed. OWL Mapping to equivalent DL OWL Lite closely corresponds to SHIF(D) OWL DL closely corresponds to SHOIN(D) 3

4 Terminology Box (TBox)
INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING 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 Equivalence TBOX Equality axiom Definition PhD ≡ Postgraduate ⊓ ≥3Publish.Paper Parent ≡ Person ⊓ ∃hasChild.Person hasGrandChild ⊑ hasChild Inclusion axiom Specialization Subsumption 4

5 Assertion Box (ABox) Student(paul) Professor(fausto)
INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING 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) Student(paul) Professor(fausto) Teaches(Fausto, LDKR) 5

6 Knowledge Base (KB) A Knowledge Base (KB) = TBox + Abox 6
INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING A Knowledge Base (KB) = TBox + Abox 6

7 Ontology INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING 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 7

8 Ontology : Basic Principle
INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING Ontology building is a fun!!! Before starting modelling an ontology, we need an application in our mind 8

9 Naming Conventions There are no such standard conventions
INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING There are no such standard conventions Different practices are found, like, HumanBeing humanBeing Human_being Use whatever you like Important: try to be consistent 9

10 OWL Constructs: Classes
INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING 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 10

11 OWL Constructs: Properties
INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING 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??? Note: constraints, like, domains and ranges, can be given for object and datatype properties, but not for annotation properties Note: ontologies can also have the ontology properties (provide uninterpreted information) as annotations, just like annotation properties, except that they relates ontologies to other ontologies. For example, owl:imports can be used to import other ontologies. 11

12 OWL Constructs: Individuals
INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING 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 12

13 Special Properties owl:TransitiveProperty (transitive property)
INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING 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 Note: Not all of these can be specified for a particular object property as to retain the decidability of OWL DL properties (e.g., an object property specified as transitive, and their super-properties and their inverses cannot have their cardinality restricted, either via a the functional part of property axioms or in cardinality restrictions) 13

14 Restriction Types       Existential, someValuesFrom
INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING 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” 14

15 Protégé INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING Is developed by Stanford Medical Informatics ( 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 15

16 Protégé-OWL The Protégé-OWL editor enables users to:
INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING 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) 16

17 Saving OWL Files Two files:
INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING Two files: .pprj – the project file stores information about the GUI and the workspace .owl – the OWL file actual ontology is stored in RDF/OWL format 17

18 Protégé-OWL : Metadata Window
INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING Protégé-OWL : Metadata Window Ontology URI Ontology property Ontology(ies) Default Namespaces Namespaces 18

19 Protégé-OWL : Class Building Window
INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING Asserted hierarchy as asserted by the ontology engineer Class description widget owl:Thing, a root class Subsumption hierarchy Asserted Conditions Widget Class-specific tools (find usage etc) Disjoint widget 19

20 Ontology Building Basic infrastructure (recall!) Classes/ concepts
INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING Ontology Building Basic infrastructure (recall!) Classes/ concepts Properties/ roles Object property Datatype property Annotation property [optional] Individuals/ objects/ instances [mandatory ???] 20

21 Basic Things Step 1: Open Protégé Create a new project
INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING 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 21

22 Class Hierarchy (subsumption)
INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING 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 22

23 Disjoint INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING 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 23

24 Disjoint INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING 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., 24

25 What is Next? So, what we have done till now: So, what we do next
INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING 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) 25

26 Consistency Check INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING Add named classes 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 26

27 Consistency Check Now run the consistency check
INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING Consistency Check Now run the consistency check To do this we use the Pellet reasoner (integrated with the Protégé-OWL editor) Classify taxonomy (and check consistency) Check consistency (for efficiency) Compute inferred types (for individuals) 27

28 Consistency Check INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING 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 28

29 Next step? So, what is next? Step 5 : we add the following properties
INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING 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) 29

30 INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING
Object Property Range Domain Important: properties can also be built in a hierarchy (not shown here) 30

31 Datatype Property Range Domain 31
INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING Datatype Property Range Domain 31

32 INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING
Annotation Property 32

33 Graphical View of the Asserted Classes
INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING The (Asserted) class hierarchy view OWL Viz 33

34 Restrictions Next, we add class restrictions… (Step 6)
INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING Next, we add class restrictions… (Step 6) This we do from the Asserted Conditions widget 34

35 Restrictions Restricted property Restriction Filler Create restriction
INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING Restricted property Restriction Filler Create restriction Expression construct palette 35

36 Restrictions : Necessary Conditions
INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING 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 36

37 What is Next? INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING 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 37

38 Class Restrictions INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING 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 38

39 Polyhierarchy INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING 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 39

40 Polyhierarchy INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING 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 40

41 Polyhierarchy Now run the reasoner You see the following
INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING 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) 41

42 REorganized Class Hierarchy
INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING 42

43 INTRODUCTION :: ONTOLOGY :: OWL CONSTRUCTORS :: PROTEGE :: ONTOLOGY BUILDING
Individuals 43


Download ppt "Logics for Data and Knowledge Representation"

Similar presentations


Ads by Google