More Related Content
Similar to Pal gov.tutorial2.session7.owl
Similar to Pal gov.tutorial2.session7.owl (15)
More from Mustafa Jarrar (20)
Pal gov.tutorial2.session7.owl
- 1. أكاديمية الحكومة اإللكترونية الفلسطينية
The Palestinian eGovernment Academy
www.egovacademy.ps
Tutorial II: Data Integration and Open Information Systems
Session 7
OWL (Web Ontology Langauge)
Dr. Mustafa Jarrar
University of Birzeit
mjarrar@birzeit.edu
www.jarrar.info
PalGov © 2011 1
- 2. 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
Project Consortium:
Birzeit University, Palestine
University of Trento, Italy
(Coordinator )
Palestine Polytechnic University, Palestine Vrije Universiteit Brussel, Belgium
Palestine Technical University, Palestine
Université de Savoie, France
Ministry of Telecom and IT, Palestine
University of Namur, Belgium
Ministry of Interior, Palestine
TrueTrust, UK
Ministry of Local Government, Palestine
Coordinator:
Dr. Mustafa Jarrar
Birzeit University, P.O.Box 14- Birzeit, Palestine
Telfax:+972 2 2982935 mjarrar@birzeit.eduPalGov © 2011
2
- 3. © 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 3
- 4. Tutorial Map
Topic h
Intended Learning Objectives
Session 1: XML Basics and Namespaces 3
A: Knowledge and Understanding
Session 2: XML DTD’s 3
2a1: Describe tree and graph data models.
Session 3: XML Schemas 3
2a2: Understand the notation of XML, RDF, RDFS, and OWL.
Session 4: Lab-XML Schemas 3
2a3: Demonstrate knowledge about querying techniques for data
models as SPARQL and XPath. Session 5: RDF and RDFs 3
2a4: Explain the concepts of identity management and Linked data. Session 6: Lab-RDF and RDFs 3
2a5: Demonstrate knowledge about Integration &fusion of Session 7: OWL (Ontology Web Language) 3
heterogeneous data. Session 8: Lab-OWL 3
B: Intellectual Skills Session 9: Lab-RDF Stores -Challenges and Solutions 3
2b1: Represent data using tree and graph data models (XML & Session 10: Lab-SPARQL 3
RDF). Session 11: Lab-Oracle Semantic Technology 3
2b2: Describe data semantics using RDFS and OWL. Session 12_1: The problem of Data Integration 1.5
2b3: Manage and query data represented in RDF, XML, OWL. Session 12_2: Architectural Solutions for the Integration Issues 1.5
2b4: Integrate and fuse heterogeneous data. Session 13_1: Data Schema Integration 1
C: Professional and Practical Skills Session 13_2: GAV and LAV Integration 1
2c1: Using Oracle Semantic Technology and/or Virtuoso to store Session 13_3: Data Integration and Fusion using RDF 1
and query RDF stores. Session 14: Lab-Data Integration and Fusion using RDF 3
D: General and Transferable Skills
2d1: Working with team. Session 15_1: Data Web and Linked Data 1.5
2d2: Presenting and defending ideas. Session 15_2: RDFa 1.5
2d3: Use of creativity and innovation in problem solving.
2d4: Develop communication skills and logical reasoning abilities. Session 16: Lab-RDFa 3
PalGov © 2011 4
- 6. 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 Document Overview
http://www.w3.org/TR/owl2-overview/
OWL 2 Web Ontology Language: Structural Specification and
Functional-Style Syntax
http://www.w3.org/2007/OWL/draft/owl2-syntax
PalGov © 2011 6
- 7. What is OWL?
http://www.w3schools.com
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.
PalGov © 2011 7
- 8. OWL
Source: www.w3.org
PalGov © 2011 8
- 9. 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.
PalGov © 2011 9
- 10. 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.
PalGov © 2011 10
- 11. 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
PalGov © 2011 11
- 12. 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.
PalGov © 2011 12
- 13. 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
PalGov © 2011 13
- 14. 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
PalGov © 2011 14
- 15. 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.
PalGov © 2011 15
- 16. 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).
PalGov © 2011 16
- 17. 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).
PalGov © 2011 17
- 18. OWL Basics
• Classes
• Individuals
• Properties
• Special Classes and Properties
PalGov © 2011 18
- 19. 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
PalGov © 2011 19
- 20. 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.
PalGov © 2011 20
- 21. 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>
PalGov © 2011 21
- 22. 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>
PalGov © 2011 22
- 23. Special Classes and Properties
• Top class: T
owl:Thing
contains all individuals of the domain.
• Bottom class: ┴
owl:Nothing
contains no individuals(empty class).
• Universal property: U
owl:topObjectProperty
links every individual to every individual.
PalGov © 2011 23
- 24. Class Expression Axioms
• Subclass Axioms
• Equivalent Classes
• Disjoint Classes
• Disjoint Union of Class Expressions
PalGov © 2011 24
- 25. Class Expression Axioms
Subclass Axioms
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>
PalGov © 2011 25
- 26. 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.
PalGov © 2011 26
- 27. 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>
PalGov © 2011 27
- 28. 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>
PalGov © 2011 28
- 29. 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>
PalGov © 2011 29
- 30. 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.
...
<Class rdf:about="&OWL2Example1:Person“/>
<Class rdf:about="&OWL2Example1:Female">
<rdfs:subClassOf rdf:resource="&OWL2Example1:Person"/>
<disjointWith rdf:resource="&OWL2Example1:Male"/>
Person </Class>
<Class rdf:about="&OWL2Example1:Male">
<rdfs:subClassOf rdf:resource="&OWL2Example1:Person"/>
</Class>
<Class rdf:about="&OWL2Example1:Person">
<equivalentClass>
Male Female <Class>
<unionOf rdf:parseType="Collection">
<rdf:Description rdf:about="&OWL2Example1:Female"/>
<rdf:Description rdf:about="&OWL2Example1:Male"/>
</unionOf>
</Class>
<equivalentClass>
</Class>
… PalGov © 2011 30
- 31. 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
PalGov © 2011 31
- 32. 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>
PalGov © 2011 32
- 33. 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>
PalGov © 2011 33
- 34. 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>
PalGov © 2011 34
- 35. 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> PalGov © 2011 35
- 36. 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>
PalGov © 2011 36
- 37. 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>
PalGov © 2011 37
- 38. 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>
PalGov © 2011 38
- 39. 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>
PalGov © 2011 39
- 40. 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.
Drives DrivenBy
Gender Has Person Vehicle
Owns
... <ObjectProperty rdf:about="&OWL2Example2:Owns">
<Class rdf:about="&OWL2Example2:Person"/> <rdfs:domain rdf:resource="&OWL2Example2:Person"/>
<Class rdf:about="&OWL2Example2:Vehicle"/> <rdfs:range rdf:resource="&OWL2Example2:Vehicle"/>
<Class rdf:about="&OWL2Example2:Gender"/> </ObjectProperty>
<ObjectProperty rdf:about="&OWL2Example2:Drives"> <ObjectProperty rdf:about="&OWL2Example2:Owns">
<rdfs:domain rdf:resource="&OWL2Example2:Person"/> <rdfs:subPropertyOf rdf:resource="&OWL2Example2:Drives"/>
<rdfs:range rdf:resource="&OWL2Example2:Vehicle"/> </ObjectProperty>
</ObjectProperty> <ObjectProperty rdf:about="&OWL2Example2:Has">
<ObjectProperty rdf:about="&DrivenBy"> <rdf:type
<inverseOf rdf:resource="OWL2Example2:Drives"/> rdf:resource="http://www.w3.org/2002/07/owl#FunctionalPropert
</ObjectProperty> y"/>
</ObjectProperty>
…
PalGov © 2011 40
- 42. 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>
PalGov © 2011 42
- 43. 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>
PalGov © 2011 43
- 44. Assertions
Individual Inequality
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>
PalGov © 2011 44
- 45. 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>
PalGov © 2011 45
- 46. Class Expressions
• Intersection of Class Expressions
• Union of Class Expressions
• Complement of Class Expressions
• Enumeration of Individuals
PalGov © 2011 46
- 47. 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>
PalGov © 2011 47
- 48. 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>
PalGov © 2011 48
- 49. 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> PalGov © 2011 49
- 50. 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>
PalGov © 2011 50
- 51. Class Expressions
Object Property Restrictions
• Existential Quantification
• Universal Quantification
• Individual Value Restriction
• Self-Restriction
PalGov © 2011 51
- 52. 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>
PalGov © 2011 52
- 53. 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>
PalGov © 2011 53
- 54. 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>
…
PalGov © 2011 54
- 55. 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> …
PalGov © 2011 55
- 56. Class Expressions
Object Property Cardinality Restrictions
• Minimum Cardinality
• Maximum Cardinality
• Exact Cardinality
PalGov © 2011 56
- 57. Class Expressions
Object 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>
PalGov © 2011 57
- 58. Class Expressions
Object 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>
PalGov © 2011 58
- 59. Class Expressions
Object 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.
PalGov © 2011 59
- 60. Class Expressions
Object 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>
PalGov © 2011 60
- 61. 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>
PalGov © 2011 61
- 62. XML Datatypes
xsd:string xsd:int xsd:gYearMonth
xsd:normalizedString xsd:short xsd:gYear
xsd:boolean xsd:byte xsd:gMonthDay
xsd:decimal xsd:unsignedLong xsd:gDay
xsd:float xsd:unsignedInt xsd:gMonth
xsd:double xsd:unsignedShort xsd:anyURI
xsd:integer xsd:unsignedByte xsd:token
xsd:nonNegativeInteger xsd:hexBinary xsd:language
xsd:positiveInteger xsd:base64Binary xsd:NMTOKEN
xsd:nonPositiveInteger xsd:dateTime xsd:Name
xsd:negativeInteger xsd:time xsd:NCName
xsd:long xsd:date
The above datatypes, plus rdfs:Literal, form the built-in OWL datatypes.
PalGov © 2011 62
- 63. 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 63
- 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.
PalGov © 2011 64