Ontological Modeling: Part 7

Similar documents
Ontological Modeling: Part 8

Ontological Modeling: Part 11

Ontological Modeling: Part 14

Ontological Modeling: Part 15

Ontological Modeling: Part 2

Ontological Modeling: Part 13

Semantic Web KM: A Knowledge Machine for Semantic Webs

Verbalizing Business Rules: Part 9

Verbalizing Business Rules: Part 10

Entity Relationship modeling from an ORM perspective: Part 2

H1 Spring B. Programmers need to learn the SOAP schema so as to offer and use Web services.

Logical Data Modeling: Part 12

Table of Contents. iii

ARISTOTLE UNIVERSITY OF THESSALONIKI. Department of Computer Science. Technical Report

OWL and tractability. Based on slides from Ian Horrocks and Franz Baader. Combining the strengths of UMIST and The Victoria University of Manchester

Microsoft s new database modeling tool: Part 3

Web Ontology Language: OWL

Short notes about OWL 1

Reasoning with the Web Ontology Language (OWL)

OWL a glimpse. OWL a glimpse (2) requirements for ontology languages. requirements for ontology languages

Logical Data Modeling: Part 1

[Ch 6] Set Theory. 1. Basic Concepts and Definitions. 400 lecture note #4. 1) Basics

Comparison of Semantic Web serialization syntaxes

Description Logic. Eva Mráková,

Main topics: Presenter: Introduction to OWL Protégé, an ontology editor OWL 2 Semantic reasoner Summary TDT OWL

Chapter 2 AN INTRODUCTION TO THE OWL WEB ONTOLOGY LANGUAGE 1. INTRODUCTION. Jeff Heflin Lehigh University

Enhanced Entity-Relationship (EER) Modeling

The OWL API: An Introduction

OWL 2 Web Ontology Language Primer

Semantic Technologies

Semantic Web Technologies Web Ontology Language (OWL) Part II. Heiko Paulheim

Semantic Web Technologies: Web Ontology Language

UML data models from an ORM perspective: Part 4

OWL 2 Web Ontology Language Primer W3C Recommendation 27 October 2009

LINKING BACKGROUND INFORMATION

Why Ontologies? RRDIU - Semantic Web 2

OWL Web Ontology Language

LECTURE 09 RDF: SCHEMA - AN INTRODUCTION

KDI OWL. Fausto Giunchiglia and Mattia Fumagallli. University of Trento

CSC Discrete Math I, Spring Sets

INF3580/4580 Semantic Technologies Spring 2017

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe

Introduction to modeling. ER modelling

Contents. G52IWS: The Semantic Web. The Semantic Web. Semantic web elements. Semantic Web technologies. Semantic Web Services

Chapter 4. Enhanced Entity- Relationship Modeling. Enhanced-ER (EER) Model Concepts. Subclasses and Superclasses (1)

INF3580 Semantic Technologies Spring 2012

FHIR RDF Sample side by side comparisons

Web Ontology Language (OWL)

Object-role modelling (ORM)

Semantic Web. MPRI : Web Data Management. Antoine Amarilli Friday, January 11th 1/29

Using RDF to Model the Structure and Process of Systems

Chapter 8: Enhanced ER Model

OWL 2 Update. Christine Golbreich

Microsoft s new database modeling tool: Part 5

The Semantic Web RDF, RDF Schema, and OWL (Part 2)

2.2 Set Operations. Introduction DEFINITION 1. EXAMPLE 1 The union of the sets {1, 3, 5} and {1, 2, 3} is the set {1, 2, 3, 5}; that is, EXAMPLE 2

A CONCEPTUAL SCHEMA BASED ON RDFS-OWL AND CONSISTENCY CONSTRAINT CHECKING WITH XQuery*

Automatic Transformation of Relational Database Schema into OWL Ontologies

2 Review of Set Theory

SETS. Sets are of two sorts: finite infinite A system of sets is a set, whose elements are again sets.

Presented By Aditya R Joshi Neha Purohit

OWL DL / Full Compatability

Extracting Ontologies from Standards: Experiences and Issues

Chapter 2: Entity-Relationship Model

The Formal Syntax and Semantics of Web-PDDL

Shared content-vocabularies: Ontologies

Logical Data Modeling: Part 7

RDF /RDF-S Providing Framework Support to OWL Ontologies

COMP718: Ontologies and Knowledge Bases

Helmi Ben Hmida Hannover University, Germany

OWL Tutorial. LD4P RareMat / ARTFrame Meeting Columbia University January 11-12, 2018

The ISO D approach

Querying Data through Ontologies

UML Data Models From An ORM Perspective: Part 3

Semantic Web Test

Bridging the Gap between Semantic Web and Networked Sensors: A Position Paper

SADI Semantic Web Services

9 The Ontology UML Profile

Introduction to Protégé. Federico Chesani, 18 Febbraio 2010

Extending OWL with Finite Automata Constraints

FOUNDATIONS OF SEMANTIC WEB TECHNOLOGIES

Formalising the Semantic Web. (These slides have been written by Axel Polleres, WU Vienna)

Semantic Web In Depth: Resource Description Framework. Dr Nicholas Gibbins 32/4037

A Heuristic Approach to Explain the Inconsistency in OWL Ontologies Hai Wang, Matthew Horridge, Alan Rector, Nick Drummond, Julian Seidenberg

Subtyping Revisited. Terry Halpin. Neumont University South Jordan, Utah. USA

Knowledge Representation for the Semantic Web Lecture 4: Description Logics III

OWL-based reasoning with retractable inference

Information Modeling and Relational Databases

Semantic Web. Ontology and OWL. Morteza Amini. Sharif University of Technology Fall 95-96

CC LA WEB DE DATOS PRIMAVERA Lecture 4: Web Ontology Language (I) Aidan Hogan

Chapter 11 Object and Object- Relational Databases

Ontology mutation testing

TMCL and OWL. Lars Marius Garshol. Bouvet, Oslo, Norway

Metamodels for RDF Schema and OWL

Ontologies and OWL. Riccardo Rosati. Knowledge Representation and Semantic Technologies

An Introduction to the Semantic Web. Jeff Heflin Lehigh University

Ontology Design Patterns

DEVELOPING AN OWL ONTOLOGY FOR E- TOURISM

H1 Spring C. A service-oriented architecture is frequently deployed in practice without a service registry

Semantic Web Services and OOP toward Unified Services

Transcription:

Ontological Modeling: Part 7 Terry Halpin LogicBlox and INTI International University This is the seventh in a series of articles on ontology-based approaches to modeling. The main focus is on popular ontology languages proposed for the Semantic Web, such as the Resource Description Framework (RDF), RDF Schema (RDFS), and the Web Ontology Language (OWL). OWL is based on description logic. A later series of articles will explore other logic-based languages such as datalog. The first article [2] introduced ontologies and the Semantic Web, and covered basic concepts in the Resource Description Framework (RDF), contrasting them with other data modeling approaches. The second article [3] discussed the N3 notation for RDF, and covered the basics of RDF Schema. The third article [4] provided further coverage of RDFS, and introduced different flavors of the Web Ontology language (OWL). The fourth article [5] discussed basic features of OWL, mainly using Manchester syntax. The fifth article [6] discussed OWL taxonomy, comparison operators for classes, data types and predicates, and examined inverses, functional roles and keys in more depth. The sixth article [7] covered cardinality restrictions in OWL 2. The current article discusses how the union, intersection, and complement operators are handled in OWL 2. Union In set theory, given any sets A and B, the union of A and B is the set of all elements in either A or B or both. That is, A B = {x x A x B}, where is the union operator and is the inclusive-or operator. The Venn diagram in Figure 1(a) depicts the union of A and B by shading in the region covering both the circles that depict the sets. If we union A B with set C, we obtain (A B) C, as pictured by the shaded region in Figure 1(b). The union operation is associative, so the order in which we associate the operands by bracketing doesn t matter, i.e. (A B) C = A (B C). This allows us to drop the brackets, rendering the union of A, B and C simply as A B C. Although the union operator is usually written as a binary operator in infix position, it may also be written as an n-ary operator (n 2) in prefix position with its operands listed in parentheses, e.g. (A, B, C), since this can be trivially rewritten in binary form. The union operation is also commutative, i.e. A B = B A. So the order in which we list the operands doesn t matter. This applies also to the n-ary prefix notation, e.g. (A, B, C, D) = (D, A, C, B). Figure 1 Venn diagrams for (a) the union of two sets, and (b) the union of three sets. The union operator is supported in all versions of OWL, except for OWL Lite, and may be applied to classes or data ranges (e.g. datatypes or other collections of literals). The complex class expression or data range expression resulting from a union may be used anywhere a simple class or data range may be used. The union of two or more classes contains all the individuals that occur in at least one of those classes. In Manchester syntax, the union operator appears as or, placed in infix position. Turtle syntax instead uses the owl:unionof predicate, placed in prefix position with its n operands (n 2) in parentheses. Table 1 illustrates a case where an inclusive union is intended. Any student who is either bright or industrious (or both) is classified as a promising student. 1

Table 1 Defining PromisingStudent as the union of BrightStudent and IndustriousStudent Class: PromisingStudent EquivalentTo: BrightStudent or IndustriousStudent :PromisingStudent a owl:class; owl:unionof (:BrightStudent :IndustriousStudent). Figure 2(a) shows an equivalent model for the Table 1 example in Object-Role Modeling (ORM) [1]. Inclusion relationships from subtype to supertype are shown as arrows, and the circled dot depicts the inclusive-or operator. In ORM, as in OWL, subtypes are overlapping by default, so no more needs to be said. Figure 1(b) shows an equivalent class diagram in the Unified Modeling Language (UML) [8]. The union constraint is depicted by the annotation complete. In UML, subclasses are disjoint by default, so the annotation overlapping needs to be explicitly asserted. Figure 2 Inclusive-or subtyping model for Table 1 in (a) ORM and (b) UML. Given the OWL declarations in Table 1, inferences may be drawn about membership in the superclass. For example, given the following statements (Manchester syntax on the left, Turtle syntax on the right)) Individual: Harry Types: BrightSudent Individual: Ron Types: IndustriousSudent Individual: Hermione Types: BrightStudent, IndustriousSudent :Harry a :BrightStudent :Ron a :IndustriousStudent :Hermione a :BrightStudent, IndustriousSudent we may infer Individual: Harry Types: PromisingSudent Individual: Ron Types: PromisingSudent Individual: Hermione Types: PromisingSudent :Harry a :PromisingStudent :Ron a :PromisingStudent :Hermione a :PromisingStudent A class partition may be declared in OWL by adding a disjoint classes declaration to the union operation. In Manchester syntax, to declare that two or more classes that are disjoint (i.e. mutually exclusive) simply prepend DisjointClasses: to the class list. In Turtle, use the owl:disjointwith predicate. For example, in Table 2, a Party is either a person or an organization, but not both. Table 2 Defining Party as a disjoint union of Person and Organization DisjointClasses: Person, Organization Class: Party EquivalentTo: Person or Organization :Person owl:disjointwith :Organization. :Party a owl:class; owl:unionof(:person :Organization). 2

(a) (b) Party Party {disjoint, complete} Person Organization Person Organization Figure 3 Exclusive-or subtyping model for Table 2 in (a) ORM and (b) UML. Figure 3(a) models the Table 2 example in ORM, using an exclusive-or constraint (depicted by a crossed dot), to partition Party into Person and Organization. Figure 3(b) models the same example in UML, using the annotations disjoint and complete. Table 3 extends the example by defining the class Party as a disjoint union of three classes. The Manchester syntax extends seamlessly to lists of three or more disjoint classes, but the Turtle syntax is much more complex, as shown. The corresponding ORM and UML models are shown in Figure 4. Table 3 Defining Party as a disjoint union of Person, PrivateCompany, and PublicOrganization DisjointClasses: Person, PrivateCompany, PublicOrganization Class: Party EquivalentTo: Person or PrivateCompany or Organization [] a owl:alldisjointclasses; owl:members (:Person :PrivateCompany :PublicOrganization). :Party a owl:class; owl:unionof (:Person :PrivateCompany :PublicOrganization). As a shorter alternative for declaring partitions, OWL supports the disjoint union operator. In Manchester syntax, this is rendered by using DisjointUnionOf:. For instance, the partition just discussed may be declared more concisely as shown below. Class: Party DisjointUnionOf: Person, PrivateCompany, PublicOrganization In Turtle, the same partition may be rendered by using the owl:disjointunionof predicate to denote the disjoint union operator, as shown below. This is much simpler than the alternative Turtle syntax used previously. :Party owl:disjointunionof (:Person :PrivateCompany :PublicOrganization). (a) (b) Party Party {disjoint, complete} Person PrivateCompany PublicOrganization Person PrivateCompany PublicOrganization Figure 4 Exclusive-or subtyping model for Table 3 in (a) ORM and (b) UML. 3

Intersection The intersection of sets A and B is the set of all elements that occur in both A and B. Using for the intersection operator and & for the logical conjunction operator and, this definition may be written thus: A B = {x x A & x B}. The Venn diagrams in Figure 5 depict the intersection of sets by shading the region where the circles that depict the sets overlap. Like union, the intersection operator is both associative and commutative, and an n-ary prefix notation may be used to abbreviate repeated applications of the binary infix operator. For example, the intersection of A, B and C may be rendered either as A B C or as (A, B, C). Figure 5 Venn diagrams for (a) the intersection of two sets, and (b) the intersection of three sets. In OWL, the intersection operator may be applied to classes or data ranges, and the complex class expression or data range expression resulting from an intersection may be used anywhere a simple class or data range may be used. The intersection of two or more classes contains each individual that occurs in all those classes. In Manchester syntax, the intersection operator appears as and, placed in infix position. Turtle syntax instead uses the owl:intersectionof predicate, placed in prefix position with its n operands (n 2) in parentheses. Table 4 provides a simple example where the class StudentEmployee is defined as the intersection of Student and Employee, which are themselves subclasses of Person. Table 4 Defining StudentEmployee as the intersection of Student and Employee Class: Person Class: Student SubClassOf: Person Class: Employee SubClassOf: Person Class StudentEmployee EquivalentTo: Student and Employee :Person a owl:class. :Student rdfs:subclassof :Person. :Employee rdfs:subclassof :Person. :StudentEmployee a owl:class; owl:intersectionof (:Student :Employee). Figure 6 models this example in ORM and UML. This is a case of multiple inheritance, since StudentEmployee is a subtype of both Student and Employee. Figure 6 Modeling student employees in (a) ORM and (b) UML. 4

The asterisk in Figure 6(a) indicates that the subtype StudentEmployee is derived, rather than simply asserted. In this case, ORM requires a subtype definition. Although the definition may be written as a quantified conditional, as shown in Figure 6(a), it is understood as a quantified biconditional, so that each object that is both a student and an employee must be a student employee. An alternative syntax renders the subtype definition thus: Define StudentEmployee as Student who is an Employee. UML has no high level language for expressing subclass definitions, so this has been added as an informal note in Figure 6(b). If desired, a constraint for this could be formally specified in UML using the Object Constraint Language (OCL) [9], but OCL expressions are often too cryptic for validation by nontechnical business users. Contrast this example with the one shown in Table 5, which is based on an example from the official OWL 2 Primer [10, pp. 28-29]. Here the class Grandfather is simply asserted, not defined. Instead it is simply constrained to be included in (rather than being identical to) the intersection of the Man and Parent classes. Not all men who are parents have to be grandparents. Table 5 Constraining Grandfather to be included in the intersection of Man and Parent Class: Grandfather SubClassOf: Man and Parent :Grandfather rdfs:subclassof [ rdf:type owl:class ; owl:intersectionof ( :Man :Parent ) ]. Figure 7 models this example in ORM and UML. In the ORM model, the absence of an asterisk indicates that the subtypes are simply asserted. Hence no definitions are provided for them. In practice, it would typically be much better to model Grandparent as a derived subtype, basing its definition on fact types such as Person is of Gender and Person is a grandparent of Person (which itself may typically be derived from Person is a parent of Person). Figure 7 Modeling subtyping constraints on Grandfather in (a) ORM and (b) UML. Complement In set theory, A, the complement of set A, is the set of all elements that are in the universal set U but not in the set A. Using ~ for the logical negation operator not, we have A = {x ~x A). In OWL, the class of all individuals is called owl:thing. We may visualize complements as the shaded regions in Figure 8. Figure 8 Picturing A as (a) the complement of a set A, and (b) the complement of an OWL class A. 5

In OWL, the complement operator may be applied to classes or data ranges, and the complex class expression or data range expression resulting may be used anywhere a simple class or data range may be used. The complement of a class contains each individual that is not a member of that class. In Manchester syntax, the complement operator appears as not. Turtle syntax instead uses the owl:complementof predicate. Table 7 provides a simple example where the class NonHuman is defined as the complement of the class Human. Table 6 Declaring in OWL that the class NonHuman is the complement of Human Class: Human Class: NonHuman EquivalentTo: not Human :Human a owl:class. :NonHuman a owl:class; Owl:complementOf :Human. It is rare in data modeling to introduce Thing as an entity type or class. However, if we do this, we can model the Table 6 example in ORM and UML as shown in Figure 9. (a) Thing (b) Thing {complete, disjoint} Human Nonhuman Human NonHuman Figure 9 One way to model the Table 6 example in (a) ORM and (b) UML. As a more typical example, Table 7 shows how to declare non-drivers as persons who are not drivers. The class Driver is also defined using a cardinality restriction, as discussed in the previous article [7]. Notice how much simpler the Manchester syntax is compared with Turtle. Table 7 Defining Driver and NonDriver in OWL Class: Person Class: Driver EquivalentTo: Person and drives min 1 Car Class: NonDriver EquivalentTo: Person and not Driver :Person a owl:class. :Driver owl:equivalentclass [ a owl:restriction; owl:onproperty :drives; owl:minqualifiedcardinality 1; owl:onclass :Car]. :NonDriver a owl:class; owl:intersectionof ( :Person [ owl:complementof :Driver] ). Figure 10 shows ORM and UML models for this case. In the ORM model, the subtypes are derived, so formal subtype definitions are provided. In the UML model, the subclass definitions are captured informally in notes. 6

Figure 10 Modeling the Table 7 example in (a) ORM and (b) UML. All the examples so far have used classes. In OWL 2, the union, intersection and complement operations may also be applied to data ranges. Table 8 provides some examples. Table 8 Applying union, intersection and complement operators to data ranges Datatype: StringOrInteger EquivalentTo: xsd:string or xsd:integer Datatype: PassGradeNr EquivalentTo: GradeNr and not FailGradeNr :StringOrInteger a rdfs:datatype; owl:unionof (xsd:string xsd:integer). :PassGradeNr a rdfs:datatype; owl:intersectionof ( :GradeNr [ owl:datatypecomplementof :FailGradeNr ] ). Conclusion The current article provided a detailed coverage of the union, intersection and complement operations in OWL 2. The next article will explore some other features of OWL 2, such as ring constraints and enumerated types. References 1. Halpin, T. & Morgan, T. 2008, Information Modeling and Relational Databases, 2 nd edition, Morgan Kaufmann, San Francisco. 2. Halpin, T. 2009, Ontological Modeling: Part 1, Business Rules Journal, Vol. 10, No. 9 (Sep. 2009), URL: http://www.brcommunity.com/a2009/b496.html. 3. Halpin, T. 2009, Ontological Modeling: Part 2, Business Rules Journal, Vol. 10, No. 12 (Dec. 2009), URL: http://www.brcommunity.com/a2009/b513.html. 4. Halpin, T. 2010, Ontological Modeling: Part 3, Business Rules Journal, Vol. 11, No. 3 (March 2010), URL: http://www.brcommunity.com/a2010/b527.html. 5. Halpin, T. 2010, Ontological Modeling: Part 4, Business Rules Journal, Vol. 11, No. 6 (June 2010), URL: http://www.brcommunity.com/a2010/b539.html. 6. Halpin, T. 2010, Ontological Modeling: Part 5, Business Rules Journal, Vol. 11, No. 12 (Dec. 2010), URL: http://www.brcommunity.com/a2010/b570.html. 7. Halpin, T. 2011, Ontological Modeling: Part 6, Business Rules Journal, Vol. 12, No. 2 (Feb., 2011), URL: http://www.brcommunity.com/a2011/b579.html. 8. Object Management Group 2003, UML 2.0 Superstructure Specification. Available online at: www.omg.org/uml. 9. Object Management Group 2005, UML OCL 2.0 Specification. Available online at: http://www.omg.org/docs/ptc/05-06-06.pdf. 10. W3C 2009, OWL 2 Web Ontology Language: Primer, URL: http://www.w3.org/tr/owl2-primer/. 7

11. W3C 2009, OWL 2 Web Ontology Language: Direct Semantics, URL: http://www.w3.org/tr/owl2- direct-semantics/. 12. W3C 2009, OWL 2 Web Ontology Language, URL: http://www.w3.org/tr/owl2-manchester-syntax/. 13. W3C 2009, OWL 2 Web Ontology Language Structural Specification and Functional-Style Syntax, URL: http://www.w3.org/tr/owl2-syntax/. 8