(09) semantic web technologies - owl
DESCRIPTION
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)
Samstag, 15. Dezember 12
Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
2 1. Introduction 2. Semantic Web - Basic Architecture
Languages of the Semantic Web - Part 1
3. Knowledge Representation and LogicsLanguages of the Semantic Web - Part 2
4. Applications in the ,Web of Data‘
Semantic Web Technologies Content
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam Rembrandt van Rijn, Die Anatomie des Dr. Tulp, 1632
3
Formal
Seman
tics
for RD
F(S)
last lecture
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
4 3. Knowledge Representation and LogicsThe Languages of the Semantic Web - Part 2
• Excursion: Ontologies in Philosophy and Computer Science
• Recapitulation: Propositional Logic and First Order Logic
• Description Logics
• RDF(S) Semantics• OWL and OWL-Semantics• OWL 2 and Rules
Semantic Web Technologies Content
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
OWL
Web On
tology
Langu
age5
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
63.5 OWL and OWL Semantics
3.5.1 OWL 1 - Overview 3.5.2 OWL 1 - Syntax3.5.3 OWL 1 - Tools3.5.4 OWL Semantics
3. Knowledge Representation & Logic3.5 OWL and OWL Semantics
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamTurmbau zu Babel, Pieter Brueghel, 1563
7
Why OWL and not WOL ...?
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamTurmbau zu Babel, Pieter Brueghel, 1563
8• OWL - W3C Recommendation since 2004• OWL 2 - W3C Recommendation since 2009
• OWL Ontology consists of• Classes / properties / individuals (instances of Classes)
• Open World Assumption• „Absence of information must not be valued as negative
information.“• E.g.: sitsNextTo(PersonA, PersonB)
PersonA my also sit next to another person…• No Unique Name Assumption
• „Difference must be expressed explicitly“• E.g.: PersonA might denote the same individual as PersonB
OWL – Web Ontology Language
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamTurmbau zu Babel, Pieter Brueghel, 1563
9
OWL – Web Ontology Language
• OWL is a semantic fragment of FOL• OWL existists in different flavours• OWL Lite ⊆ OWL DL ⊆ OWL Full
FOL
SWRL/RIF OWL Full
OWL DL
OWL Lite RDFS
ConceptHierarchies
OWL ELOWL RLOWL QL
OWL1
OWL1Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamTurmbau zu Babel, Pieter Brueghel, 1563
10
OWL – Web Ontology Language
• OWL is a semantic fragment of FOL• OWL existists in different flavours• OWL Lite ⊆ OWL DL ⊆ OWL Full
• for OWL2:• OWL EL, OWL RL, OWL QL
⊆ OWL DL ⊆ OWL Full
FOL
SWRL/RIF OWL Full
OWL DL
OWL Lite RDFSOWL ELOWL RLOWL QL
OWL2
OWL2ConceptHierarchies
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
11
OWL – Web Ontology Language
• OWL Lite SHIF(D)
• Subset of OWL DL , rather restricted (no nominal classes, no cardinality, no disjunctiveness)
• Complexity ExpTime (worst case)
• OWL DL (Description Logic) SHOIN (D) or SHROIQ (D) [OWL2]
• formally sound semantics
• decidable, complete, sound
• Complexity NExpTime (worst case)
• OWL Full• Union of OWL Syntax and RDF(S)
• Meta modeling (Nesting)• undecidable (is not a descrtion logic)
Lite
DLFull
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
12
OWL – Web Ontology Language
Lite
DLFull
• Disjunctiveness of classes•E.g.: Classes Person and Beverage are disjunctive
• Inverse properties•E.g.: likes ↔ isLikedBy
• Difference of individuals•E.g.: PersonA != PersonB
• Class descriptions•E.g.: Class CoffeeLover consists of members of class Person, who for the Property likes have the value “Coffee“
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
133.5 OWL and OWL Semantics
3.5.1 OWL 1 - Overview 3.5.2 OWL 1 - Syntax3.5.3 OWL 1 - Tools3.5.4 OWL Semantics
3. Knowledge Representation & Logic3.5 OWL and OWL Semantics
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
14
OWL 1 – Syntax Variants
<owl:Class rdf:ID=“Wine“> <rdfs:subClassOf rdf:resource=“#Beverage“/></owl:Class>
class(a:Wine partial a:Beverage)
Wine ⊆ Beverage
RDF(S) Syntax
abstract Syntax
DL Syntax
:Beverage a owl:Class .:Wine a owl:Class ; rdfs:subClassOf :Beverage .
Turtle
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
15
OWL 1 – RDF(S) Syntax
• OWL documents are RDF documents (at least according to the standard syntax)
• OWL documents (in RDF(S) syntax) consist of• Header with general information• Body with the actual ontology
<rdf:RDF xmlns ="http://www.semanticweb-fundamentals.de/exampleontology#" xmlns:rdf ="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:xsd ="http://www.w3.org/2001/XMLSchema#" xmlns:rdfs ="http://www.w3.org/2000/01/rdf-schema#" xmlns:owl ="http://www.w3.org/2002/07/owl#“ > ...</rdf:RDF>
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
16
3.5 OWL and OWL Semantics3.5.1 OWL - Overview 3.5.2 OWL1 Syntax - OWL1 document header - OWL1 classes, properties and individuals - OWL1 - complex classes - OWL1 - properties - OWL1 variants - Querying OWL13.5.3 OWL1 Tools3.5.4 OWL Semantics
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
17
OWL1 Document Header
<owl:Ontology rdf:about=""> <rdfs:comment rdf:datatype="http://www.w3.org/2001/XMLSchema#string“> SWRC Ontology in the version of january 2012 </rdfs:comment> <owl:versionInfo>v0.5</owl:versionInfo> <owl:imports rdf:resource="http://www.hpi.uni-potsdam.de/foo"/> <owl:priorVersion rdf:resource="http://www.semweb.de/swrc"/></owl:Ontology>
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
18
OWL Document Header
• inherited from rdfs:• rdfs:comment• rdfs:label• rdfs:seeAlso• rdfs:isDefinedBy
• other:• owl:imports
• OWL Versioning:• owl:versionInfo• owl:priorVersion• owl:backwardCompatibleWith• owl:incompatibleWith• owl:DeprecatedClass• owl:DeprecatedProperty
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
19
3.5 OWL and OWL Semantics3.5.1 OWL - Overview 3.5.2 OWL1 Syntax - OWL1 document header - OWL1 classes, properties and individuals - OWL1 - complex classes - OWL1 - properties - OWL1 variants - Querying OWL13.5.3 OWL1 Tools3.5.4 OWL Semantics
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
20
OWL – Classes, Properties and Individuals
• Ontology axioms consist of the following three building blocks:
• Classes•comparable with classes in RDFS
• Individuals•comparable with objects in RDFS
• Properties•comparable with properties in RDFS
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
21
• there exist two predefined classes• owl:Thing (class that contains all individuals)• owl:Nothing (empty class)
• Definition of a class
:Wine a owl:Class .
OWL – Classes
⊤
⊥
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
22 • Definition of individuals via class membership
:WegelerRheingauRiesling a :Wine .
OWL – Individuals
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
23
OWL – Properties
• there exist two variants: • object properties• datatype properties
• Object properties are defined like classes
• Domain and Range of object properties
:isMadeFrom a owl:ObjectProperty .
:isMadeOf a owl:ObjectProperty ; rdfs:domain :Wine ; rdfs:range :Grapes .
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
24• Datatype properties have datatypes as range
• Domain and range of datatype properties
• Many XML datatypes can be used.The standard provides integer and string.
:hasQuality a owl:DatatypeProperty .
OWL – Properties
:hasQuality a owl:DatatypeProperty ; rdfs:domain :Wine ; rdfs:range xsd:string .
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
25
OWL – Properties and Individuals
:Wine a owl:Class .:Grapes a owl:Class .:Riesling a :Grapes .:isMadeOf a owl:ObjectProperty ; rdfs:domain :Wine ; rdfs:range :Grapes .:hasQuality a owl:DatatypeProperty ; rdfs:domain :Wine ; rdfs:range xsd:string .:WegelerRheingauRiesling a :Wine ; :isMadeOf :Riesling ; :hasQuality “Spätlese“ .
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
26
OWL – Properties and Individuals
• Properties in general are not functional
:Tempranillo a :Grapes .:Garnacha a :Grapes .:Mazuelo a :Grapes .:Graciano a :Grapes .:MarquesDeRiscal a :Wine ; :isMadeOf :Tempranillo ; :isMadeOf :Garnacha ; :isMadeOf :Mazuelo ; :isMadeOf :Graciano .
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
27
OWL – Class Hierarchies
• via inference it can be entailed that „Wine“ is also a subclass of „Beverage“
:Wine a owl:Class ; rdfs:subClassOf :AlcoholicBeverage .:AlcoholicBeverage a owl:Class ; rdfs:subClassOf :Beverage .:Beverage a owl:Class .
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
28
OWL – Class Hierarchies and Disjunctiveness
• via inference it can be entailed that „Wine“ and „Pizza“ are also disjoint classes.
:AlcoholicBeverage a owl:Class .:MainDish a owl:Class .:Wine a owl:Class ; rdfs:subClassOf :AlcoholicBeverage .:Pizza a owl:Class ; rdfs:subClassOf :MainDish .
:AlcoholicBeverage owl:disjointWith :MainDish .
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
29
OWL – Class Hierarchies and Equivalence
:AlcoholicBeverage a owl:Class .:AlkoholischesGetraenk a owl:Class .:Wine a owl:Class ; rdfs:subClassOf :AlcoholicBeverage .:AlcoholicBeverage owl:equivalentWith :AlkoholischesGetraenk .
• via inference it can be entailed that „Wine“ is also an „AlkoholischesGetraenk“
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
30
OWL – Individuals and Class Relationships
:WegelerRheingauRiesling a :Wine ; :isMadeOf :Riesling ; :hasQuality “Spaetlese“ .:Wine a owl:Class ; rdfs:subClassOf AlcoholicBeverage .:AlcoholicBeverage a owl:Class.
• via inference it can be entailed that „WegelerRheingauRiesling“ is an „AlcoholicBeverage“
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
31
OWL – Relationships among Individuals
• via inference it can be entailed that „WRR012345“ is an „AlcoholicBeverage“
• Difference of Individuals via owl:differentFrom
:WegelerRheingauRiesling a :Wine ; :isMadeOf :Riesling ; :hasQuality “Spaetlese“ ; owl:sameAs :WRR012345 .:Wine a owl:Class ; rdfs:subClassOf :AlcoholicBeverage .:AlcoholicBeverage a owl:Class.
:WRR012346 a :Wine ; owl:differentFrom :WRR012345 .
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
32
OWL – Relationships among Individuals
• Abbreviation instead of writing many times owl:differentFrom.
_:x1 a owl:AllDifferent ; owl:distinctMembers (:WegelerRheingauRiesling :AltoAdigeChardonnay :ChateauxLafiteRothschild :MarquesDeRiscal) .
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
33
OWL – Enumerated Classes (Nominals)
• This says that there are only exactly two redwines available in the store.
:Wine a owl:Class ;:ChateauxLatourPauillac a :Wine .:ChateauxLafiteRothschild a :Wine .:RedwinesInStore a owl:Class ; owl:oneOf (:ChateauxLatourPauillac, :ChateauxLafiteRothschild) .
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
34
OWL – Class Membership (2)
• We define an additional third wine
• this entails that “AltoAdigeSauvignonBlanc“ is not available in the store.
:AltoAdigeSauvignonBlanc a :Wine .
_:x1 rdf:type owl:AllDifferent ; owl:distinctMembers (:ChateauxLatourPauillac :ChateauxLafiteRothschild :AltoAdigeSauvignonBlanc) .
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
35
3.5 OWL and OWL Semantics3.5.1 OWL - Overview 3.5.2 OWL1 Syntax - OWL1 document header - OWL1 classes, properties and individuals - OWL1 - complex classes - OWL1 - properties - OWL1 variants - Querying OWL13.5.3 OWL1 Tools3.5.4 OWL Semantics
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
36 • logical AND (conjunction): owl:intersectionOf ⊓
• logical OR (disjunction): owl:unionOf ⊔
• logical negation: owl:complementOf ¬
•Logical constructors are applied to create complex class descriptions from atomic classes.
OWL – Logical Class Constructors
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
37
OWL – Logical Class Constructors
• The class “WineInStore“ results from the intersection of all individuals of the classes “ThingsInStore“ and “Wine“
:Wine a owl:Class .
:ThingsInStore a owl:Class .:WineInStore a owl:Class ; owl:intersectionOf (:Wine :ThingsInStore) .
WineInStore ≣ ThingsInStore ⊓ Wine
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
38
OWL – Logical Class Constructors
• Dry, medium and sweet wines are also wines
:Wine a owl:Class ;
owl:equivalentClass [ owl:unionOf ( :DryWine :MediumWine :SweetWine)
] .
Wine ≣ DryWine ⊔ MediumWine ⊔ SweetWine
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
39
• semantically equivalent assertion:
:Wine a owl:Class ;
rdfs:subClassOf [ owl:complementOf :Pizza
] .
:Wine a owl:Class ;
owl:disjointWith :Pizza .
OWL – Logical Class Constructors
Wine ⊑ ¬Pizza
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
40
OWL – Property Restrictions
• are used to describe complex classes via properties
• restrictions on values:• owl:hasValue! ! !
• owl:allValuesFrom• owl:someValuesFrom
• restrictions on cardinality:• owl:cardinality• owl:minCardinality• owl:maxCardinality
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
41
OWL – Property Restrictions with Constants
• Class „HaraldsCourses“ is described via fixed value assignment (=constant) of the individual „Harald“ to the property „isManagedBy“
HaraldsCourses ⊑ isManagedBy.(Harald)
:HaraldsCourses a owl:Class ; rdfs:subClassOf
[ a owl:Restriction ; owl:onProperty :isManagedBy ; owl:hasValue :Harald ] .
:Person a owl:Class .:Course a owl:Class .
:Harald a :Person .:isManagedBy a owl:ObjectProperty ; rdfs:domain :Course ; rdfs:range :Person .
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
42• owl:allValuesFrom
fixes all instances of a specific class C as allowed range for a property P → (Universal Quantification) ∀P.CWine ⊑ ∀hasProducer.Winemaker
OWL – Property Restrictions
:Wine a owl:Class ; rdfs:subClassOf
[ a owl:Restriction ; owl:onProperty :hasProducer ; owl:allValuesFrom :Winemaker ] .
:Producer a owl:Class .:Product a owl:Class .:Winemaker owl:subClassOf :Producer .
:hasProducer a owl:ObjectProperty ; rdfs:domain :Product ; rdfs:range :Producer .
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
43
• owl:someValuesFromdescribes that there must exist an individual for property P and fixes its range to class C → (existential quantification) ∃P.C
Animals ⊑ ∃feedsOn.Vegetables
OWL – Property Restrictions
:Animals a owl:Class ; rdfs:subClassOf [ a owl:Restriction ; owl:onProperty :feedsOn ; owl:somelValuesFrom :Vegetables ] .
:Animal a owl:Class .:Food a owl:Class .:Vegetables owl:subClassOf :Food .
:feedsOn a owl:ObjectProperty ; rdfs:domain :Animal ; rdfs:range :Food .
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
44
OWL – Cardinality Restrictions
• owl:cardinality restricts to an exact number (for OWL Lite only 1/0)
• owl:minCardinality, owl:maxCardinality restricts to upper / lower bounds
Stringquartett ⊑ (=4)hasMembers
:Stringquartett a owl:Class ; rdfs:subClassOf
[ a owl:Restriction ; owl:onProperty :hasMembers ; owl:cardinality 4 ] .
:hasMembers a owl:DatatypeProperty ; rdfs:domain :Thing ; rdfs:range xsd:integer .
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
45
3.5 OWL and OWL Semantics3.5.1 OWL - Overview 3.5.2 OWL1 Syntax - OWL1 document header - OWL1 classes, properties and individuals - OWL1 - complex classes - OWL1 - properties - OWL1 variants - Querying OWL13.5.3 OWL1 Tools3.5.4 OWL Semantics
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
46
OWL – Property Relationships
• Property hierarchies can be created via specializations: rdfs:subPropertyOf
• Inverse properties are defined via owl:inverseOf• Identical properties are defined via owl:equivalentProperty
:isMadeOf a owl:ObjectProperty ; rdfs:subPropertyOf :consistsOf .
:isProcessedTo a owl:ObjectProperty ; owl:inverseOf :isMadeOf .
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
47 •owl:TransitiveProperty•E.g.: A isPartOf B, B isPartOf C ⇒ A isPartOf C
•owl:SymmetricProperty•E.g.: A isNeighborOf B ⇒ B isNeighborOf A
•owl:FunctionalProperty•E.g.: A hasMother B, A hasMother C ⇒ B=C
•owl:InverseFunctionalProperty•Bsp.: B isMotherOf A, C isMotherOf A ⇒ B=C
OWL – Property Relationships
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
48
OWL – Transitive Properties
•via inference it can be entailed that „Rheinhessen“ is located in „Germany“ .
:isLocatedIn a owl:ObjectProperty ; a owl:TransitiveProperty ; rdfs:domain owl:Thing ; rdfs:range :Region .
:Rheinhessen a :Region ; :isLocatedIn :Hessen .
:Hessen a :Region ; :isLocatedIn :Germany .
:Region a owl:Class .:Germany a :Region .
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
49
3.5 OWL and OWL Semantics3.5.1 OWL - Overview 3.5.2 OWL1 Syntax - OWL1 document header - OWL1 classes, properties and individuals - OWL1 - complex classes - OWL1 - properties - OWL1 variants - Querying OWL13.5.3 OWL1 Tools3.5.4 OWL Semantics
Samstag, 15. Dezember 12
• OWL Lite SHIF(D)
• Subset of OWL DL , rather restricted (no nominal classes, no cardinality, no disjunctiveness)
• Complexity ExpTime (worst case)
• OWL DL (Description Logic) SHOIN (D) or SHROIQ (D) [OWL2]
• formally sound semantics
• decidable, complete, sound
• Complexity NExpTime (worst case)
• OWL Full• Union of OWL Syntax and RDF(S)
• Meta modeling (Nesting)• undecidable (is not a description logic)
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
50
OWL – Web Ontology Language
Lite
DLFull
obsolete...
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
51
OWL FULL
• Unrestricted Usage of all OWL and RDFS language elements (...must be valid RDFS).
• Problems: no strict type separation (classes, properties, individuals), therefore:• owl:Thing is the same as rdfs:Resource
• owl:Class is the same as rdfs:Class
• owl:DatatypeProperty becomes subclass of owl:ObjectProperty
• owl:ObjectProperty is the same as rdfs:Property
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
52
OWL DL
• Only explicitly allowed RDFS language elements are to be used (as e.g. in our examples).• not allowed: rdfs:Class, rdfs:Property
• type separation: • Classes and Properties must be explicitly declared.
• Datatype properties must not be transitive, symmetric, invers, or invers-functional.
• Number restrictions must not be applied with transitive properties, their subproperties, or their inverse properties.
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
53
OWL LITE (obsolete...)
•All restrictions as for OWL DL.•Not allowed:
•oneOf, •unionOf,•complementOf, •hasValue, •disjointWith
•Number restrictions only with 0 and 1.•Some restrictions according anonymous (complex) classes, i.e. in some cases the usage of class names or property names is mandatory.
obsolete...
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
54
3.5 OWL and OWL Semantics3.5.1 OWL - Overview 3.5.2 OWL1 Syntax - OWL1 document header - OWL1 classes, properties and individuals - OWL1 - complex classes - OWL1 - properties - OWL1 variants - Querying OWL13.5.3 OWL1 Tools3.5.4 OWL Semantics
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
55
Terminological OWL Queries
•Class Equivalence•Subclass relationships•Disjunctiveness of classes•Global consistency (satisfiability)•Class consistency: a class is inconsistent, if it is equivalent to owl:Nothing
• indicates often a modeling failure
:Wine a owl:Class;
owl:subClassOf :Beverage; owl:disjointWith :Beverage .
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
56
Assertional OWL Queries
• Class membership: • Does a given individual belong to a specific class?
• Class extension: • Search for all individuals that are contained in a
specific class.
• Property checking:• Are two given individuals connected via a given
property?• Property extension:
• Search or all pairs of individuals that are connected via a specific property.
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
573.5 OWL and OWL Semantics
3.5.1 OWL 1 - Overview 3.5.2 OWL 1 - Syntax3.5.3 OWL 1 - Tools3.5.4 OWL Semantics
3. Knowledge Representation & Logic3.5 OWL and OWL Semantics
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
58
OWL Tools
•Ontology Editors•Protegé, http://protege.stanford.edu•SWOOP, http://www.mindswap.org/2004/SWOOP/•KAON(2) OWL Tools, http://owltools.ontoware.org/
•Inference engines (Reasoner)•Pellet, http://clarkparsia.com/pellet•KAON2, http://kaon2.semanticweb.org•FACT++, http://owl.man.ac.uk/factplusplus/•Racer, http://www.racer-systems.com/•HermiT, http://hermit-reasoner.com/
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
593.5 OWL and OWL Semantics
3.5.1 OWL 1 - Overview 3.5.2 OWL 1 - Syntax3.5.3 OWL 1 - Tools3.5.4 OWL Semantics
3. Knowledge Representation & Logic3.5 OWL and OWL Semantics
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
60
Description Logics revisited
Operator/Constructor Syntax LanguageLanguage
Conjunction A ⊓ B
FLUniversal (Range) Restriction ∀R.C FL
Existential Quantification ∃R
Top ⊤
Bottom ⊥S*
Negation ¬AS*
Disjunction A ⊔ B AL*
Existential (Range) Restriction ∃R.C
AL*
Number Restriction (≤nR) (≥nR)
Enumerated Classes (Nominals) {a1,...,a2}
Property Hierarchy R ⊑ S HH
Inverse Property R-1 II
Qualified Number Restriction (≤nR.C) (≥nR.C) QQ
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
61
Description Logics revisited
•ALC: Attribute Language with Complement
•S: ALC + transitive Properties
•H: Property Hierarchies
•O: Nominals (enumerated classes)
•I: inverse Properties
•N: Number Restrictions ≤n R etc.
•Q: Qualified Number Restrictions ≤n R.C etc.
•(D): Datentype
•F: functional Properties
•R: Property Constructor
•OWL 1 DL is SHOIN(D) / OWL 2 DL is SHROIQ(D)
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
62
OWL1 and ALC
•The following OWL1 DL language elements can be represented in ALC:
•classes, properties, individuals•class membership, property instances•owl:Thing and owl:Nothing•Class subsumption, equivalence, disjunctiveness
•owl:intersectionOf, owl:unionOf•owl:complementOf•owl:allValuesFrom, owl:someValuesFrom•rdfs:range and rdfs:domain
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
63
OWL1 DL as SHOIN(D)
•owl:sameAs•indicates that two individuals denote the same element
•DL: a=b•FOL: extension via equality predicate
•owl:differentFrom•indicates that two individuals denote the different elements
•DL: a≠b•FOL: ¬(a=b)
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
64
OWL1 DL as SHOIN(D)
•Enumerated Classes (Nominals)•owl:oneOf
•defines a class by extension of all its members•DL: C ≡ {a,b,c}•FOL: (∀x) (C(x) ↔ (x=a ∨ x=b ∨ x=c))
•owl:hasValue•„forces“ property to a specific individual•can be represented via owl:someValuesFrom and owl:oneOf
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
65
OWL1 DL as SHOIN(D)
•Number Restrictions
•An examination has at most 2 examiners.•DL: Examination ⊑ ≤2hasExaminer
•FOL: (E… Examination, h…hasExaminer)• (∀x)(E(x) ! ¬((∃x1)(∃x2)(∃x3)
(x1 ≠ x2 Λ x2 ≠ x3 Λ x1 ≠ x3 Λ h(x,x1) Λ h(x,x2) Λ h(x,x3))))
:Examination a owl:Class; rdfs:subClassOf [ a owl:Restriction ; owl:onProperty :hasExaminer; owl:maxCardinality 2 ] .
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
66
OWL1 DL as SHOIN(D)
•Property Hierarchies•rdfs:subPropertyOf
•DL: R ⊑ S
•FOL: (∀x)∀(y)(R(x,y) ! S(x,y))•Property equivalency likewise
•owl:inverseOf•DL: R ≡ S-•FOL: (∀x)(∀y)(R(x,y) ↔ S(y,x))
•owl:TransitiveProperty•DL: R ⊑+ R
•FOL: (∀x)(∀y)(∀z)(R(x,y)ΛR(y,z)!R(x,z))•Symmetric Properties: R ≡ R-•Functional Properties: ⊤ ⊑ ≤1R
•Inverse Functionality: ⊤ ⊑ ≤1R-
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
67
OWL1 DL as SHOIN(D)
•For OWL DL the following is permitted:
•ALC•Equality and Inequality of individuals•Enumerated classes•Number restrictions•Property hierarchies and property equivalences• Inverse and transitive properties•Datatypes
•Datatypes are allowed to use as 2nd argument of datatype properties in the ABox.
•A set of specific typed data might form an enumerated class.•Datatypes cannot simply be expressed in FOL. But FOL
semantics can be extended accordingly.
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
68
OWL1 DL Syntax - Overview
Concepts
Atomic A, B
Not ¬C
And C ⊓ D
Or C ⊔ D
Exists ∃R.C
For all ∀R.C
At least ≥n R.C (≥n R)
At most ≤n R.C (≤n R)
Nominal {i1,...in}
ALC
Q(N)
O
Properties
Atomic Properties
Inverse R-I
Concept Axioms (TBox)Concept Axioms (TBox)
Subclass C ⊑ D
Equivalent C ≡ D
Property Axioms (TBox)Property Axioms (TBox)
Subproperty R ⊑ S
Transitivity R+
Assertional Axioms (ABox)Assertional Axioms (ABox)
Instance C(a)
Property R(a,b)
Same a=b
Different a≠b
HS
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
69
OWL1 DL Syntax - Class Constructors
Constructor DL Syntax Example FOL Syntax
intersectionOf C1 ⊓… ⊓ Cn Person ⊓ Male C1(x)∧…∧Cn(x)
unionOf C1 ⊔… ⊔ Cn Student ⊔ Professor C1(x)⋁…⋁Cn(x)
complementOf ⌐C ⌐ Male ⌐C(x)
oneOf {x1} ⊔… ⊔ {xn} {john} ⊔ {mary} x=x1 ⋁…⋁ x=xn
allValuesFrom ∀P.C ∀attends.Seminar ∀y,P(x,y)→C(y)
someValuesFrom ∃P.C ∃attends.Seminar ∃y,P(x,y)→C(y)
maxCardinality ≤nP ≤2 attends ∃≤n y,P(x,y)
minCardinality ≥nP ≥1 attends ∃≥n y,P(x,y)
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
70
OWL1 DL Syntax - Axioms
Axioms DL Syntax Example
subClassOf C1 ⊑ C2 Human ⊑ Animal ⊓ Biped
equivalentClass C1 ≡ C2 Woman ≡ Human ⊓ Female
disjointWith C1 ⊑ ⌐C2 Male ⊑ ⌐ Female
sameAs {x1} ≡ {x2} {JamesBond} ≡ {007}
differentFrom {x1} ⊑ ⌐{x2} {John} ⊑ ⌐{Mary}
subPropertyOf P1 ⊑ P2 hasDaughter ⊑ hasChild
equivalentProperty P1 ≡ P2 cost ≡ price
inverseOf P1 ≡ P2-
dsdsd
hasChild ≡ hasParent_
TransitiveProperty P1 ⊑+ P2 hasAncester ⊑+ hasAncester
FunctionalProperty ⊤ ⊑ ≤1P ⊤ ⊑ ≤1hasMother
InverseFunctionalProperty ⊤ ⊑ ≤1P_ ⊤ ⊑ ≤1isMotherOf_
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
71
OWL1 DL Syntax
• Nesting of constructors:• Person ⊓
∀hasChild.(Doctor ⊔ ∃hasChild.Doctor)
• General Class Inclusion (⊑) is sufficient:
• C ≡ D iff (C ⊑ D and D ⊑ C)
• Obvious FOL Equivalences
• C ≡ D corresponds to (∀x)(C(x)⟺D(x))
• C ⊑ D corresponds to (∀x)(C(x)⇒D(x))
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
72
OWL1 DL und OWL RDF Syntax
• Person ⊓ ∀hasChild.(Doctor ⊔ ∃hasChild.Doctor)
<owl:Class> <owl:intersectionOf rdf:parseType="collection"> <owl:Class rdf:about="Person"/> <owl:Restriction> <owl:onProperty rdf:resource="hasChild"/> <owl:allValuesFrom> <owl:unionOf rdf:parseType="collection"> <owl:Class rdf:about="Doctor"/> <owl:Restriction> <owl:onProperty rdf:resource="hasChild"/> <owl:someValuesFrom rdf:resource="Doctor"/> </owl:Restriction> </owl:unionOf> </owl:allValuesFrom> </owl:Restriction> </owl:intersectionOf></owl:Class>
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
73
OWL1 DL und OWL RDF Syntax
[ a owl:Class; owl:IntersectionOf ( :person [ a owl:Restriction ; owl:onProperty :hasChild ; owl:allValuesFrom [ owl:unionOf ( :Doctor [ a owl:Restriction ; owl:onProperty :hasChild ; owl:someValuesFrom :Doctor ] ) ] ] )] .
• Person ⊓ ∀hasChild.(Doctor ⊔ ∃hasChild.Doctor)
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
743.5 OWL and OWL Semantics
3.5.1 OWL 1 - Overview 3.5.2 OWL 1 - Syntax3.5.3 OWL 1 - Tools3.5.4 OWL Semantics
3. Knowledge Representation & Logic3.5 OWL and OWL Semantics
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
75 3. Knowledge Representation and LogicsThe Languages of the Semantic Web - Part 2
• Excursion: Ontologies in Philosophy and Computer Science
• Recapitulation: Propositional Logic and First Order Logic
• Description Logics
• RDF(S) Semantics• OWL and OWL-Semantics• OWL 2 and Rules
Semantic Web Technologies Content
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
76
next Lecture
OWL
OWL 2
Extension
SHROIQ(D)
SHOIN(D)
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
77
• P. Hitzler, S. Roschke, Y. Sure: Semantic Web Grundlagen, Springer, 2007.
• P. Hitzler, M. Krötzsch, S. Rudolph:Foundations of Semantic Web Technologies,CRC Press, 2009.
Bibliography
3. Knowledge Representation & Logic3.5 OWL and OWL Semantics
Samstag, 15. Dezember 12
Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
78
□Bloghttp://semweb2013.blogspot.com/
□Webseitehttp://www.hpi.uni-potsdam.de/studium/lehrangebot/itse/veranstaltung/semantic_web_technologien-3.html
□bibsonomy - Bookmarkshttp://www.bibsonomy.org/user/lysander07/swt1213_09
3. Knowledge Representation & Logic3.5 OWL and OWL Semantics
Samstag, 15. Dezember 12