pal gov.tutorial2.session7
TRANSCRIPT
1PalGov © 2011 1PalGov © 2011
أكاديمية الحكومة اإللكترونية الفلسطينيةThe Palestinian eGovernment Academy
www.egovacademy.ps
Session 7
OWL (Web Ontology Langauge)
Tutorial II: Data Integration and Open Information Systems
Dr. Mustafa Jarrar
University of Birzeit
www.jarrar.info
2PalGov © 2011 2PalGov © 2011
About
This tutorial is part of the PalGov project, funded by the TEMPUS IV program of the
Commission of the European Communities, grant agreement 511159-TEMPUS-1-
2010-1-PS-TEMPUS-JPHES. The project website: www.egovacademy.ps
University of Trento, Italy
University of Namur, Belgium
Vrije Universiteit Brussel, Belgium
TrueTrust, UK
Birzeit University, Palestine
(Coordinator )
Palestine Polytechnic University, Palestine
Palestine Technical University, PalestineUniversité de Savoie, France
Ministry of Local Government, Palestine
Ministry of Telecom and IT, Palestine
Ministry of Interior, Palestine
Project Consortium:
Coordinator:
Dr. Mustafa Jarrar
Birzeit University, P.O.Box 14- Birzeit, Palestine
Telfax:+972 2 2982935 [email protected]
3PalGov © 2011 3PalGov © 2011
© Copyright Notes
Everyone is encouraged to use this material, or part of it, but should
properly cite the project (logo and website), and the author of that part.
No part of this tutorial may be reproduced or modified in any form or by
any means, without prior written permission from the project, who have
the full copyrights on the material.
Attribution-NonCommercial-ShareAlike
CC-BY-NC-SA
This license lets others remix, tweak, and build upon your work non-
commercially, as long as they credit you and license their new creations
under the identical terms.
PalGov © 2011 4
Tutorial Map
Topic h
Session 1: XML Basics and Namespaces 3
Session 2: XML DTD’s 3
Session 3: XML Schemas 3
Session 4: Lab-XML Schemas 3
Session 5: RDF and RDFs 3
Session 6: Lab-RDF and RDFs 3
Session 7: OWL (Ontology Web Language) 3
Session 8: Lab-OWL 3
Session 9: Lab-RDF Stores -Challenges and Solutions 3
Session 10: Lab-SPARQL 3
Session 11: Lab-Oracle Semantic Technology 3
Session 12_1: The problem of Data Integration 1.5
Session 12_2: Architectural Solutions for the Integration Issues 1.5
Session 13_1: Data Schema Integration 1
Session 13_2: GAV and LAV Integration 1
Session 13_3: Data Integration and Fusion using RDF 1
Session 14: Lab-Data Integration and Fusion using RDF 3
Session 15_1: Data Web and Linked Data 1.5
Session 15_2: RDFa 1.5
Session 16: Lab-RDFa 3
Intended Learning Objectives
A: Knowledge and Understanding
2a1: Describe tree and graph data models.
2a2: Understand the notation of XML, RDF, RDFS, and OWL.
2a3: Demonstrate knowledge about querying techniques for data
models as SPARQL and XPath.
2a4: Explain the concepts of identity management and Linked data.
2a5: Demonstrate knowledge about Integration &fusion of
heterogeneous data.
B: Intellectual Skills
2b1: Represent data using tree and graph data models (XML &
RDF).
2b2: Describe data semantics using RDFS and OWL.
2b3: Manage and query data represented in RDF, XML, OWL.
2b4: Integrate and fuse heterogeneous data.
C: Professional and Practical Skills
2c1: Using Oracle Semantic Technology and/or Virtuoso to store
and query RDF stores.
D: General and Transferable Skills2d1: Working with team.
2d2: Presenting and defending ideas.
2d3: Use of creativity and innovation in problem solving.
2d4: Develop communication skills and logical reasoning abilities.
5PalGov © 2011 5PalGov © 2011
Session ILOs
After completing this session students will
be able to:
- Understand the notation of OWL.
6PalGov © 2011
Reading Material
OWL Guide
http://www.w3.org/TR/2004/REC-owl-guide-20040210/#BasicDefinitions
You only need to read:Section 1. Introduction
Section 2. The Structure of Ontologies
Section 3. Basic Elements
Section 4. Ontology Mapping
Section 5. Complex Classes
OWL 2 Web Ontology Language: Structural Specification and
Functional-Style Syntax
http://www.w3.org/2007/OWL/draft/owl2-syntax
OWL 2 Document Overview
http://www.w3.org/TR/owl2-overview/
7PalGov © 2011
What is OWL?
OWL stands for Web Ontology Language.
OWL is built on top of RDF.
OWL is written in XML.
OWL is for processing information on the web.
OWL was designed to be interpreted by computers.
OWL was not designed for being read by people.
OWL has three sublanguages (OWL full, OWL DL, OWL Lite)
OWL is a W3C standard.
http://www.w3schools.com
8PalGov © 2011
OWLSource: www.w3.org
9PalGov © 2011
What is an Ontology
• Ontology is about the exact description of things and their
relationships.
• For the web, ontology is about the exact description of web
information and relationships between them.
• (only at this stage), you can see an ORM schema as
ontology.
• Later, we will study the difference between an ontology
and a databases schema.
10PalGov © 2011
Why OWL ?
• OWL is part of the "Semantic Web Vision"
– Web information has exact meaning.
– Web information can be processed by computers.
– Computers can integrate information from the web.
11PalGov © 2011
OWL was Designed for Processing Information
• OWL was designed to provide a common way to process
the content of web information (instead of displaying it).
• OWL read by computer applications (instead of humans).
was designed to be
12PalGov © 2011
OWL is Different from RDF
• OWL and RDF Schema are much of the same thing, but
OWL allow constrains and rules.
• OWL comes with a larger vocabulary and stronger syntax
than RDF and RDFS.
13PalGov © 2011
Variations of OWL
• OWL Full – An extension of RDF
– Allows for classes as instances, modification of RDF and OWL
vocabularies
• OWL DL– The part of OWL Full that is in the Description Logic framework.
– Known to have decidable reasoning.
• OWL Lite– A subset of OWL DL
– Easier for frame-based tools to transition to
– Easier reasoning
14PalGov © 2011
OWL is Written in XML
• OWL is specified in XML so it can be easily exchanged between
different types of computers using different types of operating system
and application languages.
• OWL can be seen as an extension of RDF/RDFS, so that RDF
parsers can parse OWL.
• Names in OWL are RDF URI references
– e.g., http://cohse.semanticweb.org/ontologies/people#pet
– Often (informally) abbreviated via XML qualified names
– e.g., pp:pet
• Data items belong to XML Schema datatypes
– e.g., XML Schema integers and strings
– Generally written in RDF/XML form
– e.g., .7.8sd:integer, .Susan.8sd:string
15PalGov © 2011
OWL is a Web Standard
• OWL became a W3C (World Wide Web Consortium) Recommendation
in February 2004.
• A W3C Recommendation is understood by the industry and the web
community as a web standard. A W3C Recommendation is a stable
specification developed by a W3C Working Group and reviewed by the
W3C Membership.
16PalGov © 2011
OWL 2
• OWL 2, became a W3C recommendation in 27 October 2009.
• An ontology language for the semantic Web which is extended from
OWL 1 and empowered by new features.
• OWL 2 DL underpinning description logic is SROIQ DL.
• Contains the majority of constructs to be used for building any needed
ontology.
• OWL 2 is supported by several semantic reasoners such as RacerPro
2, Pellet, Hermit and FaCT++.
• OWL 2 ontologies are primary exchanged as RDF documents, where
these ontologies can be used with information written in RDF.
• OWL 2 elements are identified by Internationalized Resource
Identifiers (IRIs).
17PalGov © 2011
Variations of OWL 2
• OWL 2 EL– Allows for subclass axioms with intersection, existential quantification, top,
bottom and closed classes with only one member.
– Disallow for negation, disjunction, arbitrary universal quantification, role
inverses.
• OWL 2 QL– Allows for subproperties, domain, range and subclass statements.
– Disallow for closed classes.
• OWL 2 RL– Allows for all axiom types, cardinality restrictions(only ≤1 and ≤0 on right
hand side) and closed classes with only one member.
– Disallow certain constructors( universal and negation on left hand side and
extensional and union on right hand side of subclass statements).
18PalGov © 2011
OWL Basics
• Classes
• Individuals
• Properties
• Special Classes and Properties
19PalGov © 2011
Classes
Owl:Class
• Unary predicates: Person(__), City(__).
• User-defined classes which are subclasses of root class owl:Thing. A
class may contain individuals, which are instances of the class, and
other subclasses.
<owl:Class rdf:ID=“Person"/> <owl:Class rdf:ID=“City"/> <owl:Class rdf:ID=“Country"/> <owl:Class rdf:ID=“Book"/>
• Similar to Object-Type in ORM, Entity in EER, or Class in UML
20PalGov © 2011
Individuals
Individuals
• Constants: Edward_Said, Palestine.
• An individual is a member/instance of a class
<Man rdf:ID=“Edward_Said" /><Country rdf:ID=“Palestine" /><City rdf:ID=“Jerusalem" />
• Notice that there is no way in ORM/UML/EER to add instance of concepts as art of the schema.
21PalGov © 2011
Properties
owl:ObjectProperty
• A relation between instances of two classes.
• Binary predicates (author(__, __) ).
• Similar to a binary relation in ORM between two entities.
<owl:ObjectProperty rdf:ID=“Author">
<rdfs:domain rdf:resource="# Book"/>
<rdfs:range rdf:resource="#Person"/>
</owl:ObjectProperty>
22PalGov © 2011
Properties
owl:DataTypeProperty
• Relation between instances of classes and literals.
• The range of a literal datatype (use XML Schema datatypes).
• Similar to a binary relation in ORM between an Entity and a Value.
<owl:DatatypeProperty rdf:ID=“Title">
<rdfs:domain rdf:resource="#Book" />
<rdfs:range rdf:resource=" xsd:string"/>
</owl:DatatypeProperty>
<owl:DatatypeProperty rdf:ID=“Price">
<rdfs:domain rdf:resource="#Book" />
<rdfs:range rdf:resource="xsd:integer"/>
</owl:DatatypeProperty>
23PalGov © 2011
Special Classes and Properties
• Top class: T
owl:Thingcontains all individuals of the domain.
• Bottom class: ┴
owl:Nothingcontains no individuals(empty class).
• Universal property: U
owl:topObjectPropertylinks every individual to every individual.
24PalGov © 2011
Class Expression Axioms
• Subclass Axioms
• Equivalent Classes
• Disjoint Classes
• Disjoint Union of Class Expressions
25PalGov © 2011
rdfs:subClassOf
• Notice that rdfs:subClassOf is part of RDFS, not OWL. This to show
that OWL extends RDF/RDFS.
• rdfs:subClassOf is similar to the SubType relation UML and EER, and
the same as subType in ORM, but here it is not a proper subtypes.
• Similar to a subtype in ORM.
• SubClassOf( a:Man a:Person ) means that Each Man is a Person.
<owl:Class rdf:ID=“Man">
<rdfs:subClassOf rdf:resource=“#Person"/>...
</owl:Class>
<owl:Class rdf:ID=“Book"> <rdfs:subClassOf rdf:resource="#Publication" /> ...
</owl:Class>
Class Expression Axioms
Subclass Axioms
26PalGov © 2011
Class Expression Axioms
Equivalent Classes
owl:equivalentClass
• States the equivalence (in terms of their class extension) of two named
classes.
• Useful when integrating or mapping between two different ontologies.
<owl:Class rdf:about="#Palestine_President">
<owl:equivalentClass rdf:resource=“aa:PrincipalResidentOfPlestine"/>
</owl:Class>
• A class axiom may contain (multiple) owl:equivalentClass
statements.
<owl:Class rdf:about="#Being">
<owl:equivalentClass rdf:resource="#Human"/>
<owl:equivalentClass rdf:resource="#Person"/>
</owl:Class>
The classes Being, Human and Person are semantically equivalent to each other.
27PalGov © 2011
Class Expression Axioms
Disjoint Classes
owl:disjointWith
• Each owl:disjointWith statement asserts that the class extensions of
the two class descriptions involved have no individuals in common.
• DisjointClasses (C1 ... Cn ): all of the classes Ci, 1 ≤ i ≤ n, are pairwise
disjoint; that is, no individual can be at the same time an instance of
both Ci and Cj for i ≠ j.
<owl:Class rdf:about="#Opera">
<rdfs:subClassOf rdf:resource="#MusicDrama"/>
</owl:Class>
<owl:Class rdf:about="#Operetta">
<rdfs:subClassOf rdf:resource="#MusicDrama"/>
<owl:disjointWith rdf:resource="#Opera"/>
</owl:Class>
28PalGov © 2011
Class Expression Axioms
Disjoint Classes (continued )
owl:AllDisjointClasses
In order to assert that a set of classes is mutually disjoint, we can use
AllDisjointClasses.
<rdf:Description>
<rdf:type rdf:resource="&owl:AllDisjointClasses"/>
<owl:members rdf:parseType="Collection">
<rdf:Description rdf:about="#Building"/>
<rdf:Description rdf:about="#Tree"/>
<rdf:Description rdf:about="#Bird"/>
</owl:members>
</rdf:Description>
29PalGov © 2011
Class Expression Axioms
Disjoint Union of Class Expressions
owl:disjointUnionOf
• DisjointUnion (C C1 ... Cn ): a class C is a disjoint union of the classes
Ci, 1 ≤ i ≤ n, all of which are pairwise disjoint the extensions of all Ci
exactly cover the extension of C.
• DisjointUnion (Person Female Male ) means each Person is either a
Male or a Female, each Female is a Person, each Male is a Person,
and nothing can be both a Female and a Male.
<owl:Class rdf:about="#Person">
<owl:disjointUnionOf rdf:parseType="Collection">
<rdf:Description rdf:about="#Female"/>
<rdf:Description rdf:about="#Male"/>
</owl:disjointUnionOf>
30PalGov © 2011
Class Expression Axioms
OWL2 Example1
• In what follows we illustrate a simple example represented in ORM and OWL 2.
• In the example, the illustrated OWL 2 constructs are Class, Subclass, Union of
Classes and Disjoint Classes.
Female
Person
Male
...
<Class rdf:about="&OWL2Example1:Person“/>
<Class rdf:about="&OWL2Example1:Female">
<rdfs:subClassOf rdf:resource="&OWL2Example1:Person"/>
<disjointWith rdf:resource="&OWL2Example1:Male"/>
</Class>
<Class rdf:about="&OWL2Example1:Male">
<rdfs:subClassOf rdf:resource="&OWL2Example1:Person"/>
</Class>
<Class rdf:about="&OWL2Example1:Person">
<equivalentClass>
<Class>
<unionOf rdf:parseType="Collection">
<rdf:Description rdf:about="&OWL2Example1:Female"/>
<rdf:Description rdf:about="&OWL2Example1:Male"/>
</unionOf>
</Class>
<equivalentClass></Class>
…
31PalGov © 2011
Object Property Axioms
• Object Subproperties
• Equivalent Object Properties
• Disjoint Object Properties
• Inverse Object Properties
• Object Property Domain
• Object Property Range
• Functional Object Properties
• Inverse-Functional Object Properties
32PalGov © 2011
Object Property Axioms
Object Subproperties
rdfs:subPropertyOf
• Properties, like classes, can be arranged in a hierarchy.
• SubObjectPropertyOf (OP1 OP2 ): if an individual x is connected by
OP1 to an individual y, then x is also connected by OP2 to y.
• The rdfs:subPropertyOf means that anything with a Borrows property
with value X also has a ChecksOut property with value X.
• Similar to the Subset constraint in ORM.
<owl:ObjectProperty rdf:ID=“Borrows">
<rdfs:domain rdf:resource="#Person"/>
<rdfs:range rdf:resource="#Book"/>
</owl:ObjectProperty>
<owl:ObjectProperty rdf:ID=“ChecksOut">
<rdfs:subPropertyOf rdf:resource="# Borrows" />
<rdfs:range rdf:resource="#Book" />
...
</owl:ObjectProperty>
33PalGov © 2011
Object Property Axioms
Equivalent Object Properties
owl:equivalentProperty
• EquivalentObjectProperties (OP1 ... OPn): all of the object properties
OPi, 1 ≤ i ≤ n, are semantically equivalent to each other.
• Similar to the Equality constraint in ORM.
• EquivalentObjectProperties (a:hasBrother a:hasMaleSibling) means
that having a brother is the same as having a male sibling.
<owl:ObjectProperty rdf:about="#hasBrother">
<owl:equivalentProperty rdf:resource="#hasMaleSibling"/>
</owl:ObjectProperty>
34PalGov © 2011
Object Property Axioms
Disjoint Object Properties
owl:propertyDisjointWith
• DisjointObjectProperties (OP1 ... OPn): all of the object properties
OPi, 1 ≤ i ≤ n, are pairwise disjoint; that is, no individual x can be
connected to an individual y by both OPi and OPj for i ≠ j .
• Similar to the Exclusion constraint in ORM.
• DisjointObjectProperties( a:hasFather a:hasMother ) means that
Fatherhood is disjoint with motherhood.
<owl:ObjectProperty rdf:about="#hasFather">
<owl:propertyDisjointWith rdf:resource="#hasMother"/>
</owl:ObjectProperty>
35PalGov © 2011
Object Property Axioms
Inverse Object Properties owl:inverseOf• If a property P is tagged as the owl:inverseOf Q, then for all x and y:
P(x,y) iff Q(y,x).
• Note that the syntax for owl:inverseOf takes a property name as an
argument. A iff B means (A implies B) and (B implies A).
• InverseObjectProperties (OP1 OP2): the object property OP1 is an
inverse of the object property OP2, that is if an individual x is
connected by OP1 to an individual y, then y is also connected by OP2
to x, and vice versa.
• InverseObjectProperties (a:hasFather a:fatherOf ) means that having
a father is the opposite of being a father of someone.
<owl:ObjectProperty rdf:about="#hasFather">
<owl:equivalentProperty>
<rdf:Description>
<owl:inverseOf rdf:resource="#fatherOf"/>
</rdf:Description>
</owl:equivalentProperty>
</owl:ObjectProperty>
36PalGov © 2011
Object Property Axioms
Object Property Domain
rdfs:domain
• ObjectPropertyDomain (OP C): the domain of the object property
OP is the class C, that is, if an individual x is connected by OP with
some other individual, then x is an instance of C.
• ObjectPropertyDomain( a:hasDog a:Person ) means that only people
can own dogs.
<owl:ObjectProperty rdf:about="#hasDog">
<rdfs:domain rdf:resource="#Person"/>
…
</owl:ObjectProperty>
37PalGov © 2011
Object Property Axioms
Object Property Range
rdfs:range
• ObjectPropertyRange(OP C): the range of the object property OP is
the class C , that is, if some individual is connected by OP with an
individual x, then x is an instance of C.
• ObjectPropertyRange( a:hasDog a:Dog ) means that the range of the
a:hasDog property is the class a:Dog.
<owl:ObjectProperty rdf:about="#hasDog">
…
<rdfs:range rdf:resource="#Dog"/>
</owl:ObjectProperty>
38PalGov © 2011
Object Property Axioms
Functional Object Property
Owl:FunctionalProperty
• FunctionalObjectProperty (OP): the object property OP is functional,
that is, for each individual x, there can be at most one distinct
individual y such that x is connected by OP to y.
• Similar to the Uniqueness constraint in ORM.
• FunctionalObjectProperty (a:hasFather ) means that each object can
have at most one father.
<owl:ObjectProperty rdf:about="#hasFather">
<rdf:type rdf:resource="&owl;FunctionalProperty"/>
…
</owl:ObjectProperty>
39PalGov © 2011
Object Property Axioms
Inverse-Functional Object Property
Owl:InverseFunctionalProperty
• InverseFunctionalObjectProperty (OPI ): the object property OPI is
inverse-functional, that is, for each individual x, there can be at most
one individual y such that y is connected by OP with x.
• InverseFunctionalObjectProperty (a:fatherOf ) means that each
object can have at most one father.
<owl:ObjectProperty rdf:about="#fatherOf">
<rdf:type rdf:resource="&owl;InverseFunctionalProperty"/>
…
</owl:ObjectProperty>
40PalGov © 2011
Object Property Axioms
OWL2Example2
• In what follows we illustrate a simple example represented in ORM and OWL 2.
• In the example, the illustrated OWL 2 constructs are Object Subproperties, Inverse Object
Properties, Object Property Domain, Object Property Range and Functional Object
Properties.
...
<Class rdf:about="&OWL2Example2:Person"/>
<Class rdf:about="&OWL2Example2:Vehicle"/>
<Class rdf:about="&OWL2Example2:Gender"/>
<ObjectProperty rdf:about="&OWL2Example2:Drives">
<rdfs:domain rdf:resource="&OWL2Example2:Person"/>
<rdfs:range rdf:resource="&OWL2Example2:Vehicle"/>
</ObjectProperty>
<ObjectProperty rdf:about="&DrivenBy">
<inverseOf rdf:resource="OWL2Example2:Drives"/>
</ObjectProperty>
Has
Drives DrivenBy
VehiclePersonGender
Owns
<ObjectProperty rdf:about="&OWL2Example2:Owns">
<rdfs:domain rdf:resource="&OWL2Example2:Person"/>
<rdfs:range rdf:resource="&OWL2Example2:Vehicle"/>
</ObjectProperty>
<ObjectProperty rdf:about="&OWL2Example2:Owns">
<rdfs:subPropertyOf rdf:resource="&OWL2Example2:Drives"/>
</ObjectProperty>
<ObjectProperty rdf:about="&OWL2Example2:Has">
<rdf:type
rdf:resource="http://www.w3.org/2002/07/owl#FunctionalPropert
y"/>
</ObjectProperty>
…
41PalGov © 2011
Assertions
• Class Assertions
• Individual Equality
• Individual Inequality
42PalGov © 2011
Assertions
Class Assertions
owl:NamedIndividual
• ClassAssertion (C a ): the individual a is an instance of the class C.
• ClassAssertion (a:Person a:Mira ) means that Mira is a Person.
<owl:NamedIndividual rdf:about="#Mira">
<rdf:type rdf:resource="#Person"/>
</owl:NamedIndividual>
43PalGov © 2011
Assertions
Individual Equality
owl:sameAs
• Identity between Individuals
• This mechanism is similar to that for classes, but declares two
individuals to be identical.
• SameIndividual ( a1 ... an ): all of the individuals ai, 1 ≤ i ≤ n, are equal
to each other(synonymes).
<Book rdf:ID=“http://www.amazon.com/Orientalism-Edward-W-Said/dp/039474067X">
<owl:sameAs rdf:resource=" http://en.wikipedia.org/wiki/Orientalism" />
</Book>
<rdf:Description rdf:about="#Edward_Said">
<owl:sameAs rdf:resource="# E_Said "/>
</rdf:Description>
<owl:Class rdf:ID="FootballTeam">
<owl:sameAs rdf:resource="http://sports.org/US#SoccerTeam"/>
</owl:Class>
44PalGov © 2011
owl:differentFrom [OWL DL]
• An owl:differentFrom statement indicates that two URI references
refer to different individuals.
• It is needed where OWL 2 does not support unique name
assumption.
<Book rdf:ID="http://www.amazon.com/Orientalism-Edward-W-Said/dp/039474067X">
<owl:differentFrom
rdf:resource="http://www.youtube.com/watch?v=X3iA73JXIFo"/>
</Book>
Assertions
Individual Inequality
45PalGov © 2011
Assertions
Individual Inequality (AllDifferent)
• The use of owl:differentFrom is likely to lead to a large number of
statements, as all individuals have to be declared pairwise disjoint.
• DifferentIndividuals( a1 ... an ): all of the individuals ai, 1 ≤ i ≤ n, are
different from each other; that is, no individuals ai and aj with i ≠ j can
be derived to be equal.
• DifferentIndividuals( a:Antoon a:Mustafa a:Rami ) Anton, Mustafa and
Rami are all different from each other.
<rdf:Description>
<rdf:type rdf:resource="&owl;AllDifferent"/>
<owl:distinctMembers rdf:parseType="Collection">
<rdf:Description rdf:about="#Anton"/>
<rdf:Description rdf:about="#Mustafa"/>
<rdf:Description rdf:about="#Rami"/>
</owl:distinctMembers>
</rdf:Description>
46PalGov © 2011
Class Expressions
• Intersection of Class Expressions
• Union of Class Expressions
• Complement of Class Expressions
• Enumeration of Individuals
47PalGov © 2011
Class Expressions
Intersection of Class Expressions
owl:intersectionOf
Describes a class for which the class extension contains precisely those
individuals that are members of the class extension of all class
descriptions in the list. <owl:Class>
<owl:intersectionOf rdf:parseType="Collection">
<owl:Class>
<owl:oneOf rdf:parseType="Collection">
<owl:Thing rdf:about="#BirzeitUniversity" />
<owl:Thing rdf:about="#TeraCollage" />
</owl:oneOf>
</owl:Class>
<owl:Class>
<owl:oneOf rdf:parseType="Collection">
<owl:Thing rdf:about="#BirzeitUniversity" />
<owl:Thing rdf:about="#AlqudsUniversity" />
<owl:Thing rdf:about="#AlnajahUniversity" />
</owl:oneOf>
</owl:Class>
</owl:intersectionOf>
</owl:Class>
48PalGov © 2011
Class Expressions
Union of Class Expressions
owl:unionOf [OWL DL]
Describes an anonymous class for which the class extension contains
those individuals that occur in at least one of the class extensions of the
class descriptions in the list. <owl:Class>
<owl:unionOf rdf:parseType="Collection">
<owl:Class>
<owl:oneOf rdf:parseType="Collection">
<owl:Thing rdf:about="#BirzeitUniversity" />
<owl:Thing rdf:about="#TeraCollage" />
</owl:oneOf>
</owl:Class>
<owl:Class>
<owl:oneOf rdf:parseType="Collection">
<owl:Thing rdf:about="#BirzeitUniversity" />
<owl:Thing rdf:about="#AlqudsUniversity" />
<owl:Thing rdf:about="#AlnajahUniversity" />
</owl:oneOf>
</owl:Class>
</owl:unionOf>
</owl:Class>
49PalGov © 2011
Class Expressions
Complement of Class Expressions
owl:complementOf [OWL DL]
• Describes a class for which the class extension contains exactly those
individuals that do not belong to the class extension of the class
description that is the object of the statement.
• Analogous to logical negation: the class extension consists of those
individuals that are NOT members of the class extension of the
complement class.<owl:Class rdf:ID="NotPalestinian">
<owl:intersectionOf rdf:parseType="Collection">
<owl:Class rdf:about="#Person"/>
<owl:Class>
<owl:complementOf>
<owl:Restriction>
<owl:onProperty rdf:resource="#hasParent" />
<owl:hasValue rdf:resource="#Palestine" />
</owl:Restriction>
</owl:complementOf>
</owl:Class>
</owl:intersectionOf>
</owl:Class>
50PalGov © 2011
Class Expressions
Enumeration of Individuals
owl:one of [OWL DL]
• A list of individuals that are the instances of the class described.
• This enables a class to be described by exhaustively enumerating its
instances.
• The class extension of a class described with owl:oneOf contains
exactly the enumerated individuals, no more, no less.
<owl:Class>
<owl:oneOf rdf:parseType="Collection">
<owl:Thing rdf:about="#Jerusalem "/>
<owl:Thing rdf:about="#Aka"/>
<owl:Thing rdf:about="#Gaza"/>
<owl:Thing rdf:about="#Nablus"/>
<owl:Thing rdf:about="#Hebron"/>
</owl:oneOf>
</owl:Class>
51PalGov © 2011
Class Expressions
Object Property Restrictions
• Existential Quantification
• Universal Quantification
• Individual Value Restriction
• Self-Restriction
52PalGov © 2011
Class Expressions
Object Property Restrictions- Existential Quantification
owl:someValuesFrom
For all Accounts, they have at least one Owner that is a Peron.
<owl:Class rdf:ID=“Account">
<owl:Restriction>
<owl:onProperty rdf:resource="#HasOwner" />
<owl:someValuesFrom rdf:resource="#Person" />
</owl:Restriction>
</owl:Class>
53PalGov © 2011
Class Expressions
Object Property Restrictions- Universal Quantification
owl:allValuesFrom
For all Accounts, if they have owners, all the owners are Persons.
<owl:Class rdf:ID=“Account">
<owl:Restriction>
<owl:onProperty rdf:resource="#HasOwner" />
<owl:allValuesFrom rdf:resource="#Person" />
</owl:Restriction>
</owl:Class>
54PalGov © 2011
Class Expressions
Object Property Restrictions- Individual Value Restriction
owl:hasValue
ObjectHasValue( OP a ): consists of an object property OP and an
individual a, and it contains all those individuals that are connected
by OP to a.
…
<owl:Restriction>
<owl:onProperty rdf:resource="#fatherOf"/>
<owl:hasValue rdf:resource="#John"/>
</owl:Restriction>
…
55PalGov © 2011
Class Expressions
Object Property Restrictions- Self Restriction
owl:hasSelf
• ObjectHasSelf( OP ): consists of an object property OP, and it
contains all those individuals that are connected by OP to themselves.
• ObjectHasSelf( a:hates ) contains those individuals that hate
themselves.
…
<owl:Restriction>
<owl:onProperty rdf:resource="#hates"/>
<owl:hasSelf rdf:datatype="&xsd;boolean">true</owl:hasSelf>
</owl:Restriction> …
56PalGov © 2011
Class Expressions
Object Property Cardinality Restrictions
• Minimum Cardinality
• Maximum Cardinality
• Exact Cardinality
57PalGov © 2011
Class ExpressionsObject Property Cardinality Restrictions- Minimum Cardinality
owl:Restriction , owl:onProperty, owl:minCardinality
• OWL allows us to place some restrictions on properties, such as
owl:minCardinality.
• The owl:Restriction below is to place a min cardinality constraint
on the property AuthorOf, at least one.
• This is similar to Mandatory in ORM
<owl:Class rdf:ID=“Book">
<rdfs:subClassOf>
<owl:Restriction>
<owl:onProperty rdf:resource="#AuthorOf"/>
<owl:minCardinality rdf:datatype="&xsd;nonNegativeInteger“>1</owl:minCardinality>
</owl:Restriction>
</rdfs:subClassOf>
...
</owl:Class>
58PalGov © 2011
Class ExpressionsObject Property Cardinality Restrictions- Maximum Cardinality
owl:maxCardinality
• OWL allows us to place some restrictions on properties, such as
owl:maxCardinality.
• The owl:Restriction below is to place a max cardinality constraint on
the property AuthorOf, at most one.
• This is similar to unique in ORM.
<owl:Class rdf:ID=“Book">
<rdfs:subClassOf>
<owl:Restriction>
<owl:onProperty rdf:resource="#AuthorOf"/>
<owl:maxCardinality rdf:datatype="&xsd;nonNegativeInteger“>1</owl:maxCardinality>
</owl:Restriction>
</rdfs:subClassOf>
...
</owl:Class>
59PalGov © 2011
Class ExpressionsObject Property Cardinality Restrictions - Cardinality
This permits the user to indicate 'at least one', 'no more than one', and
'exactly one'. For example: Each book has at least and at most (i.e.,
exactly) one ISBN value.
<owl:Class rdf:ID=“Book"> <rdfs:subClassOf>
<owl:Restriction> <owl:onProperty rdf:resource="#hasISBN"/>
<owl:cardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:cardinality> </owl:Restriction>
</rdfs:subClassOf> </owl:Class>
• Cardinality with values limited to 0 or 1 are part of OWL Lite.
• owl:maxCardinality can be used to specify an upper bound.
owl:minCardinality can be used to specify a lower bound.
• In combination, the two can be used to limit the property's cardinality to
a numeric interval.
• Positive integer values other than 0 and 1 are permitted in OWL DL.
60PalGov © 2011
Class ExpressionsObject Property Cardinality Restrictions- Exact Cardinality
owl:qualifiedCardinality
The owl:Restriction below is to place an exact cardinality expression
that contains those individuals that are connected by a:hasVehicle to
exactly one instance of a:Car.
<owl:Class rdf:about="#Person">
<owl:equivalentClass>
<owl:Restriction>
<owl:onProperty rdf:resource="#hasVehicle"/>
<owl:onClass rdf:resource="#Car"/>
<owl:qualifiedCardinality
rdf:datatype="&xsd;nonNegativeInteger">1</owl:qualifiedCardinality>
</owl:Restriction>
</owl:equivalentClass>
</owl:Class>
61PalGov © 2011
Property Chain Axioms
owl:propertyChainAxiom
Allows for inferring the existence of a property from a chain of
properties.
<rdf:Description rdf:about="hasGrandparent">
<owl:propertyChainAxiom rdf:parseType="Collection">
<owl:ObjectProperty rdf:about="hasParent"/>
<owl:ObjectProperty rdf:about="hasParent"/>
</owl:propertyChainAxiom>
</rdf:Description>
62PalGov © 2011
XML Datatypes
xsd:string
xsd:normalizedString
xsd:boolean
xsd:decimal
xsd:float
xsd:double
xsd:integer
xsd:nonNegativeInteger
xsd:positiveInteger
xsd:nonPositiveInteger
xsd:negativeInteger
xsd:long
xsd:int
xsd:short
xsd:byte
xsd:unsignedLong
xsd:unsignedInt
xsd:unsignedShort
xsd:unsignedByte
xsd:hexBinary
xsd:base64Binary
xsd:dateTime
xsd:time
xsd:date
xsd:gYearMonth
xsd:gYear
xsd:gMonthDay
xsd:gDay
xsd:gMonth
xsd:anyURI
xsd:token
xsd:language
xsd:NMTOKEN
xsd:Name
xsd:NCName
The above datatypes, plus rdfs:Literal, form the built-in OWL datatypes.
63PalGov © 2011
Properties of Individuals
We may also add properties between individuals.
<owl:ObjectProperty rdf:ID=“hasCapital"> .<rdfs:domain rdf:resource=“#Country" /> <rdfs:range rdf:resource="#City" />
</owl:ObjectProperty>
<owl:ObjectProperty rdf:ID=“hasPopulation"> .<rdfs:domain rdf:resource=“#City" /> <rdfs:range rdf:resource=" xsd:integer />
</owl:ObjectProperty>
<City rdf:ID=“Palestine"> <hasCapital rdf:resource="#J" />
</Region>
PalGov © 2011 64
References
• www.w3c.org
• www.w3schools.com
• Rami Hodrob, Mustafa Jarrar: ORM to OWL 2 DL
Mapping. In proceedings of the International Conference
on Intelligent Semantic Web – Applications and Services.
Pages 131-137. ACM ISBN 9781450304757. June 2010.
65PalGov © 2011
Thank you!