69
“Think Ontologically” Yi Hong Department of Computer Sciences University of Leicester A Crash Course in Ontology Modelling for Archaeologists Process to create a

Yi Hong Department of Computer Sciences University of Leicester A Crash Course in Ontology Modelling for Archaeologists Process to create a

Embed Size (px)

Citation preview

  • Slide 1

Yi Hong Department of Computer Sciences University of Leicester A Crash Course in Ontology Modelling for Archaeologists Process to create a Slide 2 How we describe knowledge? as archaeologists Unstructured free-form text natural language human readable, highly expressive no universally-agreed terminology reflect individual interpretations and explanations of archaeological evidence Archaeology is the search for fact... not truth. If it's truth you're looking for, Dr. Tyree's philosophy class is right down the hall. Indiana Jones Slide 3 How we describe knowledge? as computer scientists Formal Specification programming language, metadata machine readable and executable controlled vocabulary, Limited expressivity well-defined, highly uniform mathematical symbols and notations Computer language design is just like a stroll in the park. Jurassic Park, that is. -Larry Wall inventor of Perl Slide 4 How people structure data traditionally.. Slide 5 Traditional Identified/linked by Relational Database approach Table Fields Record Primary/Foreign Keys row values Slide 6 Form List fields (columns) Group fields Link tables(foreign keys) Relational Database approach Add records Step 1. paper-based or electronic form Create tables & columns Process to create a database Slide 7 Relational Database approach Inventory Number, Excavation Date, Site name, Site description, Material, Weight, Catalog, Images, Object Description Step 2. List all fields Form List fields (columns) Group fields Link tables(foreign keys) Add records Create tables & columns Process to create a database Slide 8 Relational Database approach o Object o Inventory Number o Excavation Date o Material o Weight o Catalog o Images o Object description Step 3. Group fields, give a group name o Site o Site name o Site description . Form List fields (columns) Group fields Link tables(foreign keys) Add records Create tables & columns Process to create a database Slide 9 Relational Database approach Form List fields (columns) Group fields Link tables(foreign keys) Add records Create tables & columns Step 4. create tables, columns Process to create a database Slide 10 Relational Database approach Form List fields (columns) Group fields Link tables(foreign keys) Add records Create tables & columns Step 4. create tables, columns with MS Access tables, fields (columns) primary-foreign key pairs Process to create a database Slide 11 Relational Database approach Form List fields (columns) Group fields Link tables(foreign keys) Add records Create tables & columns Step 4. Data entry Process to create a database Slide 12 Example Relational Database Design Ontology Modeling Scenario : Requirement: (1)Every course module can only be taught by one Lecturer (2)A Lecturer can teach many courses.. (3)An student must enrol in at least 3 courses. (4)Max enrolment number for a course is 100. Design a data structure for Course Modules Selection * Every student has a unique student ID * Every staff has a unique staff ID Slide 13 Relational Database Approach Form 2 (Lecturer) Form 3 (Student) Student Course Lecturer Student IDName. Course IDCourse Name. Staff IDName. ModuleSelection Course IDStaff IDStudent ID Form 1 Course List Tables * Many to many relation Slide 14 Think Ontologically Slide 15 Ontology 15 An ontology is a formal specification of a conceptualization Thomas Gruber Slide 16 Relational Database vs Ontological Database Schema (SQL) (table, field) Ontology (RDF/OWL) (class, property) RecordsTriples/ axioms Define Structure Basic elements Products/ Editor Relational DB OntoDB (Triple store) Microsoft Access, FileMaker, Oracle, MySQL etc Protge, SWOOP Virtuoso, Jena SDB, TDB etc. Slide 17 Closed world assumption Web Ontology Language Open world assumption Assume knowledge is completed everything we dont know is false Assume knowledge is incompleted everything we dont know is undefined Yi eats chicken tikka boiled rice potato salads tofu Can vegetarian eat Tofu? Question: No OWA Data Vegetarian: someone who does not eat meat. We know Alessandro eats pasta boiled rice potato salads hash browns YiAlessandro Closed world assumption No Yes No Undefined Vegetarian? Open World Assumption (OWA) Slide 18 Think Ontologically Ontology Outside the box Identified/linked by Class Property Individual (URI) Uniform Resource Identifier Instance ofrestrict has value for Slide 19 Class (Concept) Think Ontologically Class (Concept) A template of definition of a particular kind of object Identify domain concepts Identify properties Add triples Object properties Data type properties Organise classes into hierarchies Slide 20 Class (Concept) A template of definition of a particular kind of object e.g. Person, Ceramic Pot, Excavation Site, Color Think Ontologically Identify domain concepts Identify properties Add triples Object properties Data type properties Organise classes into hierarchies Slide 21 Describe Class with Description Logic Think Ontologically Description Logic Circular terracotta loom weight Excavation site Settlement Examples Slide 22 Individual Individual (object) Individuals are instance of class Red is an instance of Color Example: Instance of RedColor Think Ontologically Identify domain concepts Identify properties Add triples Object properties Data type properties Organise classes into hierarchies Slide 23 Individual Individual (object) Individuals are instance of class Alessandro is an instance Person Example: Instance of PersonAlessandro Think Ontologically Identify domain concepts Identify properties Add triples Object properties Data type properties Organise classes into hierarchies Slide 24 Individual Individual (object) Individuals are instance of class A two holes disc loom weight found at Satriano is an instance of loom weight Example: Instance of Think Ontologically Identify domain concepts Identify properties Add triples Object properties Data type properties Organise classes into hierarchies Slide 25 Class Hierarchy Class hierarchy (subclass: IS A relationship) -Vessel(Bowl) - Ceramic vessel - wooden vessel Vessel(Bowl) wooden vessel Ceramic vessel sub class of Think Ontologically Identify domain concepts Identify properties Add triples Object properties Data type properties Organise classes into hierarchies Vessel(Bowl) Ceramic vessel Wooden vessel supercalss subclass Slide 26 Class Hierarchy Class hierarchy Female Craft worker sub class of Craft workerWoman sub class of multiple inheritance Think Ontologically Identify domain concepts Identify properties Add triples Object properties Data type properties Organise classes into hierarchies Slide 27 Class Hierarchy Class hierarchy sub class of ManWoman sub class of multiple inheritance Disjoined class Think Ontologically Identify domain concepts Identify properties Add triples Object properties Data type properties Organise classes into hierarchies ?? Slide 28 Think Ontologically Common mistakes in organising class hierarchy Example: Ontology for Education .. Sub class relationship must be is a relationship UoL is an indiviual of class University, not a class .. University Staff Student University University of Leicester University of Glasgow National University Private University Person Staff Student (1)(2) Slide 29 Property an element that takes a value and is associated with an object. It defines attributes of a concept and relations between concepts. Data type property Object property e.g. Person, Excavation Site, Ceramic Pot, Color Class hierarchy (sub class) -Vessel(Bowl) - Ceramic vessel - wooden vessel Think Ontologically Identify domain concepts Identify properties Add triples Object properties Data type properties Organise classes into hierarchies Slide 30 Data Type Property Data type property (attribute) A Data type property is an element that takes a value and is associated with an object (properties for which the value is a data literal) e.g. Person, Excavation Site, Ceramic Pot, Color Class hierarchy (sub class) -Vessel(Bowl) - Ceramic vessel - wooden vessel String Number Date Think Ontologically Identify domain concepts Identify properties Add triples Object properties Data type properties Organise classes into hierarchies Slide 31 Data Type Property Data type property (attribute) A Data type property is an element that takes a value and is associated with an object (properties for which the value is a data literal) e.g. Person, Excavation Site, Ceramic Pot, Color Class hierarchy (sub class) -Vessel(Bowl) - Ceramic vessel - wooden vessel e.g. Ceramic Pot Weight: 1.4kg Description: Beautiful Year of Excavation: 1980 Think Ontologically Identify domain concepts Identify properties Add triples Object properties Data type properties Organise classes into hierarchies Slide 32 Object Property (relation) An Object property is a direct binary relation between two classes e.g. Person, Excavation Site, Ceramic Pot, Color Class hierarchy (sub class) -Vessel(Bowl) - Ceramic vessel - wooden vessel Pot was found at Site owned by Person Think Ontologically Identify domain concepts Identify properties Add triples Object properties Data type properties Organise classes into hierarchies Slide 33 Property Property hierarchy e.g. Person, Excavation Site, Ceramic Pot, Color Class hierarchy (sub class) -Vessel(Bowl) - Ceramic vessel - wooden vessel Think Ontologically Identify domain concepts Identify properties Add triples Object properties Data type properties Organise classes into hierarchies has parent has mother has father Slide 34 Domain & Range Property Domain: A domain of a property limits the individuals to which the property can be applied. Range: The range of a property limits the individuals that the property may have as its value e.g. Person, Excavation Site, Ceramic Pot, Color Class hierarchy (sub class) -Vessel(Bowl) - Ceramic vessel - wooden vessel Think Ontologically Identify domain concepts Identify properties Add triples Object properties Data type properties Organise classes into hierarchies Slide 35 Domain & Range Property Domain: A domain of a property limits the individuals to which the property can be applied. Range: The range of a property limits the individuals that the property may have as its value ArtefactPerson owned by teaches Teacher Student domain range Think Ontologically teaches Slide 36 Domain & Range Property Domain: A domain of a property limits the individuals to which the property can be applied. Range: The range of a property limits the individuals that the property may have as its value Class Person Domain & range can be the same class Is a friend of Think Ontologically Slide 37 Cardinality cardinality specifies the occurances of a relationship A property can have: Exact cardinality Min cardinality Max cardinality Think Ontologically Univ Staff Mother [email protected] has_CFS _Id child min 1 exactly 1 Bus max 60 has_child has_passenger Slide 38 Inverse Property Property Inverse Property One property may be stated to be the inverse of another property. If the property P1 is stated to be the inverse of the property P2, then if X is related to Y by the P2 property, then Y is related to X by the P1 property Pot Person (P1) owned by (p2) hasChild Child (P2) has_personal_belongings (p1)hasParent Parent Think Ontologically Slide 39 Characteristics of a property Property Data Type Property Object Property Functional Property Transitive Property Symmetric Property InverseFunctional Property Slide 40 Characteristics of a property If John has a driving licence (No.) Functional Property has husband biologicalMotherOf Inverse Functional Property Slide 41 Characteristics of a property Transitive Property is part of overlaps with Symmetric Property is part of Early Bronze Age Bronze Age is part of EBA 1 3300 3000 BC 3300 - 2100 BC 3300 - 1200 BC Iron Age Roman period overlaps with Slide 42 Many other properties . http://www.w3.org/TR/owl-ref/ Slide 43 Triple Triple (RDF triple) A Triple is conventionally written in the order subject, predicate, object. The predicate is also known as the property of the triple. e.g. Person, Excavation Site, Ceramic Pot, Color Class hierarchy (sub class) -Vessel(Bowl) - Ceramic vessel - wooden vessel Identify domain concepts Identify properties Add triples Object properties Data type properties Organise classes into hierarchies Slide 44 Triple Outside the box e.g. Person, Excavation Site, Ceramic Pot, Color Class hierarchy (sub class) -Vessel(Bowl) - Ceramic vessel - wooden vessel Subject Predicate Object Basic element contains three parts: subject, predicate and object. Individual Property Slide 45 Triple Triple Graph A set of triples become a graph An ontology-based database is a graph house was destroyed by fire Populating ontology Slide 46 Example Scenario : Requirement: (1)Every course module can only be taught by one Lecturer (2)A Lecturer can teach many courses.. (3)An student must enrol in at least 3 courses. (4)Max enrolment number for a course is 100. Design a data structure for Course Modules Selection * Every student has a unique student ID * Every staff has a unique staff ID Slide 47 Ontological approach Student Course Lecturer Identify concepts Slide 48 Ontological approach Student Course Lecturer Organise classes into hierarchies Slide 49 Making relationships explicit and clear Student Course Lecturer Person Organise classes into hierarchies Enable reuse of domain knowledge Slide 50 Student Course Lecturer Ontological Approach Person Enable reuse of domain knowledge Ontological approach Can be taken from other ontology Slide 51 Student Course Lecturer Ontological Approach Person Add Data Type Property Name Staff ID Student ID Course ID Ontological approach Slide 52 Ontological Approach Student Course Lecturer Person Name Staff ID Student ID Course ID Ontological approach Add Object Property Slide 53 Ontological Approach Student Course Lecturer Person Name Staff ID Student ID Course ID Ontological approach Object Property Slide 54 Ontological Approach Student Course Lecturer Person Ontological approach Object Property Add ObjectProperty Slide 55 Ontological Approach Student Course Lecturer Person teaches Ontological approach Object Property Add ObjectProperty Slide 56 Ontological Approach Student Course Lecturer Person teaches Ontological approach enrol in Object Property Add ObjectProperty Slide 57 Ontological Approach Object Property Student Course Lecturer Person teaches enrol in Ontological approach Add ObjectProperty Slide 58 Ontological Approach Object Property Student Course Lecturer Person teaches enrol in is taught by has registered student Add Inverse Property Ontological approach Slide 59 Ontological Approach Object Property Student Course Lecturer Person teaches enrol in is taught by has registered student =1 min. 3 max. 100 =1 Specify cardinality Ontological approach Slide 60 Ontological Approach Object Property Student Course Lecturer Person teaches enrol in is taught by has registered student (functional) (inverseFunctional) =1 min. 3 max. 100 =1 Identify type of property Ontological approach Slide 61 Ontological Approach Object Property Student Course Lecturer Person teaches enrol in is taught by has registered student (functional) (inverseFunctional) =1 min. 3 max. 100 =1 Done! Ontological approach Slide 62 Ontological Approach Add triple course lecturer student L1 C1 enrol in teaches Ontological approach Slide 63 Ontological Approach Add triple L1 C1 Ontological approach teaches course lecturer student enrol in teaches Slide 64 Ontological Approach Add triple L1 C1 S1 Ontological approach teaches course lecturer student enrol in teaches enrol in Slide 65 Why use ontology? Ontological Approach Add triple L1 C1 C2 C3 C4 C5 L2 S1 S2 S3 Ontological approach course lecturer student enrol in teaches Slide 66 Explore implicit relationship Ontological Approach Reasoning L1 C1 S1 studied under the supervision of if Student S studies course C if Lecturer L teaches course C course lecturer student enrol in teaches Slide 67 Explore implicit relationship Deductive reasoning Reasoning L1 C1 S1 studied under the supervision of if Student S enrolled in course C AND Lecturer L teaches course C THEN Student S studied under the supervision of L (?s rdf:type Student) (?s rdf:type Student)(?s enrolled ?c) (?l teaches ?c) (?s studies_under the supervision of ?l) teaches enrolled studied under the supervision of course lecturer student enrol in teaches Slide 68 Classification Class hierarchy Reasoning L1 C2 C1 C2 Student Lecturer Person Lazy Lecturer Hardworking Lecturer C2 Define Hardworking Lecturer: A Lecturer who teach more than 4 courses using Description Logic Class(Hardworking Lecturer, subClassOf(Restriction(hasCourse, min-cardinality(4)))) course lecturer student enrol in teaches Slide 69 69 Ontology Editor http://protege.stanford.edu/ Protg Download Protge 3.4.7 http://protege.stanford.edu/download/r egistered.html http://protege.stanford.edu/download/r egistered.html Download example in this slide: http://www.tracingnetworks.ac.uk:443/ wiki/index.php/File:Course.owl.zip http://www.tracingnetworks.ac.uk:443/ wiki/index.php/File:Course.owl.zip Try it?