Semantic Web Technologies Lecture Dr. Harald Sack Hasso-Plattner-Institut für IT Systems Engineering University of Potsdam Winter Semester 2012/13 Lecture Blog: http://semweb2013.blogspot.com / This file is licensed under the Creative Commons Attribution-NonCommercial 3.0 (CC BY-NC 3.0 ) Dienstag, 18. Dezember 12
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Semantic Web Technologies
LectureDr. Harald Sack
Hasso-Plattner-Institut für IT Systems EngineeringUniversity of Potsdam
Winter Semester 2012/13
Lecture Blog: http://semweb2013.blogspot.com/This file is licensed under the Creative Commons Attribution-NonCommercial 3.0 (CC BY-NC 3.0)
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamTurmbau zu Babel, Pieter Brueghel, 1563
11
OWL2 – Web Ontology Language 2
• What has changed since OWL1?
• Extensions from best practices and experiences with OWL 1• additional expressivity with new ontological axioms• Refinement of OWL language flavors• additional extensions
• new syntax, comments, etc.
• Compatibility as far as possible with the old standard• Maintaining decidability for OWL 2 DL• Solving problems of the OWL 1 standard
Dienstag, 18. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
12
3.6 OWL 23.6.1 Development of OWL 2
3.6.2 From SHOIN(D) to SHROIQ(D)
3.6.3 OWL 2 Syntax3.6.4 Complexity and other Properties3.6.5 OWL 2 Profiles
Dienstag, 18. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamTurmbau zu Babel, Pieter Brueghel, 1563
13
OWL 1 DL is based on SHOIN(D)• Axioms• TBox: Subclass relationships C ⊑ D
SHROIQ(D) allows negated properties in the ABox: ¬R(a,b)
Dienstag, 18. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamTurmbau zu Babel, Pieter Brueghel, 1563
15Number Restrictions
• SHOIN(D) supports simple number restrictions (N):
• Person ⊓ ≥3hasChild
• Class of all persons with at least 3 children
• SHROIQ(D) also supports qualified number restrictions (Q):
• Person ⊓ ≥3hasChild.(Woman⊓Professor)
• Class of all persons with at least 3 daughters, who are professors
From SHOIN(D) zu SHROIQ(D)
Dienstag, 18. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamTurmbau zu Babel, Pieter Brueghel, 1563
16The Self Concept
• Try to model this: „Every Human knows himself.“
• SHOIN(D)
• knows(Harald, Harald) knows(Magnus, Magnus) ...
• General modeling in TBox not possible
• SHROIQ(D) has a special element: Self
• Human ⊑ ∃knows.Self
From SHOIN(D) zu SHROIQ(D)
Dienstag, 18. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamTurmbau zu Babel, Pieter Brueghel, 1563
17 Property Axioms• In SHOIN(D) properties can be modeled as
• transitive, symmetric, functional and invers functional
• SHROIQ(D) offers additional property axioms:
• Antisymmetry: ∀a,b∈ΔI:(a,b)∈RI"(b,a)∉RI
• Reflexivity: ∀a∈ΔI:(a,a)∈RI
• Irreflexivity: ∀a∈ΔI:(a,a)∉RI
• Disjunctiveness: ∀a,b∈ΔI:(a,b)∉RI∩SI
From SHOIN(D) zu SHROIQ(D)
Dienstag, 18. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamTurmbau zu Babel, Pieter Brueghel, 1563
18 Property Axioms
•Additionaly for SHROIQ(D) an universal property U has been introduced:• ∀a,b∈ΔI: (a,b)∈UI, UI=∆Ix∆I
• U was introduced to be the counterpart of the universal class ⊤
From SHOIN(D) zu SHROIQ(D)
Dienstag, 18. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamTurmbau zu Babel, Pieter Brueghel, 1563
19General Property Inclusion
• „The friends of my friends are also my friends.“
• can be expressed as SHOIN(D) transitive property
•But: „The foes of my friends are also my foes.“
• cannot be expressed as SHOIN(D)
hasFoehasFriend
From SHOIN(D) zu SHROIQ(D)
• In FOL as Rule:• ∀x,y,z:hasFriend(x,y)∧hasFoe(y,z)"hasFriendsFoe(x,z)
• hasFriend º hasFoe ⊑ hasFriendsFoe
Dienstag, 18. Dezember 12
General Property Inclusion
• „The friends of my friends are also my friends.“
• can be expressed as SHOIN(D) transitive property
•But: „The foes of my friends are also my foes.“
• cannot be expressed as SHOIN(D)
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
20
Property Inclusion• RBox expressions of the form R1ºR2ºR3º.....ºRn⊑Se.g.: hasFriend º hasFoe ⊑ hasFriendsFoe
• Semantics: if (x0,x1)∈R1I,(x1,x2)∈R2I...(xn-1,xn)∈RnI , then it also holds that (x0,xn)∈SI
E.g.: (x0,x1)∈hasFriendI and (x1,x2)∈hasFoeI, then it also holds (x0,x2)∈hasFriendsFoeI
From SHOIN(D) zu SHROIQ(D)
Dienstag, 18. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
21
Expressivity of Property Inclusion
• With RBoxes formal Languages can be defined
Example•Grammar for the (context free) language of the words ab, aabb, aaabbb, ...
•∃L.⊤ ≢ ⊥ („ ∃L.⊤ necessarely non-empty“) means:„There exists a chain Ra and Rb pertaining to the language.“
•∃L1.∃L2- ≢ ⊥ for two languages L1 and L2 means:„There exists a word pertaining to L1 and also to L2.“
L ::= abL ::= aLb
gets Ra º Rb ⊑ LRa º L º Rb ⊑ L
But from formal languages is known:Emptiness of the intersection of context free languages is not decidable
From SHOIN(D) zu SHROIQ(D)
Dienstag, 18. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
22Expressivity of Property Inclusion
• With RBoxes formal Languages can be defined
OWL with general propertry inclusion in UNDECIDABLE !
From SHOIN(D) zu SHROIQ(D)
Example•Grammar for the (context free) language of the words ab, aabb, aaabbb, ...
•∃L.⊤ ≢ ⊥ („ ∃L.⊤ necessarely non-empty“) means:„There exists a chain Ra and Rb pertaining to the language.“
•∃L1.∃L2- ≢ ⊥ for two languages L1 and L2 means:„There exists a word pertaining to L1 and also to L2.“
L ::= abL ::= aLb
gets Ra º Rb ⊑ LRa º L º Rb ⊑ L
Dienstag, 18. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
23
Regular RBoxes• Can property inclusion restricted in some way to stay
decidable?• Rboxes are like grammars for context-free languages• Intersection of context free languages is problematic• Therefore restriction to regular languages!
Regular RBoxes•Property names are ordered with ≺ (strict partial Ordering).•Each RBox Inclusion must must be formed like:
•Where: Si ≺ R for all i=1,2,...,n•An RBox is called regular, if such an (strict) Ordering ≺ exists.
•R º R ⊑ R•R- ⊑ R•S1 º S2 º S3 º ... º Sn ⊑ R
•R º S1 º S2 º S3 º...º Sn ⊑ R •S1 º S2 º S3 º... º Sn º R ⊑ R
From SHOIN(D) zu SHROIQ(D)
Dienstag, 18. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
24
Regular RBoxes - Examples• Example:R º S ⊑ R S º S ⊑ S R º S º R ⊑ Tis regular with ordering S ≺ R ≺ T
• Example:R º T º S ⊑ Tis not regular (not allowed inclusion)
• Example:R º S ⊑ S S º R ⊑ Ris not regular (no valid ordering possible)
From SHOIN(D) zu SHROIQ(D)
Dienstag, 18. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
• is not regular because regularity would enforcebothhasParent ≺ hasFatherand hasFather ≺ hasParentwhich is impossible because ≺ must be strict
From SHOIN(D) zu SHROIQ(D)
Dienstag, 18. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
26
Restrictions for simple Properties• Simple properties in SHOIN(D) are properties without
transitive subproperties
• In SHROIQ(D) property inclusion has to be considered
•Non-simple properties are properties that are directly (or indirectly) dependent of property chains (º )
Simple Properties• are all properties that• are not on the right side of a property inclusion,• are the inverse of other simple properties,• are only on the right side of property inclusions R ⊑ S,
where on the left side is a simple property
From SHOIN(D) zu SHROIQ(D)
Dienstag, 18. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
27Rectricions for Simple Properties
• The following expressions are permitted ONLY for simple properties:
•≤n R.C and ≥n R.C (qualified number restriction)• Irreflexive properties•Disjunctive properties•∃R.Self
•¬R(a,b)
•Reason: Saving Decidability
From SHOIN(D) zu SHROIQ(D)
Dienstag, 18. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
28
Summary• To ensure decidability the following structural restrictions
must hold or SHROIQ(D):• Regularity:
Restriction of potential interaction of RBox axioms• Simplicity of properties:
Restrictions of how to apply properties in number restrictions
• Therefore a number of restrictions arise for the overall structure of the knowledge base that have to be considered for all axioms.
• Attention: The union of several SHROIQ(D) knowledge bases might violate these restrictions, although each underlying knowledge base does comply to the restrictions!
From SHOIN(D) zu SHROIQ(D)
Dienstag, 18. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
29
SHROIQ(D) Overview
Class Expressions• Class names A,B• Conjunction C ⊓ D• Disjunction C ⊔ D• Negation ¬C• Exist. property restriction ∃R.C• Univ property restriction ∀R.C• Self ∃S.Self• Greater-than ≥n S.C• Less-than ≤ S• Enumerated classes {a}
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
30
3.6 OWL 23.6.1 Development of OWL 2
3.6.2 From SHOIN(D) to SHROIQ(D)
3.6.3 OWL 2 Syntax3.6.4 Complexity and other Properties3.6.5 OWL 2 Profiles
Dienstag, 18. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
31
• OWL 2 can be represented in different Syntax variants• Functional Syntax: substitutes abstract Syntax of OWL 1• RDF-Syntax: extension of existing OWL/RDF• XML-Syntax: Independent XML Serialisation• Manchester-Syntax: machine readable Syntax, esp. for
ontology editors• Turtle: optional
• Functional Syntax is easy to define, no RDF restrictions, more compact
• RDF-Syntax important for compatibility issues• Turtle: simple and efficient to write...
OWL 2 Syntax Variants
Dienstag, 18. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
33
OWL 2 - Manchester Syntax
Class: Person Annotations: ... SubClassOf: owl:Thing that hasFirstName exactly 1 and hasFirstName only string[minLength 1] ,... SubClassOf: hasAge exactly 1 and hasAge only not NegInt,... SubClassOf: hasGender exactly 1 and hasGender only {female , male} ,... SubClassOf: not hates Self, ... EquivalentTo: g:People ,... DisjointWith: g:Rock , g:Mineral ,...
Individual: John Annotations: ... Types: Person , hasFirstName value "John" or hasFirstName value "Jack"^^xsd:string Facts: hasWife Mary, not hasChild Susan, hasAge 33, hasChild _:child1 SameAs: Jack ,... DifferentFrom: Susan ,...
Dienstag, 18. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
34
OWL 2 - Turtle Syntax
:HappyPerson a owl:Class ; owl:equivalentClass [ a owl:Class ; owl:intersectionOf ([ a owl:Restriction ; owl:onProperty :hasChild ; owl:allValuesFrom :HappyPerson ] [ a owl:Restriction ; owl:onProperty :hasChild ; owl:someValuesFrom :HappyPerson ] ) ].
Dienstag, 18. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
35
• OWL 2 can be represented in different Syntax variants• Functional Syntax: substitutes abstract Syntax of OWL 1• RDF-Syntax: extension of existing OWL/RDF• XML-Syntax: Independent XML Serialisation• Manchester-Syntax: machine readable Syntax, esp. for
ontology editors• Turtle: optional
• Functional Syntax is easy to define, no RDF restrictions, more compct
• RDF-Syntax important for compatibility issues• Turtle: simple and efficient to write...
OWL 2 Syntax Variants
Dienstag, 18. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
36 • In OWL 2 Individuals can be defined as named entity also without direct class membership
:HaraldSack a owl:NamedIndividual .
OWL 2 Individual Definition
Dienstag, 18. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
37
OWL 2 Disjunctive Classes
• In OWL 1 two classes can be defined to be disjunctive (owl:disjointWith)
• OWL 2 offers a shortcut for defining several classes to be disjunctive
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
49
OWL 2 Datatypes
• OWL 2 supports most XML Schema Datatypes that have been supported by OWL 1• Exception: xsd:time, xsd:date, xsd:gYear, xsd:gMonth, xsd:gDay, xsd:gMonthDay, xsd:gYearMonth
• The following new Datatypes are available for OWL2:
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
57
OWL 2 Profiles
• OWL 2 Profiles are sub-languages of OWL 2
• OWL 2 DL corresponds to SHROIQ(D)
• OWL 2 Full simply is an extension of OWL 1 Full• What about OWL 2 Lite?
• OWL 1 Lite has nearly the same complexity as OWL 1 DL• Originally intended as part of OWL that is simple and
efficient to implement
• New approach for OWL 2: • Definition of several language profiles• languages should have efficient runtime complexity
Dienstag, 18. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
58
OWL 2 Profiles• Approach:
• Identify maximal OWL 2 sub-languages (fragments) that are decidable in polynomial time
• Main reason for super-polynomial runtime: Non-Determinism (requires guessing / backtracking)• Disjunction or Negation + Conjunction• Maximum number restrictions• Combination of existential and universal quantification
in one superclass• Non-unary enumerated classes
• therefore not allowed for OWL 2 Profiles
• Attention: many other features may also lead to non- determinism...
Dienstag, 18. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
59
• OWL 2 EL Profile is based on the description logic EL++:
Description Logic EL++• Conjunction C⊓D, existential Restriction ∃R.C, ⊤ and ⊥• Enumerated Classes, restricted property ranges• General property inclusion (RBox), Transitivity• NOT ALLOWED: Universal quantification, disjunction,
complement, number restrictions, disjunctiveness und inverted properties
⊓∃⊤⊥ ⊑ ⊓∃⊤⊥
OWL Profiles• OWL 2 EL• OWL 2 QL• OWL 2 RL
Dienstag, 18. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
60
OWL Profiles• OWL 2 EL• OWL 2 QL• OWL 2 RL
• Advantages:• Polynomial complexity for standard entailment, i.e.
decidability, class membership, etc.• simple implementation• supports important ontologies (e.g. SNOMED-CT)
• OWL 2 EL Profile is based on the description logic EL++:
Description Logic EL++• Conjunction C⊓D, existential Restriction ∃R.C, ⊤ and ⊥• Enumerated Classes, restricted property ranges• General property inclusion (RBox), Transitivity• NOT ALLOWED: Universal quantification, disjunction,
complement, number restrictions, disjunctiveness und inverted properties
Dienstag, 18. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
61
•OWL 2 EL Examples:• ∃has.Sorrow ⊑ ∃has.Liqueur
• ∃married.⊤ ⊓ CatholicPriest ⊑ ⊥
• German ⊑ ∃knows.{angela}
• hasParent º hasParent ⊑ hasGrandparent
OWL Profiles• OWL 2 EL• OWL 2 QL• OWL 2 RL
Dienstag, 18. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
62
• OWL 2 QL Profile is based on description logic DL Lite: