Διδάσκων: Ν. Βασιλειάδης Αναπλ. Καθ. Τμ. Πληροφορικής...
Post on 23-Feb-2016
42 Views
Preview:
DESCRIPTION
TRANSCRIPT
ΤΜΗΜΑ ΠΛΗΡΟΦΟΡΙΚΗΣ, ΑΠΘ ΜΕΤΑΠΤΥΧΙΑΚΟ ΠΡΟΓΡΑΜΜΑ ΣΠΟΥΔΩΝ
Κατεύθυνση Πληροφοριακών Συστημάτων - 1ο Εξάμηνο
Σημασιολογικός Ιστόςlpis.csd.auth.gr/mtpx/sw/index.htm
Διδάσκων: Ν. ΒασιλειάδηςΑναπλ. Καθ. Τμ. Πληροφορικής ΑΠΘ
Μαθήματα: 6b-7-8
Chapter 4Web Ontology Language: OWL
Grigoris AntoniouFrank van Harmelen
Chapter 4 A Semantic Web Primer, 2nd Edition4-3
Lecture Outline
1. Basic Ideas of OWL 2. The OWL Language3. Examples4. The OWL Namespace5. Future Extensions
Chapter 4 A Semantic Web Primer, 2nd Edition4-4
Expressivity of RDF/RDFS
The expressivity of RDF and RDF Schema is deliberately very limited– RDF is limited to binary ground predicates– RDF Schema is limited to a subclass hierarchy and
a property hierarchy, with domain and range definitions of these properties
The Web Ontology Working Group of W3C identified some characteristic use-cases for the Semantic Web that require much more expressiveness than RDF and RDF Schema.
Chapter 4 A Semantic Web Primer, 2nd Edition4-5
Need for More Powerful Language
Researchers identified the need for a more powerful ontology modeling language.
Initiative to define a richer language DAML+OIL– Join of the U.S. proposal DAML-ONT and the
European language OIL DAML+OIL was the starting point for the
definition of the language OWL – Aimed to be the standardized and broadly accepted
ontology language of the Semantic Web
Chapter 4 A Semantic Web Primer, 2nd Edition4-6
Requirements for Ontology Languages
Ontology languages allow users to write explicit, formal conceptualizations of domain models
The main requirements are:– a well-defined syntax – efficient reasoning support – a formal semantics – sufficient expressive power – convenience of expression
Chapter 4 A Semantic Web Primer, 2nd Edition4-7
Well-Defined Syntax
It is a necessary condition for machine-processing of information
OWL builds upon RDF and RDFS and has the same kind of syntax
The XML-based RDF syntax is not user-friendly– This drawback is not very significant because users
will develop their ontologies using authoring or ontology development tools, instead of writing them directly in OWL.
Chapter 4 A Semantic Web Primer, 2nd Edition4-8
Formal Semantics
A formal semantics describes precisely the meaning of knowledge.
The semantics does not refer to subjective intuitions
The semantics is not open to different interpretations by different people (or machines)
One use of a formal semantics is to allow people to reason about the knowledge.
Chapter 4 A Semantic Web Primer, 2nd Edition4-9
Tradeoff between Expressive Power and Efficient Reasoning Support
The richer the language is, the more inefficient the reasoning support becomes
Sometimes it crosses the border of noncomputability
We need a compromise:– A language supported by reasonably efficient
reasoners – A language that can express large classes of
ontologies and knowledge.
Chapter 4 A Semantic Web Primer, 2nd Edition4-10
Reasoning About Knowledge in Ontology Languages
Equivalence of classes – If class A is equivalent to class B, and class B is
equivalent to class C, then A is equivalent to C, too– If class A is subclass of B, B subclass of C and C
subclass of A, then A, B, C are equivalent to each other Class membership
– If x is an instance of a class C, and C is a subclass of D, then we can infer that x is an instance of D
– If C and D are equivalent classes, then if x is an instance C, then it is also an instance of D, and vice versa
Chapter 4 A Semantic Web Primer, 2nd Edition4-11
Reasoning About Knowledge in Ontology Languages (2)
Consistency– X instance of classes A and B, but A and B are disjoint– X is an instance of both A and complement of A– This is an indication of an error in the ontology
Classification– Certain property-value pairs are a sufficient condition
for membership in a class A FirstYearCourses are Courses with Year=1
– If an individual x satisfies such conditions, we can conclude that x must be an instance of A
Chapter 4 A Semantic Web Primer, 2nd Edition4-12
Uses for Reasoning
Reasoning support is important for– checking consistency of ontology and knowledge– checking for unintended relationships between
classes– automatically classifying instances in classes
Checks like the preceding ones are valuable for – designing large ontologies, where multiple authors
are involved– integrating - sharing ontologies from various sources
Chapter 4 A Semantic Web Primer, 2nd Edition4-13
Reasoning Support for OWL
Semantics is a prerequisite for reasoning support Formal semantics and reasoning support are usually
provided by – mapping an ontology language to a known logical formalism– using automated reasoners that already exist for those
formalisms OWL is (partially) mapped on a description logic, and
makes use of reasoners such as FaCT and RACER Description logics are a subset of predicate logic for
which efficient reasoning support is possible
Chapter 4 A Semantic Web Primer, 2nd Edition4-14
Limitations of the Expressive Power of RDF Schema
Local scope of properties – rdfs:range defines the range of a property (e.g.
eats) for all classes – In RDF Schema we cannot declare range
restrictions that apply to some classes only E.g. we cannot say that cows eat only plants, while other
animals may eat meat, too E.g. we cannot say that postgraduate students attend only
postgraduate courses, whereas students in general can attend courses
Chapter 4 A Semantic Web Primer, 2nd Edition4-15
Limitations of the Expressive Power of RDF Schema (2)
Disjointness of classes– Sometimes we wish to say that classes are disjoint
(e.g. male and female) Boolean combinations of classes
– Sometimes we wish to build new classes by combining other classes using union, intersection, and complement
– E.g. person is the disjoint union of the classes male and female
Chapter 4 A Semantic Web Primer, 2nd Edition4-16
Limitations of the Expressive Power of RDF Schema (3)
Cardinality restrictions– E.g. a person has exactly two parents, a course is
taught by at least one lecturer Special characteristics of properties
– Transitive property (like “greater than”)– Unique property (like “is mother of”)– A property is the inverse of another property
E.g. “eats” and “is eaten by” E.g. “teaches” and “is-taught-by”
Chapter 4 A Semantic Web Primer, 2nd Edition4-17
Combining OWL with RDF Schema
Ideally, OWL would extend RDF Schema– Consistent with the layered architecture of the
Semantic Web But simply extending RDF Schema would
work against obtaining expressive power and efficient reasoning – Combining RDF Schema with logic leads to
uncontrollable computational properties
Chapter 4 A Semantic Web Primer, 2nd Edition4-18
Three Species of OWL
W3C’s Web Ontology Working Group defined OWL as 3 different sublanguages:– OWL Full– OWL DL– OWL Lite
Each sublanguage geared toward fulfilling different aspects of requirements
Chapter 4 A Semantic Web Primer, 2nd Edition4-19
OWL Full
It uses all the OWL languages primitives It allows the combination of these primitives in arbitrary
ways with RDF and RDF Schema OWL Full is fully upward-compatible with RDF, both
syntactically and semantically– Any legal RDF document is also a legal OWL Full document– Any valid RDF/RDF Schema conclusion is also a valid OWL
Full conclusion OWL Full is so powerful that it is undecidable
– No complete (or efficient) reasoning support
Chapter 4 A Semantic Web Primer, 2nd Edition4-20
OWL DL
OWL DL (Description Logic) is a sublanguage of OWL Full that restricts application of the constructors from OWL and RDF– Application of OWL’s constructors to each other is disallowed– Therefore it corresponds to a well studied description logic
OWL DL permits efficient reasoning support But we lose full compatibility with RDF:
– Not every RDF document is a legal OWL DL document. – Every legal OWL DL document is a legal RDF document.
Chapter 4 A Semantic Web Primer, 2nd Edition4-21
OWL Lite
An even further restriction limits OWL DL to a subset of the language constructors– E.g., OWL Lite excludes enumerated classes,
disjointness statements, and arbitrary cardinality. The advantage of this is a language that is
easier to– grasp, for users– implement, for tool builders
The disadvantage is restricted expressivity
Chapter 4 A Semantic Web Primer, 2nd Edition4-22
Comparison of OWL Sublanguages
Ontology developers adopting OWL should consider which sublanguage best suits their needs.
Choice between OWL Lite - OWL DL:– Do we need the more expressive constructs provided by OWL
DL? Choice between OWL DL - OWL Full:
– Do we need the meta-modeling facilities of RDF Schema?– E.g. defining classes of classes, attaching properties to classes. – In OWL Full reasoning support is less predictable than OWL DL,
because complete OWL Full implementations are impossible
Chapter 4 A Semantic Web Primer, 2nd Edition4-23
OWL Compatibility with RDF Schema
All varieties of OWL use RDF for their syntax
Instances are declared as in RDF, using RDF descriptions and typing information
OWL constructors are specialisations of their RDF counterparts
Chapter 4 A Semantic Web Primer, 2nd Edition4-24
Lecture Outline
1. Basic Ideas of OWL 2. The OWL Language3. Examples4. The OWL Namespace5. Future Extensions
Chapter 4 A Semantic Web Primer, 2nd Edition4-25
OWL Syntactic Varieties
OWL uses the RDF/XML syntax Other syntactic forms for OWL :
– An alternative, more readable XML syntax (OWL/XML)
– Functional syntax: much more compact and readable than the XML languages
– Manchester Syntax: designed to be as human-readable as possible. Used in the user interface of most ontology editors (e.g. Protégé)
Chapter 4 A Semantic Web Primer, 2nd Edition4-26
OWL XML/RDF Syntax: Header
<rdf:RDFxmlns:owl ="http://www.w3.org/2002/07/owl#"xmlns:rdf ="http://www.w3.org/1999/02/22-rdf-syntax-ns#"xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"xmlns:xsd ="http://www.w3.org/2001/XLMSchema#">
An OWL ontology may start with a collection of assertions for housekeeping purposes using owl:Ontology element
Chapter 4 A Semantic Web Primer, 2nd Edition4-27
owl:Ontology
<owl:Ontology rdf:about=""><rdfs:comment>An example OWL ontology
</rdfs:comment><owl:priorVersion
rdf:resource="http://www.mydomain.org/uni-ns-old"/><owl:imports
rdf:resource="http://www.mydomain.org/persons"/><rdfs:label>University Ontology</rdfs:label>
</owl:Ontology>
owl:imports is a transitive property
Functional OWL Syntax
Ontology(Annotation(rdfs:comment "An example OWL
ontology")Annotation(rdfs:label "University Ontology")Annotation(owl:imports http://www.mydomain.org/persons)
)
Chapter 4 A Semantic Web Primer, 2nd Edition4-28
Chapter 4 A Semantic Web Primer, 2nd Edition4-29
Imported Ontologies
While namespaces are used for disambiguation purposes, imported ontologies provide definitions that can be used
Usually there will be an import element for each namespace used, but it is possible to import additional ontologies
Chapter 4 A Semantic Web Primer, 2nd Edition4-30
Classes
Classes are defined using owl:Class– owl:Class is a subclass of rdfs:Class
<owl:Class rdf:ID=“AssociateProfessor"><rdfs:subClassOf
rdf:resource="#AcademicStaffMember"/></owl:Class>
Chapter 4 A Semantic Web Primer, 2nd Edition4-31
Class Disjointness
Disjointness is defined using owl:disjointWith
<owl:Class rdf:about="#AssociateProfessor"><owl:disjointWith rdf:resource="#Professor"/><owl:disjointWith rdf:resource="#AssistantProfessor"/>
</owl:Class>
Chapter 4 A Semantic Web Primer, 2nd Edition4-32
Class Equivalence
owl:equivalentClass defines equivalence of classes
<owl:Class rdf:ID=“Faculty"><owl:equivalentClass
rdf:resource="#AcademicStaffMember"/></owl:Class>
Functional OWL Syntax
Declaration(Class(<#AcademicStaffMember>))Declaration(Class(<#AssociateProfessor>))Declaration(Class(<#Professor>))SubClassOf(<#AssociateProfessor>
<#AcademicStaffMember>)Declaration(Class(<#Faculty>))EquivalentClasses(<#Faculty>
<#AcademicStaffMember>)DisjointClasses(<#AssistantProfessor>
<#AssociateProfessor>)DisjointClasses(<#AssociateProfessor>
<#Professor>)Chapter 4 A Semantic Web Primer, 2nd Edition4-33
Manchester Syntax
Class: uni:Professor DisjointWith: uni:AssociateProfessorClass: uni:AssistantProfessorClass: uni:AssociateProfessor SubClassOf: uni:AcademicStaffMember DisjointWith: uni:Professor, uni:AssistantProfessorClass: uni:AcademicStaffMember EquivalentTo: uni:Faculty4-34 Chapter 4 A Semantic Web Primer, 2nd Edition
Chapter 4 A Semantic Web Primer, 2nd Edition4-35
owl:Thing and owl:Nothing
Predefined classes owl:Thing is the most general class, which
contains everything owl:Nothing is the empty class Εvery class is a subclass of owl:Thing and a
superclass of owl:Nothing.
Chapter 4 A Semantic Web Primer, 2nd Edition4-36
Properties
In OWL there are two kinds of properties Object properties, which relate objects to
other objects– E.g. is-TaughtBy, supervises
Data type properties, which relate objects to datatype values– E.g. phone, title, age, etc.
Chapter 4 A Semantic Web Primer, 2nd Edition4-37
Datatype Properties
OWL makes use of XML Schema data types, using the layered architecture of the SW
<owl:DatatypeProperty rdf:ID="age"><rdfs:range
rdf:resource=“&xsd;nonNegativeInteger”/></owl:DatatypeProperty>
Chapter 4 A Semantic Web Primer, 2nd Edition4-38
Object Properties
User-defined data types
<owl:ObjectProperty rdf:ID="isTaughtBy"><rdfs:domain rdf:resource="#Course"/><rdfs:range
rdf:resource="#AcademicStaffMember"/><rdfs:subPropertyOf rdf:resource="#involves"/>
</owl:ObjectProperty>
Multiple domains/ranges
More than 1domain and range may be declared The intersection of the domains (ranges) is
taken.<owl:DatatypeProperty rdf:ID=“name">
<rdfs:domain rdf:resource=“#Customer”/><rdfs:domain rdf:resource=“#Employee”/>
</owl:DatatypeProperty>
Chapter 4 A Semantic Web Primer, 2nd Edition4-39
Multiple domains/ranges in Protégé
… BUT in Protégé multiple domains / ranges mean UNION
Chapter 4 A Semantic Web Primer, 2nd Edition4-40
Multiple domains / ranges in Protégé
Chapter 4 A Semantic Web Primer, 2nd Edition4-41
<owl:DatatypeProperty rdf:ID="name"> <rdf:type rdf:resource="&owl;FunctionalProperty"/> <rdfs:domain> <owl:Class> <owl:unionOf rdf:parseType="Collection"> <owl:Class rdf:about="#Customer"/> <owl:Class rdf:about="#Employee"/> </owl:unionOf> </owl:Class> </rdfs:domain> <rdfs:range rdf:resource="&xsd;string"/> </owl:DatatypeProperty>
Chapter 4 A Semantic Web Primer, 2nd Edition4-42
Inverse Properties
<owl:ObjectProperty rdf:ID="teaches"><rdfs:range rdf:resource="#Course"/><rdfs:domain
rdf:resource="#AcademicStaffMember"/><owl:inverseOf rdf:resource="#isTaughtBy"/>
</owl:ObjectProperty> Domain and range can be inherited from the inverse
property – Interchange domain with range.
l c
teaches
isTaughtBy
Chapter 4 A Semantic Web Primer, 2nd Edition4-43
Equivalent Properties
<owl:ObjectProperty rdf:ID="lecturesIn"><owl:equivalentProperty
rdf:resource="#teaches"/></owl:ObjectProperty>
Functional OWL Syntax (1)
Declaration(DataProperty(<#age>))DataPropertyRange(<#age>
<http://www.w3.org/2001/XMLSchema#nonNegativeInteger>)
Declaration(ObjectProperty(<#isTaughtBy>))SubObjectPropertyOf(<#isTaughtBy> <#involves>)ObjectPropertyDomain(<#isTaughtBy> <#Course>)ObjectPropertyRange(<#isTaughtBy>
<#AcademicStaffMember>)InverseObjectProperties(<#teaches> <#isTaughtBy>)
Chapter 4 A Semantic Web Primer, 2nd Edition4-44
Functional OWL Syntax (2)
Declaration(ObjectProperty(<#lecturesIn>))EquivalentObjectProperties(<#lecturesIn> <#teaches>)Declaration(ObjectProperty(<#teaches>))EquivalentObjectProperties(<#teaches> <#lecturesIn>)InverseObjectProperties(<#teaches> <#isTaughtBy>)ObjectPropertyDomain(<#teaches>
<#AcademicStaffMember>)ObjectPropertyRange(<#teaches> <#Course>)
Chapter 4 A Semantic Web Primer, 2nd Edition4-45
Manchester Syntax
4-46
DataProperty: uni:age Range: <http://... #nonNegativeInteger>
ObjectProperty: uni:isTaughtBy SubPropertyOf: uni:involvesCharacteristics: FunctionalDomain: uni:CourseRange: uni:AcademicStaffMemberInverseOf: uni:teaches
ObjectProperty: uni:teachesEquivalentTo: uni:lecturesInDomain: uni:AcademicStaffMemberRange: uni:CourseInverseOf: uni:isTaughtBy
ObjectProperty: uni:lecturesIn EquivalentTo: uni:teaches
Chapter 4 A Semantic Web Primer, 2nd Edition4-47
Property Restrictions
In OWL we can declare that the class C satisfies certain conditions– All instances of C satisfy the conditions
This is equivalent to saying that C is subclass of a class C', where C' collects all objects that satisfy the conditions– C' can remain anonymous
Explanation of Restrictions
If an object x belongs to a class C, then it satisfies the restriction R– xC R(x)– Necessary condition (if an object belongs to a class,
then it necessarily satisfies the restriction) Let R be the class of all objects that satisfy R
– This includes necessarily all objects of class C and possibly other objects
– Thus, CR (C subclass of R)
Chapter 4 A Semantic Web Primer, 2nd Edition4-48
Necessary Restrictions
4-49
Objects that belong to class C
All Objects that satisfy the restriction R
R(x)
C
Chapter 4 A Semantic Web Primer, 2nd Edition
Explanation of Restrictions (2) If class R includes objects ONLY of class C, this means
that there are not objects that satisfy the restriction other than objects of class C– Classes R and C contain exactly the same objects– They are equivalent (C≡R CR RC)
Additional condition: If an object x belongs to a class R (i.e. it satisfies the restriction R), then it must belong to class C (since C and R are equivalent)– R(x) xC– Sufficient condition (if an object satisfies the restriction, then
this is sufficient to belong to the class)Chapter 4 A Semantic Web Primer, 2nd Edition4-50
Necessary & Sufficient Restrictions
4-51
Objects that belong to class C
All Objects that satisfy the restriction R
R(x) C
Chapter 4 A Semantic Web Primer, 2nd Edition
Chapter 4 A Semantic Web Primer, 2nd Edition4-52
Property Restrictions (2)
A (restriction) class is achieved through an owl:Restriction element
This element contains an owl:onProperty element and one or more restriction declarations
One type of restriction declarations defines cardinality restrictions (at least 1, at most 3, etc.)
Chapter 4 A Semantic Web Primer, 2nd Edition4-53
Property Restrictions (3)
The other type defines restrictions on the kinds of values the property may take– owl:allValuesFrom specifies universal
quantification – owl:hasValue specifies a specific value – owl:someValuesFrom specifies existential
quantification
Chapter 4 A Semantic Web Primer, 2nd Edition4-54
owl:allValuesFrom
<owl:Class rdf:about="#FirstYearCourse"><rdfs:subClassOf> <owl:Restriction>
<owl:onProperty rdf:resource="#isTaughtBy"/><owl:allValuesFrom
rdf:resource="#Professor"/> </owl:Restriction></rdfs:subClassOf>
</owl:Class>
First-year courses are taught by professors only
First-year courses
Courses taught by Professors
Chapter 4 A Semantic Web Primer, 2nd Edition4-55
owl:hasValue
<owl:Class rdf:about="#MathCourse"><rdfs:subClassOf>
<owl:Restriction><owl:onProperty
rdf:resource="#isTaughtBy"/><owl:hasValue
rdf:resource="#T949352"/></owl:Restriction>
</rdfs:subClassOf></owl:Class>
Mathematics courses are taught by David Billington
Mathematics courses
Courses taught by David Billington
Chapter 4 A Semantic Web Primer, 2nd Edition4-56
owl:someValuesFrom
<owl:Class rdf:about="#AcademicStaffMember"><rdfs:subClassOf> <owl:Restriction>
<owl:onProperty rdf:resource="#teaches"/>
<owl:someValuesFrom rdf:resource= "#UndergraduateCourse"/>
</owl:Restriction></rdfs:subClassOf>
</owl:Class>
All academic staff mem-bers must teach at least 1 undergraduate course
academic staff members
“People” that teach at least 1 undergraduate course
Chapter 4 A Semantic Web Primer, 2nd Edition4-57
Cardinality Restrictions
We can specify minimum and maximum number using owl:minCardinality and owl:maxCardinality
It is possible to specify a precise number by using the same minimum and maximum number
For convenience, OWL offers also owl:cardinality
Chapter 4 A Semantic Web Primer, 2nd Edition4-58
Cardinality Restrictions (2)
<owl:Class rdf:about="#Course"><rdfs:subClassOf>
<owl:Restriction><owl:onProperty
rdf:resource="#isTaughtBy"/><owl:minCardinality
rdf:datatype= "&xsd;nonNegativeInteger">1
</owl:minCardinality></owl:Restriction>
</rdfs:subClassOf></owl:Class>
Every course must be taught by at least someone
Courses
“Things” taught by at least someone
4-59
Cardinality Restrictions (3)
<owl:Class rdf:about="#Department"><rdfs:subClassOf><owl:Restriction><owl:onProperty rdf:resource="#hasMember"/><owl:minCardinality rdf:datatype="&xsd;nonNegativeInteger">10 </owl:minCardinality></owl:Restriction></rdfs:subClassOf><rdfs:subClassOf><owl:Restriction><owl:onProperty rdf:resource="#hasMember"/><owl:maxCardinality rdf:datatype="&xsd;nonNegativeInteger">30 </owl:maxCardinality></owl:Restriction></rdfs:subClassOf>
</owl:Class>
Α department must have at least 10 and at most 30 members
Cardinality Restrictions (4)
Chapter 4 A Semantic Web Primer, 2nd Edition4-60
Departments
“Things” that have at most 30 members
“Things” that have at least 10 members
Chapter 4 A Semantic Web Primer, 2nd Edition4-61
Restriction Conclusions
owl:Restriction defines an anonymous class – Has no ID– Is not defined by owl:Class– Has only local scope
It can only be used where the restriction appears. Classes have a twofold meaning:
– Classes, defined by owl:Class with an ID– Local anonymous classes, defined as collections of
objects that satisfy restriction conditions, or as combinations of other classes
Class expressions
Functional OWL Syntax (1)
Declaration(Class(<#FirstYearCourse>))SubClassOf(<#FirstYearCourse>
ObjectAllValuesFrom(<#isTaughtBy> <#Professor>))Declaration(Class(<#MathCourse>))SubClassOf(<#MathCourse>
ObjectHasValue(<#isTaughtBy> <#T949352>))SubClassOf(<#AcademicStaffMember>
ObjectSomeValuesFrom(<#teaches> <#UndergraduateCourse>))
Chapter 4 A Semantic Web Primer, 2nd Edition4-62
Abstract OWL Syntax (2)
Declaration(Class(<#Course>))SubClassOf(<#Course> ObjectMinCardinality(1
<#isTaughtBy>))Declaration(Class(<#Department>))SubClassOf(<#Department> DataMinCardinality(10
<#hasMember>))SubClassOf(<#Department> DataMaxCardinality(30
<#hasMember>))
Chapter 4 A Semantic Web Primer, 2nd Edition4-63
Manchester Syntax
Class: uni:FirstYearCourse SubClassOf: uni:isTaughtBy only uni:ProfessorClass: uni:MathCourse SubClassOf: uni:isTaughtBy value uni:T949352Class: uni:AcademicStaffMember SubClassOf: uni:teaches some uni:UndergraduateCourse4-64
Manchester Syntax
Class: uni:Course SubClassOf: uni:isTaughtBy min 1 owl:ThingClass: uni:Department SubClassOf: uni:hasMember min 10 rdfs:Literal, uni:hasMember max 30 rdfs:Literal
4-65
Chapter 4 A Semantic Web Primer, 2nd Edition4-66
Special Properties owl:TransitiveProperty (transitive property)
– E.g. “is part of”, “is ancestor of” owl:SymmetricProperty (symmetry)
– E.g. “has same hight as”, “is sibling of” owl:FunctionalProperty defines a property
that has at most one value for each object– E.g. “age”, “height”, “directSupervisor”
owl:InverseFunctionalProperty defines a property for which 2 different objects cannot have the same value
4-67
Special Properties (2)<owl:ObjectProperty rdf:ID="hasSameGradeAs">
<rdf:type rdf:resource="&owl;TransitiveProperty"/>
<rdf:type rdf:resource="&owl;SymmetricProperty"/>
<rdfs:domain rdf:resource="#Student"/><rdfs:range rdf:resource="#Student"/>
</owl:ObjectProperty>Declaration(ObjectProperty(<#hasSameGradeAs>))SymmetricObjectProperty(<#hasSameGradeAs>)TransitiveObjectProperty(<#hasSameGradeAs>)ObjectPropertyDomain(<#hasSameGradeAs> <#Student>)ObjectPropertyRange(<#hasSameGradeAs> <#Student>)
Manchester Syntax
ObjectProperty: uni:hasSameGradeAs Characteristics: Symmetric, Transitive Domain: uni:Student Range: uni:Student
4-68
Functional Properties
If a property is functional, for a given individual, there can only be at most one individual to be related via this property.– For a given domain, range must be unique
Functional properties are also known as single valued properties.
Chapter 4 A Semantic Web Primer, 2nd Edition4-69
Inverse Functional Properties
If a property is inverse functional, then its inverse property is functional.– For a given range, domain must be unique.
Chapter 4 A Semantic Web Primer, 2nd Edition4-70
Functional vs. inverse functional properties
domain range example
FunctionalProperty
For a given domain
Range is unique
hasFather: A hasFather B, A hasFather C
B=C
InverseFunctionalProperty
Domain is unique
For a given range
hasID: A hasID B, C hasID B
A=C
Chapter 4 A Semantic Web Primer, 2nd Edition4-71
Transitive Properties
If a property is transitive, and the property related individual a to individual b, and also individual b to individual c, then we can infer that individual a is related to individual c via property P.
Chapter 4 A Semantic Web Primer, 2nd Edition4-72
Symmetric Properties
If a property P is symmetric, and the property relates individual a to individual b, then individual b is also related to individual a via property P.
Chapter 4 A Semantic Web Primer, 2nd Edition4-73
Chapter 4 A Semantic Web Primer, 2nd Edition4-74
Boolean Combinations
We can combine classes using Boolean operations (union, intersection, complement)
<owl:Class rdf:about="#Course"><rdfs:subClassOf><owl:Class><owl:complementOf
rdf:resource="#StaffMember"/></owl:Class></rdfs:subClassOf>
</owl:Class>
Courses and staff members are disjoint
StaffMember
__________StaffMember
Course
Alternative expression
<owl:Class rdf:about="#Course"><owl:disjointWith
rdf:resource="#StaffMember"/></owl:Class> Actually, owl:complementOf is a sub-property of
owl:disjointWith – Whenever two classes are complement of each other,
they are definitely disjoint, but not the other way around
Chapter 4 A Semantic Web Primer, 2nd Edition4-75
Example of complement with equivalence
<owl:Class rdf:about=”Male”><owl:complementOf rdfs:resource=”Female”/>
</owl:Class>
The complement of Male is “exactly” the class Female and vice-versa
Chapter 4 A Semantic Web Primer, 2nd Edition4-76
Chapter 4 A Semantic Web Primer, 2nd Edition4-77
Boolean Combinations (2)
<owl:Class rdf:ID=“PeopleAtUni"><owl:unionOf rdf:parseType="Collection">
<owl:Class rdf:about="#StaffMember"/><owl:Class rdf:about="#Student"/>
</owl:unionOf></owl:Class>
The new class is not a subclass of the union, but rather equal to the union– We have stated an equivalence of classes
StaffMember Student
PeopleAtUni
Chapter 4 A Semantic Web Primer, 2nd Edition4-78
Boolean Combinations (3)
<owl:Class rdf:ID=“FacultyInCS"><owl:intersectionOf rdf:parseType="Collection">
<owl:Class rdf:about="#Faculty"/><owl:Restriction>
<owl:onProperty rdf:resource="#belongsTo"/>
<owl:hasValue rdf:resource="#CSDepartment"/>
</owl:Restriction></owl:intersectionOf>
</owl:Class>
Faculty belongsTo CSDepartment
FacultyInCS
4-79
Nesting of Boolean Operators
<owl:Class rdf:ID=“AdminStaff"><owl:intersectionOf rdf:parseType="Collection"><owl:Class rdf:about="#StaffMember"/><owl:Class><owl:complementOf><owl:Class><owl:unionOf rdf:parseType="Collection"><owl:Class rdf:about="#Faculty"/><owl:Class rdf:about="#TechSupportStaff"/></owl:unionOf></owl:Class></owl:complementOf></owl:Class></owl:intersectionOf>
</owl:Class>
Administrative staff is those staff members that are neither faculty nor technical support staff
Illustration of Nesting of Boolean Operators
Chapter 4 A Semantic Web Primer, 2nd Edition4-80
StaffMember
TechSup-portStaff Faculty
unionOf
_______unionOf
AdminStaff
Functional OWL Syntax (1)
SubClassOf(<#Course> ObjectComplementOf(<#StaffMember>))
Declaration(Class(<#PeopleAtUni>))EquivalentClasses(<#PeopleAtUni>
ObjectUnionOf(<#Student> <#StaffMember>))Declaration(Class(<#FacultyInCS>))EquivalentClasses(<#FacultyInCS>
ObjectIntersectionOf(ObjectHasValue(<#belongsTo> <#CSDepartment>) <#Faculty>))
Chapter 4 A Semantic Web Primer, 2nd Edition4-81
Functional OWL Syntax (2)
Declaration(Class(<#AdminStaff>))EquivalentClasses(<#AdminStaff>
ObjectIntersectionOf(ObjectComplementOf(
ObjectUnionOf(<#TechSupportStaff> <#Faculty>)
) <#StaffMember>
))
Chapter 4 A Semantic Web Primer, 2nd Edition4-82
Manchester Syntax
Class: uni:PeopleAtUni EquivalentTo: uni:StaffMember or uni:StudentClass: uni:FacultyInCS EquivalentTo: uni:Faculty and (uni:belongsTo value uni:CSDepartment)Class: uni:AdminStaff EquivalentTo: uni:StaffMember and (not (uni:Faculty or uni:TechSupportStaff))4-83
4-84
Enumerations with owl:oneOf
Define a class by listing all its elements
<owl:Class rdf:ID="WeekDay"><owl:oneOf rdf:parseType="Collection"><owl:Thing rdf:about="#Monday"/><owl:Thing rdf:about="#Tuesday"/><owl:Thing rdf:about="#Wednesday"/><owl:Thing rdf:about="#Thursday"/><owl:Thing rdf:about="#Friday"/><owl:Thing rdf:about="#Saturday"/><owl:Thing rdf:about="#Sunday"/></owl:oneOf>
</owl:Class>
Functional OWL Syntax
Declaration(Class(<#WeekDay>))EquivalentClasses(<#WeekDay>
ObjectOneOf(<#Saturday> <#Monday> <#Wednesday> <#Friday> <#Sunday> <#Tuesday> <#Thursday>))
ClassAssertion(owl:Thing <#Friday>)ClassAssertion(owl:Thing <#Monday>)ClassAssertion(owl:Thing <#Saturday>)ClassAssertion(owl:Thing <#Sunday>)ClassAssertion(owl:Thing <#Thursday>)ClassAssertion(owl:Thing <#Tuesday>)ClassAssertion(owl:Thing <#Wednesday>)4-85
Chapter 4 A Semantic Web Primer, 2nd Edition4-86
Declaring Instances
Instances of classes are declared as in RDF:
<rdf:Description rdf:ID="T949352"><rdf:type rdf:resource="#AcademicStaffMember"/>
</rdf:Description>
<AcademicStaffMember rdf:ID="T949352"><uni:age rdf:datatype="&xsd;integer"> 39</uni:age>
</AcademicStaffMember>
Chapter 4 A Semantic Web Primer, 2nd Edition4-87
No Unique-Names Assumption
OWL does not adopt the unique-names assumption of database systems– If two instances have a different name or ID does
not imply that they are different individuals Suppose we state that each course is taught
by at most one staff member, and that a given course is taught by two staff members – An OWL reasoner does not flag an error – Instead it infers that the two resources are equal
No Unique-Names AssumptionExample
<owl:ObjectProperty rdf:ID="isTaughtBy"><rdf:type rdf:resource="&owl;FunctionalProperty"/>
</owl:ObjectProperty>
<Course rdf:ID="CIT1111"><isTaughtBy rdf:resource="#T949318"/><isTaughtBy rdf:resource="#T949352"/>
</Course>
Chapter 4 A Semantic Web Primer, 2nd Edition4-88
Chapter 4 A Semantic Web Primer, 2nd Edition4-89
Distinct Objects
To ensure that different individuals are indeed recognized as such, we must explicitly assert their inequality:
<Lecturer rdf:about=“#T949318"><owl:differentFrom rdf:resource=“#T949352"/>
</Lecturer>
Chapter 4 A Semantic Web Primer, 2nd Edition4-90
Distinct Objects (2)
OWL provides a shorthand notation to assert the pairwise inequality of all individuals in a given list
<owl:allDifferent><owl:distinctMembers rdf:parseType="Collection">
<Lecturer rdf:about=“#T949318"/><Lecturer rdf:about=“#T949352"/><Lecturer rdf:about=“#T949111"/>
</owl:distinctMembers></owl:allDifferent>
owl:sameAs
Links an individual to an individual. – Indicates that two URI references actually refer to the
same thing: the individuals have the same "identity". For individuals such as "people" this notion is
relatively easy to understand. – E.g. the following 2 URIs actually refer to the same
person<rdf:Description rdf:about="#William_Jefferson_Clinton"> <owl:sameAs rdf:resource="#BillClinton"/></rdf:Description>
A Semantic Web Primer, 2nd Edition4-91 Chapter 4
Use of owl:sameAs (1/2)
owl:sameAs statements can be used to define mappings between ontologies.
It is unrealistic to assume everybody will use the same name to refer to individuals. – That would require some “grand design”, which is contrary to the
spirit of the web. In OWL Full, where classes can be treated as instances, we
can use owl:sameAs to define class equality– Two concepts have the same intentional meaning.
<owl:Class rdf:ID="FootballTeam"> <owl:sameAs rdf:resource="http://sports.org/US#SoccerTeam"/></owl:Class> A Semantic Web Primer, 2nd Edition4-92 Chapter 4
Use of owl:sameAs (2/2)
This could be part of a European sports ontology. – The two classes are treated as individuals, instances of
owl:Class. – This allows to state that FootballTeam in some
European sports ontology denotes the same concept as SoccerTeam in some American sports ontology.
There is difference with the statement:<FootballTeam owl:equivalentClass us:SoccerTeam />
– States that the 2 classes have the same class extension, but are not (necessarily) the same concepts.
A Semantic Web Primer, 2nd Edition4-93 Chapter 4
Functional OWL Syntax
ClassAssertion(uni:AcademicStaffMember uni:T949352)DataPropertyAssertion(uni:age uni:T949352
"39"^^<http://www.w3.org/2001/XMLSchema#integer>)FunctionalObjectProperty(uni:isTaughtBy)ClassAssertion(uni:Course uni:CIT1111)ObjectPropertyAssertion(uni:isTaughtBy uni:CIT1111 uni:
T949352)ObjectPropertyAssertion(uni:isTaughtBy uni:CIT1111
uni:T949318)DifferentIndividuals(uni:T949352 uni:T949318)DifferentIndividuals(uni:T949111 uni:T949318 uni:T949352)SameIndividual(William_Jefferson_Clinton BillClinton)
4-94
Manchester Syntax
Individual: uni:T949352 Types: uni:AcademicStaffMember Facts: uni:age 39 DifferentFrom: uni:T949318Individual: uni:CIT1111 Types: uni:course Facts: uni:isTaughtBy uni:T949352, uni:isTaughtBy uni:T949318DifferentIndividuals: uni:T949111,uni:T949318,uni:T9493524-95
Individual: uni:William_Jefferson_Clinton SameAs: uni:BillClinton
Chapter 4 A Semantic Web Primer, 2nd Edition4-96
Data Types in OWL
XML Schema provides a mechanism to construct user-defined data types – E.g., the data type of adultAge includes all integers
greater than 18 Derived data types cannot be used in OWL 1
– The OWL reference document lists all the XML Schema data types that can be used
– These include the most frequently used types such as string, integer, Boolean, time, and date.
Chapter 4 A Semantic Web Primer, 2nd Edition4-97
Versioning Information
owl:priorVersion indicates earlier versions of the current ontology – No formal meaning, can be exploited for
ontology management owl:versionInfo generally contains a
string giving information about the current version, e.g. keywords
Chapter 4 A Semantic Web Primer, 2nd Edition4-98
Versioning Information (2)
owl:backwardCompatibleWith contains a reference to another ontology – All identifiers from the previous version have the
same intended interpretations in the new version – Documents can be safely changed to commit to the
new version owl:incompatibleWith indicates that the
containing ontology is a later version of the referenced ontology but is not backward compatible with it
Chapter 4 A Semantic Web Primer, 2nd Edition4-99
Combination of Features
In different OWL languages there are different sets of restrictions regarding the application of features
In OWL Full, all the language constructors may be used in any combination as long as the result is legal RDF
Chapter 4 A Semantic Web Primer, 2nd Edition
4-100
Restriction of Features in OWL DLVocabulary partitioning
Any resource is allowed to be only a class, a data type, a data type property, an object property, an individual, a data value, or part of the built-in vocabulary, and not more than one of these – E.g. a class cannot at the same time be an individual
A property cannot have some values from a data type and some values from a class – This would make it both a data type property and an
object property
Chapter 4 A Semantic Web Primer, 2nd Edition
4-101
Restriction of Features in OWL DL Explicit typing
The partitioning of all resources must be stated explicitly– E.g., if an ontology contains the following this already
entails that C2 is a class <owl:Class rdf:ID="C1">
<rdfs:subClassOf rdf:about="#C2"/></owl:Class>– Nevertheless, an OWL DL ontology must explicitly state
this information:<owl:Class rdf:ID="C2"/>
Chapter 4 A Semantic Web Primer, 2nd Edition
4-102
Restriction of Features in OWL DL Property Separation
The set of object properties and data type properties are disjoint
The following can never be specified for data type properties:
owl:inverseOfowl:InverseFunctionalPropertyowl:SymmetricProperty owl:TransitiveProperty
Chapter 4 A Semantic Web Primer, 2nd Edition
4-103
Restriction of Features in OWL DL (4)
No transitive cardinality restrictions– No cardinality restrictions may be placed on
transitive properties Restricted anonymous classes: Anonymous
classes are only allowed to occur as:– the domain and range of either
owl:equivalentClass or owl:disjointWith – the range (but not the domain) of
rdfs:subClassOf
Explanation of Transitive Properties and Cardinality Restriction
Class Employee and transitive property supervisor: Declaration(ObjectProperty(uni:supervisor))TransitiveObjectProperty(uni:supervisor)ObjectPropertyDomain(uni:supervisor uni:Employee)
ObjectPropertyRange(uni:supervisor uni:Employee)Restriction: each employee has only 1 supervisorSubClassOf(uni:Employee ObjectMaxCardinality(1 uni:supervisor))
Transitive means that:Supervisor(?x,?y)Supervisor(?y,?z)Supervisor(?x,?z)
4-104
Explanation of Transitive Properties and Cardinality Restriction
Lectures 6 & 7: Knowledge Representation and Reasoning on
the Web: Ontologies and Reasoners
4-105
a b csupervisor supervisor
Supervisor(?x,?y)Supervisor(?y,?z)Supervisor(?x,?z)
supervisor
Chapter 4 A Semantic Web Primer, 2nd Edition
4-106
Restriction of Features in OWL Lite
Restrictions of OWL DL and more Not allowed: owl:oneOf, owl:disjointWith,
owl:unionOf, owl:complementOf, owl:hasValue Cardinality statements (minimal, maximal, exact)
can only be made on the values 0 or 1 owl:equivalentClass statements can no longer
be made between anonymous classes but only between class identifiers
Chapter 4 A Semantic Web Primer, 2nd Edition
4-107
Lecture Outline
1. Basic Ideas of OWL 2. The OWL Language3. Examples4. The OWL Namespace5. Future Extensions
Chapter 4 A Semantic Web Primer, 2nd Edition
4-108
An African Wildlife Ontology – Class Hierarchy
Chapter 4 A Semantic Web Primer, 2nd Edition
4-109
An African Wildlife Ontology – Schematic Representation
Βranches are parts of trees
Chapter 4 A Semantic Web Primer, 2nd Edition
4-110
An African Wildlife Ontology - Header
<rdf:RDFxmlns:rdf="http://www.w3.org/1999/02/22-
rdf-syntax-ns#"xmlns:rdfs="http://www.w3.org/2000/01/
rdf-schema#"xmlns:owl
="http://www.w3.org/2002/07/owl#"xmlns="http://www.mydomain.org/
african">
<owl:Ontology rdf:about=""><owl:VersionInfo>
My example version 1.2, 17 October 2002</owl:VersionInfo>
</owl:Ontology>
Chapter 4 A Semantic Web Primer, 2nd Edition
4-111
An African Wildlife Ontology – Animals, Plants and Trees
<owl:Class rdf:ID=“Animal“/>
<owl:Class rdf:ID=“Plant"><rdfs:comment>Plants are disjoint from animals. </rdfs:comment><owl:disjointWith="#Animal"/>
</owl:Class>
<owl:Class rdf:ID=“Tree"><rdfs:comment>Trees are a type of plant. </rdfs:comment><rdfs:subClassOf rdf:resource="#Plant"/>
</owl:Class>
Chapter 4 A Semantic Web Primer, 2nd Edition
4-112
An African Wildlife Ontology – Properties
<owl:TransitiveProperty rdf:ID="is-part-of"/>
<owl:ObjectProperty rdf:ID="eats"><rdfs:domain rdf:resource="#Animal"/>
</owl:ObjectProperty>
<owl:ObjectProperty rdf:ID="eaten-by"><owl:inverseOf rdf:resource="#eats"/>
</owl:ObjectProperty>
Chapter 4 A Semantic Web Primer, 2nd Edition
4-113
An African Wildlife Ontology – Branches
<owl:Class rdf:ID=“Branch"><rdfs:comment> Branches are parts of
trees.</rdfs:comment><rdfs:subClassOf>
<owl:Restriction><owl:onProperty rdf:resource="#is-
part-of"/><owl:allValuesFrom
rdf:resource="#Tree"/></owl:Restriction>
</rdfs:subClassOf></owl:Class>
Chapter 4 A Semantic Web Primer, 2nd Edition
4-114
An African Wildlife Ontology – Leaves
<owl:Class rdf:ID=“Leaf"><rdfs:comment>Leaves are parts of
branches</rdfs:comment><rdfs:subClassOf>
<owl:Restriction><owl:onProperty rdf:resource="#is-
part-of"/><owl:allValuesFrom
rdf:resource="#Branch"/></owl:Restriction>
</rdfs:subClassOf></owl:Class>
Chapter 4 A Semantic Web Primer, 2nd Edition
4-115
An African Wildlife Ontology – Carnivores
<owl:Class rdf:ID=“Carnivore"><rdfs:comment>Carnivores are exactly those animalsthat eat also animals.</rdfs:comment><owl:intersectionOf rdf:parsetype="Collection">
<owl:Class rdf:about="#Animal"/><owl:Restriction>
<owl:onProperty rdf:resource="#eats"/>
<owl:someValuesFrom rdf:resource="#Animal"/>
</owl:Restriction></owl:intersectionOf>
</owl:Class>
Some animals are enough! (not All animals)
Chapter 4 A Semantic Web Primer, 2nd Edition
4-116
Herbivores
<owl:Class rdf:ID=“Herbivore"><owl:intersectionOf rdf:parsetype="Collection">
<owl:Class rdf:about="#Animal"/><owl:Restriction>
<owl:onProperty rdf:resource="#eats"/><owl:allValuesFrom>
<owl:unionOf rdf:parsetype="Collection">
<owl:Class rdf:about="#Plant"/>
<owl:Restriction><owl:onProperty
rdf:resource="#is-part-of"/><owl:allValuesFrom
rdf:resource="#Plant"/></owl:Restriction>
…
Herbivores are exactly those animals that eat only plants or parts of plants
Chapter 4 A Semantic Web Primer, 2nd Edition
4-117
An African Wildlife Ontology – Giraffes
<owl:Class rdf:ID=“Giraffe"><rdfs:comment>Giraffes are herbivores, and theyeat only leaves.</rdfs:comment><rdfs:subClassOf rdf:resource="#Herbivore"/><rdfs:subClassOf>
<owl:Restriction><owl:onProperty rdf:resource="#eats"/><owl:allValuesFrom rdf:resource="#Leaf"/>
</owl:Restriction></rdfs:subClassOf>
</owl:Class>
Chapter 4 A Semantic Web Primer, 2nd Edition
4-118
An African Wildlife Ontology – Giraffes
Why couldn’t we just use intersection instead?
<owl:Class rdf:ID=“Giraffe"><owl:intersectionOf rdf:parsetype="Collection"> <owl:Class rdf:about="#Herbivore"/>
<owl:Restriction><owl:onProperty rdf:resource="#eats"/><owl:allValuesFrom rdf:resource="#Leaf"/>
</owl:Restriction></owl:intersectionOf>
</owl:Class>
An African Wildlife Ontology – Giraffes
Chapter 4 A Semantic Web Primer, 2nd Edition
4-119
HerbivoresAnimals that
eat leaves
Giraffes
• There are more herbivore animals that eat leaves, too.• Not only Giraffes!
Herbivores that don’t eat leaves
Other animals (not herbivores) that eat leaves
Chapter 4 A Semantic Web Primer, 2nd Edition
4-120
An African Wildlife Ontology – Lions
<owl:Class rdf:ID=“Lion"><rdfs:comment>Lions are animals that eatonly herbivores.</rdfs:comment><rdfs:subClassOf rdf:resource="#Carnivore"/><rdfs:subClassOf>
<owl:Restriction><owl:onProperty
rdf:resource="#eats"/><owl:allValuesFrom
rdf:resource="#Herbivore"/></owl:Restriction>
</rdfs:subClassOf></owl:Class>
An African Wildlife Ontology – Lions
Chapter 4 A Semantic Web Primer, 2nd Edition
4-121
Carnivores Animals that eat only Herbivores
Lions
• There are more carnivore animals that eat only Herbivores, too.
• Not only Lions!
Carnivores that don’t eat only Herbivores
Chapter 4 A Semantic Web Primer, 2nd Edition
4-122
An African Wildlife Ontology – Tasty Plants (1)
<owl:Class rdf:ID=“Tasty-plant"><rdfs:comment>Plants eaten both by herbivores and
carnivores </rdfs:comment><rdfs:subClassOf rdf:resource="#Plant"/><rdfs:subClassOf>
<owl:Restriction><owl:onProperty rdf:resource="#eaten-
by"/><owl:someValuesFrom
rdf:resource="#Herbivore"/></owl:Restriction>
</rdfs:subClassOf>
Chapter 4 A Semantic Web Primer, 2nd Edition
4-123
An African Wildlife Ontology – Tasty Plants (2)
<rdfs:subClassOf><owl:Restriction>
<owl:onProperty rdf:resource="#eaten-by"/>
<owl:someValuesFrom rdf:resource="#Carnivore"/>
</owl:Restriction></rdfs:subClassOf>
</owl:Class>
Tasty Plants – Wrong Solution (1)
Why is the following not correct?<owl:Class rdf:ID="Tasty-plant">
<rdfs:comment>Plants eaten both by herbivores and carnivores</rdfs:comment><rdfs:subClassOf rdf:resource="#Plant"/><rdfs:subClassOf><owl:Restriction><owl:onProperty rdf:resource="#eaten-by"/><owl:someValuesFrom><owl:Class><owl:intersectionOf rdf:parsetype="Collection"> <owl:Class rdf:about="#Herbivore"/> <owl:Class rdf:about="#Carnivore"/></owl:intersectionOf></owl:Class></owl:someValuesFrom></owl:Restriction></rdfs:subClassOf>
</owl:Class>
4-124
The intersection is emptyThere can be no Tasty plants, since an empty class cannot have members
Because Herbivores and Carnivores are disjoint classes
Chapter 4
Tasty Plants – Wrong Solution (2)
Why is the following not correct?<owl:Class rdf:ID="Tasty-plant">
<rdfs:comment>Plants eaten both by herbivores and carnivores</rdfs:comment><rdfs:subClassOf rdf:resource="#Plant"/><rdfs:subClassOf><owl:Restriction><owl:onProperty rdf:resource="#eaten-by"/><owl:someValuesFrom><owl:Class><owl:unionOf rdf:parsetype="Collection"> <owl:Class rdf:about="#Herbivore"/> <owl:Class rdf:about="#Carnivore"/></owl:intersectionOf></owl:Class></owl:someValuesFrom></owl:Restriction></rdfs:subClassOf>
</owl:Class>
4-125
Because Union does not secure that the plant is eaten by at least one Herbivore AND at least one Carnivore
Tasty plants can be plants that are eaten solely by Herbivores, because Herbivores belong to the Union
Chapter 4
Chapter 4
4-126
A Printer Ontology – Class Hierarchy
Chapter 4 A Semantic Web Primer, 2nd Edition
4-127
A Printer Ontology – Products and Devices
<owl:Class rdf:ID="product"><rdfs:comment>Products form a class.
</rdfs:comment></owl:Class>
<owl:Class rdf:ID="padid"><rdfs:comment>Printing and digital imaging
devicesform a subclass of
products.</rdfs:comment><rdfs:label>Device</rdfs:label><rdfs:subClassOf rdf:resource="#product"/>
</owl:Class>
Chapter 4 A Semantic Web Primer, 2nd Edition
4-128
A Printer Ontology – HP Products
<owl:Class rdf:ID="hpProduct"><owl:intersectionOf>
<owl:Class rdf:about="#product"/><owl:Restriction> <owl:onProperty
rdf:resource="#manufactured-by"/> <owl:hasValue
rdf:datatype=“&xsd;string”>Hewlett Packard
</owl:hasValue></owl:Restriction>
</owl:intersectionOf></owl:Class>
Chapter 4 A Semantic Web Primer, 2nd Edition
4-129
A Printer Ontology – Printers and Personal Printers
<owl:Class rdf:ID="printer"><rdfs:comment>Printers are printing and digital imaging devices.</rdfs:comment><rdfs:subClassOf rdf:resource="#padid"/>
</owl:Class>
<owl:Class rdf:ID="personalPrinter"><rdfs:comment>Printers for personal use forma subclass of printers.</rdfs:comment><rdfs:subClassOf rdf:resource="#printer"/>
</owl:Class>
Chapter 4 A Semantic Web Primer, 2nd Edition
4-130
A Printer Ontology – HP Printers
<owl:Class rdf:ID="hpPrinter"><rdfs:comment>HP printers are HP products and printers.</rdfs:comment><rdfs:subClassOf rdf:resource="#printer"/><rdfs:subClassOf rdf:resource="#hpProduct"/>
</owl:Class>
Chapter 4 A Semantic Web Primer, 2nd Edition
4-131
A Printer Ontology – LaserJet Printers
<owl:Class rdf:ID="laserJetPrinter"><rdfs:comment>Laser jet printers are exactly those
printersthat use laser jet printing technology.
</rdfs:comment><owl:intersectionOf >
<owl:Class rdf:about="#printer"/><owl:Restriction>
<owl:onProperty rdf:resource="#printingTechnology"/>
<owl:hasValue rdf:datatype=“&xsd;string”>laser jet
</owl:hasValue></owl:Restriction>
</owl:intersectionOf></owl:Class>
Chapter 4 A Semantic Web Primer, 2nd Edition
4-132
A Printer Ontology – HP LaserJet Printers
<owl:Class rdf:ID="hpLaserJetPrinter"><rdfs:comment>HP laser jet printers are HP products and laser jet
printers.</rdfs:comment><rdfs:subClassOf
rdf:resource="#laserJetPrinter"/><rdfs:subClassOf
rdf:resource="#hpPrinter"/></owl:Class>
Chapter 4 A Semantic Web Primer, 2nd Edition
4-133
A Printer Ontology – HP LaserJet 1100 series (1)
<owl:Class rdf:ID="1100series"><rdfs:comment>1100series printers are HP laser jet printers with
8ppm printing speed and 600dpi printing resolution.</rdfs:comment>
<rdfs:subClassOf rdf:resource="#hpLaserJetPrinter"/><rdfs:subClassOf>
<owl:Restriction><owl:onProperty
rdf:resource="#printingSpeed"/><owl:hasValue rdf:datatype=“&xsd;string”>
8ppm</owl:hasValue>
</owl:Restriction></rdfs:subClassOf>
Chapter 4 A Semantic Web Primer, 2nd Edition
4-134
A Printer Ontology – HP LaserJet 1100 series (2)
<rdfs:subClassOf><owl:Restriction>
<owl:onProperty rdf:resource="#printingResolution"/>
<owl:hasValue rdf:datatype=“&xsd;string”>600dpi
</owl:hasValue></owl:Restriction>
</rdfs:subClassOf></owl:Class>
Chapter 4 A Semantic Web Primer, 2nd Edition
4-135
A Printer Ontology – HP LaserJet 1100se Printers
<owl:Class rdf:ID="1100se"><rdfs:comment>1100se printers belong to the 1100 series
and cost $450.</rdfs:comment><rdfs:subClassOf rdf:resource="#1100series"/><rdfs:subClassOf>
<owl:Restriction><owl:onProperty rdf:resource="#price"/><owl:hasValue
rdf:datatype=“&xsd;integer”>450</owl:hasValue>
</owl:Restriction></rdfs:subClassOf>
</owl:Class>
Chapter 4 A Semantic Web Primer, 2nd Edition
4-136
A Printer Ontology – Properties (1)
<owl:DatatypeProperty rdf:ID="manufactured-by"><rdfs:domain rdf:resource="#product"/><rdfs:range rdf:resource="&xsd;string"/>
</owl:DatatypeProperty>
<owl:DatatypeProperty rdf:ID="printingTechnology"><rdfs:domain rdf:resource="#printer"/><rdfs:range rdf:resource="&xsd;string"/>
</owl:DatatypeProperty>
Chapter 4 A Semantic Web Primer, 2nd Edition
4-137
A Printer Ontology – Properties (2)
<owl:DatatypeProperty rdf:ID="price"><rdfs:domain rdf:resource="#product"/><rdfs:range
rdf:resource="&xsd;nonNegativeInteger"/></owl:DatatypeProperty><owl:DatatypeProperty rdf:ID="printingResolution">
<rdfs:domain rdf:resource="#printer"/><rdfs:range rdf:resource="&xsd;string"/>
</owl:DatatypeProperty>
Chapter 4 A Semantic Web Primer, 2nd Edition
4-138
A Printer Ontology – Properties (3)
<owl:DatatypeProperty rdf:ID="printingSpeed"><rdfs:domain rdf:resource="#printer"/><rdfs:range rdf:resource="&xsd;string"/>
</owl:DatatypeProperty>
Chapter 4 A Semantic Web Primer, 2nd Edition
4-139
Lecture Outline
1. Basic Ideas of OWL 2. The OWL Language3. Examples4. The OWL Namespace5. Future Extensions
Chapter 4 A Semantic Web Primer, 2nd Edition
4-140
OWL in OWL
We present a part of the definition of OWL in terms of itself
The following captures some of OWL’s meaning in OWL– It does not capture the entire semantics– A separate semantic specification is necessary
The URI of the OWL definition is defined as the default namespace
Chapter 4 A Semantic Web Primer, 2nd Edition
4-141
Classes of Classes (Metaclasses)
The class of all OWL classes is itself a subclass of the class of all RDF Schema classes
<rdfs:Class rdf:ID="Class"><rdfs:subClassOf
rdf:resource="&rdfs;Class"/></rdfs:Class>
Chapter 4 A Semantic Web Primer, 2nd Edition
4-142
Classes of Classes (Metaclasses) – Thing and Nothing
Thing is most general object class in OWL Nothing is most specific class: the empty
object class The following relationships hold:
Thing Nothing Nothing
Nothing Thing Nothing Nothing Nothing Nothing
Chapter 4 A Semantic Web Primer, 2nd Edition
4-143
Classes of Classes (Metaclasses) – Thing and Nothing (2)
<owl:Class rdf:ID="Thing"><unionOf rdf:parseType="Collection">
<Class rdf:about="#Nothing"/><Class>
<complementOf rdf:resource="#Nothing"/>
</Class></unionOf>
</Class><Class rdf:ID="Nothing">
<complementOf rdf:resource="#Thing"/></Class>
Chapter 4 A Semantic Web Primer, 2nd Edition
4-144
Class and Property Equivalences
<rdf:Property rdf:ID="EquivalentClass"><rdfs:subPropertyOf
rdf:resource="&rdfs;subClassOf"/><rdfs:domain rdf:resource="#Class"/><rdfs:range rdf:resource="#Class"/>
</rdf:Property>
<rdf:Property rdf:ID="EquivalentProperty"><rdfs:subPropertyOf
rdf:resource="&rdfs;subPropertyOf"/></rdf:Property>
Chapter 4 A Semantic Web Primer, 2nd Edition
4-145
Class Disjointness
<rdf:Property rdf:ID="disjointWith"><rdfs:domain
rdf:resource="#Class"/><rdfs:range
rdf:resource="#Class"/></rdf:Property>
Chapter 4 A Semantic Web Primer, 2nd Edition
4-146
Equality and Inequality
Equality and inequality can be stated between arbitrary things– In OWL Full this statement can also be
applied to classes Properties sameAs and
differentFrom
Chapter 4 A Semantic Web Primer, 2nd Edition
4-147
Equality and Inequality (2)
<rdf:Property rdf:ID="sameAs"> <rdfs:domain rdf:resource="#Thing"/>
<rdfs:range rdf:resource="#Thing"/></rdf:Property>
<rdf:Property rdf:ID="differentFrom"><rdfs:domain rdf:resource="#Thing"/>
<rdfs:range rdf:resource="#Thing"/></rdf:Property>
Chapter 4 A Semantic Web Primer, 2nd Edition
4-148
Equality and Inequality (3)
owl:distinctMembers can only be used for owl:AllDifferent
<rdfs:Class rdf:ID="AllDifferent“/>
<rdf:Property rdf:ID="distinctMembers"><rdfs:domain rdf:resource="#AllDifferent"/><rdfs:range rdf:resource="&rdf;List"/>
</rdf:Property>
Chapter 4 A Semantic Web Primer, 2nd Edition
4-149
Union and Intersection of Classes
Build a class from a list, assumed to be a list of other class expressions
<rdf:Property rdf:ID="unionOf"><rdfs:domain rdf:resource="#Class"/><rdfs:range rdf:resource="&rdf;List"/>
</rdf:Property>
Chapter 4 A Semantic Web Primer, 2nd Edition
4-150
Complement of a Class
owl:complementOf defines a class in terms of a single other class
<rdf:Property rdf:ID="complementOf"><rdfs:domain rdf:resource="#Class"/><rdfs:range rdf:resource="#Class"/>
</rdf:Property>
Chapter 4 A Semantic Web Primer, 2nd Edition
4-151
Restriction Classes
Restrictions in OWL define the class of those objects that satisfy some attached conditions
<rdfs:Class rdf:ID="Restriction"><rdfs:subClassOf rdf:resource="#Class"/>
</rdfs:Class>
Chapter 4 A Semantic Web Primer, 2nd Edition
4-152
Restriction Properties
All the following properties (onProperty, allValuesFrom, minCardinality, etc.) are only allowed to occur within a restriction definition
Their domain is owl:Restriction, but they differ with respect to their range
Chapter 4 A Semantic Web Primer, 2nd Edition
4-153
Restriction Properties (2)
<rdf:Property rdf:ID="onProperty"><rdfs:domain rdf:resource="#Restriction"/><rdfs:range rdf:resource="&rdf;Property"/>
</rdf:Property><rdf:Property rdf:ID="allValuesFrom">
<rdfs:domain rdf:resource="#Restriction"/><rdfs:range rdf:resource="&rdfs;Class"/>
</rdf:Property>
Chapter 4 A Semantic Web Primer, 2nd Edition
4-154
Restriction Properties (3)
<rdf:Property rdf:ID="hasValue"><rdfs:domain rdf:resource="#Restriction"/>
</rdf:Property><rdf:Property rdf:ID="minCardinality">
<rdfs:domain rdf:resource="#Restriction"/><rdfs:range
rdf:resource="&xsd;nonNegativeInteger"/></rdf:Property>
Chapter 4 A Semantic Web Primer, 2nd Edition
4-155
Properties
owl:ObjectProperty and owl:DatatypeProperty are special cases of rdf:Property
<rdfs:Class rdf:ID="ObjectProperty"><rdfs:subClassOf
rdf:resource="&rdf;Property"/></rdfs:Class>
Chapter 4 A Semantic Web Primer, 2nd Edition
4-156
Properties (2)
Symmetric, functional and inverse functional properties can only be applied to object properties
<rdfs:Class rdf:ID="TransitiveProperty"><rdfs:subClassOf
rdf:resource="#ObjectProperty"/></rdfs:Class>
Chapter 4 A Semantic Web Primer, 2nd Edition
4-157
Properties (3)
owl:inverseOf relates two object properties:
<rdf:Property rdf:ID="inverseOf"><rdfs:domain
rdf:resource="#ObjectProperty"/><rdfs:range
rdf:resource="#ObjectProperty"/></rdf:Property>
Chapter 4 A Semantic Web Primer, 2nd Edition
4-158
Implicit Statements
Although not stated in the online references, the following would also seem to be true
<TransitiveProperty rdf:ID="&rdfs;subClassOf"><TransitiveProperty rdf:ID="&rdfs;subProperty><TransitiveProperty rdf:ID="EquivalentClass"><SymmetricProperty rdf:ID="EquivalentClass"><SymmetricProperty rdf:ID="disjointWith"><TransitiveProperty rdf:ID="EquivalentProperty">
Chapter 4 A Semantic Web Primer, 2nd Edition
4-159
Implicit Statements (2)
<SymmetricProperty rdf:ID="EquivalentProperty"><TransitiveProperty rdf:ID="sameAs"><SymmetricProperty rdf:ID="sameAs"><SymmetricProperty rdf:ID="differentFrom"><SymmetricProperty rdf:ID="complementOf">
<rdfs:subPropertyOf rdf:resource=“#disjointWith"></SymmetricProperty>
Chapter 4 A Semantic Web Primer, 2nd Edition
4-160
Implicit Statements (3)
<rdf:Property rdf:about=“#cardinality"><rdfs:subPropertyOf rdf:resource=“#mincardinality"><rdfs:subPropertyOf rdf:resource=“#maxcardinality">
</rdf:Property>
<SymmetricProperty rdf:ID="inverseOf"><inverseOf rdf:resource=“#inverseOf">
</SymmetricProperty>
Chapter 4 A Semantic Web Primer, 2nd Edition
4-161
Lecture Outline
1. Basic Ideas of OWL 2. The OWL Language3. Examples4. The OWL Namespace5. Future Extensions
Chapter 4 A Semantic Web Primer, 2nd Edition
4-162
Future Extensions of OWL
Modules and ImportsDefaultsClosed World AssumptionUnique Names AssumptionProcedural AttachmentsRules for Property Chaining
Chapter 4 A Semantic Web Primer, 2nd Edition
4-163
Modules and Imports
The importing facility of OWL is very trivial: – It only allows importing of an entire ontology, not
parts of it Modules in programming languages based on
information hiding: state functionality, hide implementation details– Open question how to define appropriate module
mechanism for Web ontology languages
Chapter 4 A Semantic Web Primer, 2nd Edition
4-164
Defaults
Many practical knowledge representation systems allow inherited values to be overridden by more specific classes in the hierarchy– treat inherited values as defaults
No consensus has been reached on the right formalization for the nonmonotonic behaviour of default values
Chapter 4 A Semantic Web Primer, 2nd Edition
4-165
Closed World Assumption
OWL currently adopts the open-world assumption: – A statement cannot be assumed false on the basis
of a failure to prove it– On the huge and only partially knowable WWW, this
is a correct assumption Closed-world assumption: a statement is true
when its negation cannot be proved– tied to the notion of defaults, leads to nonmonotonic
behaviour
Chapter 4 A Semantic Web Primer, 2nd Edition
4-166
Unique Names Assumption
Typical database applications assume that individuals with different names are indeed different individuals
OWL follows the usual logical paradigm where this is not the case– Plausible on the WWW
One may want to indicate portions of the ontology for which the assumption does or does not hold
Chapter 4 A Semantic Web Primer, 2nd Edition
4-167
Procedural Attachments
A common concept in knowledge representation is to define the meaning of a term by attaching a piece of code to be executed for computing the meaning of the term– Not through explicit definitions in the language
Although widely used, this concept does not lend itself very well to integration in a system with a formal semantics, and it has not been included in OWL
Chapter 4 A Semantic Web Primer, 2nd Edition
4-168
Rules for Property Chaining
OWL does not allow the composition of properties for reasons of decidability– In many applications this is a useful operation– One may want to define properties as general rules
(Horn or otherwise) over other properties Integration of rule-based and DL-style
knowledge representation is currently an active area of research
In OWL-2 this feature exists!
Chapter 4 A Semantic Web Primer, 2nd Edition
4-169
Summary
OWL is the proposed standard for Web ontologies
OWL builds upon RDF and RDF Schema: – (XML-based) RDF syntax is used– Instances are defined using RDF descriptions– Most RDFS modeling primitives are used
Chapter 4 A Semantic Web Primer, 2nd Edition
4-170
Summary (2)
Formal semantics and reasoning support is provided through the mapping of OWL on logics– Predicate logic and description logics have been
used for this purpose While OWL is sufficiently rich to be used in
practice, extensions are in the making– They will provide further logical features, including
rules
top related