OpenHPI 5.4 - Web Ontology Language

34
This file is licensed under the Creative Commons Attribution-NonCommercial 3.0 (CC BY-NC 3.0 ) Dr. Harald Sack Hasso Plattner Institute for IT Systems Engineering University of Potsdam Spring 2013 Semantic Web Technologies Lecture 5: Knowledge Representations II 04: Web Ontology Language - OWL

description

 

Transcript of OpenHPI 5.4 - Web Ontology Language

Page 1: OpenHPI 5.4 - Web Ontology Language

This file is licensed under the Creative Commons Attribution-NonCommercial 3.0 (CC BY-NC 3.0)

Dr. Harald Sack

Hasso Plattner Institute for IT Systems Engineering

University of Potsdam

Spring 2013

Semantic Web Technologies

Lecture 5: Knowledge Representations II04: Web Ontology Language - OWL

Page 2: OpenHPI 5.4 - Web Ontology Language

Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

2

Lecture 5: Knowledge Representations II

Open HPI - Course: Semantic Web Technologies

Page 3: OpenHPI 5.4 - Web Ontology Language

Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

3

04 Web Ontology Language - OWLOpen HPI - Course: Semantic Web Technologies - Lecture 5: Knowledge Representations II

Page 4: OpenHPI 5.4 - Web Ontology Language

Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamTurmbau zu Babel, Pieter Brueghel, 1563

4• OWL (SHOIN(D))- W3C Recommendation since 2004

• OWL 2 (SHROIQ(D))- W3C Recommendation since 2009

OWL – Web Ontology Language

Page 5: OpenHPI 5.4 - Web Ontology Language

Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamTurmbau zu Babel, Pieter Brueghel, 1563

4• OWL (SHOIN(D))- W3C Recommendation since 2004

• OWL 2 (SHROIQ(D))- W3C Recommendation since 2009

• OWL Ontology consists of

OWL – Web Ontology Language

Page 6: OpenHPI 5.4 - Web Ontology Language

Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamTurmbau zu Babel, Pieter Brueghel, 1563

4• OWL (SHOIN(D))- W3C Recommendation since 2004

• OWL 2 (SHROIQ(D))- W3C Recommendation since 2009

• OWL Ontology consists of

• Classes / properties / individuals (instances of classes)

OWL – Web Ontology Language

Page 7: OpenHPI 5.4 - Web Ontology Language

Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamTurmbau zu Babel, Pieter Brueghel, 1563

4• OWL (SHOIN(D))- W3C Recommendation since 2004

• OWL 2 (SHROIQ(D))- W3C Recommendation since 2009

• OWL Ontology consists of

• Classes / properties / individuals (instances of classes)

• Open World Assumption

OWL – Web Ontology Language

Page 8: OpenHPI 5.4 - Web Ontology Language

Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamTurmbau zu Babel, Pieter Brueghel, 1563

4• OWL (SHOIN(D))- W3C Recommendation since 2004

• OWL 2 (SHROIQ(D))- 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.“

OWL – Web Ontology Language

Page 9: OpenHPI 5.4 - Web Ontology Language

Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamTurmbau zu Babel, Pieter Brueghel, 1563

4• OWL (SHOIN(D))- W3C Recommendation since 2004

• OWL 2 (SHROIQ(D))- 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 may also sit next to another person…

OWL – Web Ontology Language

Page 10: OpenHPI 5.4 - Web Ontology Language

Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamTurmbau zu Babel, Pieter Brueghel, 1563

4• OWL (SHOIN(D))- W3C Recommendation since 2004

• OWL 2 (SHROIQ(D))- 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 may also sit next to another person…

• No Unique Name Assumption

OWL – Web Ontology Language

Page 11: OpenHPI 5.4 - Web Ontology Language

Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamTurmbau zu Babel, Pieter Brueghel, 1563

4• OWL (SHOIN(D))- W3C Recommendation since 2004

• OWL 2 (SHROIQ(D))- 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 may also sit next to another person…

• No Unique Name Assumption

• „Difference must be expressed explicitly“

OWL – Web Ontology Language

Page 12: OpenHPI 5.4 - Web Ontology Language

Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamTurmbau zu Babel, Pieter Brueghel, 1563

4• OWL (SHOIN(D))- W3C Recommendation since 2004

• OWL 2 (SHROIQ(D))- 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 may also sit next to another person…

• No Unique Name Assumption

• „Difference must be expressed explicitly“

• E.g.: PersonA possibly denotes the same individual as PersonB

OWL – Web Ontology Language

Page 13: OpenHPI 5.4 - Web Ontology Language

Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamTurmbau zu Babel, Pieter Brueghel, 1563

5

OWL – Web Ontology Language

• OWL is a semantic fragment of FOL

• OWL exists in different flavors

FOL

SWRL/RIF OWL Full

OWL DL

OWL Lite RDFS

ConceptHierarchies

OWL ELOWL RLOWL QL

Page 14: OpenHPI 5.4 - Web Ontology Language

Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamTurmbau zu Babel, Pieter Brueghel, 1563

5

OWL – Web Ontology Language

• OWL is a semantic fragment of FOL

• OWL exists in different flavors

• OWL Lite ⊆ OWL DL ⊆ OWL Full

FOL

SWRL/RIF OWL Full

OWL DL

OWL Lite RDFS

ConceptHierarchies

OWL ELOWL RLOWL QL

Page 15: OpenHPI 5.4 - Web Ontology Language

OWL1

OWL1Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

Turmbau zu Babel, Pieter Brueghel, 1563

5

OWL – Web Ontology Language

• OWL is a semantic fragment of FOL

• OWL exists in different flavors

• OWL Lite ⊆ OWL DL ⊆ OWL Full

FOL

SWRL/RIF OWL Full

OWL DL

OWL Lite RDFS

ConceptHierarchies

OWL ELOWL RLOWL QL

Page 16: OpenHPI 5.4 - Web Ontology Language

Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamTurmbau zu Babel, Pieter Brueghel, 1563

6

OWL – Web Ontology Language

• OWL is a semantic fragment of FOL

• OWL exists in different flavors

• OWL Lite ⊆ OWL DL ⊆ OWL Full

• for OWL2:FOL

SWRL/RIF OWL Full

OWL DL

OWL Lite RDFSOWL ELOWL RLOWL QL

OWL2

ConceptHierarchies

Page 17: OpenHPI 5.4 - Web Ontology Language

Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamTurmbau zu Babel, Pieter Brueghel, 1563

6

OWL – Web Ontology Language

• OWL is a semantic fragment of FOL

• OWL exists in different flavors

• 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

ConceptHierarchies

Page 18: OpenHPI 5.4 - Web Ontology Language

OWL2Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

Turmbau zu Babel, Pieter Brueghel, 1563

6

OWL – Web Ontology Language

• OWL is a semantic fragment of FOL

• OWL exists in different flavors

• 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

ConceptHierarchies

Page 19: OpenHPI 5.4 - Web Ontology Language

Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamTurmbau zu Babel, Pieter Brueghel, 1563

7

OWL 1 DL is based on SHOIN(D)

• Axioms

Page 20: OpenHPI 5.4 - Web Ontology Language

Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamTurmbau zu Babel, Pieter Brueghel, 1563

7

OWL 1 DL is based on SHOIN(D)

• Axioms

• TBox: subclass relationships C ⊑ D

Page 21: OpenHPI 5.4 - Web Ontology Language

Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamTurmbau zu Babel, Pieter Brueghel, 1563

7

OWL 1 DL is based on SHOIN(D)

• Axioms

• TBox: subclass relationships C ⊑ D

• RBox: subproperty relationships R ⊑ S (H),

inverse properties R- (I), transitivity ⊑+ (S)

Page 22: OpenHPI 5.4 - Web Ontology Language

Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamTurmbau zu Babel, Pieter Brueghel, 1563

7

OWL 1 DL is based on SHOIN(D)

• Axioms

• TBox: subclass relationships C ⊑ D

• RBox: subproperty relationships R ⊑ S (H),

inverse properties R- (I), transitivity ⊑+ (S)

• ABox: facts for classes C(a), properties R(a,b), equality a=b, difference a≠b

Page 23: OpenHPI 5.4 - Web Ontology Language

Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamTurmbau zu Babel, Pieter Brueghel, 1563

7

OWL 1 DL is based on SHOIN(D)

• Axioms

• TBox: subclass relationships C ⊑ D

• RBox: subproperty relationships R ⊑ S (H),

inverse properties R- (I), transitivity ⊑+ (S)

• ABox: facts for classes C(a), properties R(a,b), equality a=b, difference a≠b

•Class constructors:

Page 24: OpenHPI 5.4 - Web Ontology Language

Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamTurmbau zu Babel, Pieter Brueghel, 1563

7

OWL 1 DL is based on SHOIN(D)

• Axioms

• TBox: subclass relationships C ⊑ D

• RBox: subproperty relationships R ⊑ S (H),

inverse properties R- (I), transitivity ⊑+ (S)

• ABox: facts for classes C(a), properties R(a,b), equality a=b, difference a≠b

•Class constructors:

• conjunction C⊓D, disjunction C⊔D, negation ¬C of classes

Page 25: OpenHPI 5.4 - Web Ontology Language

Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamTurmbau zu Babel, Pieter Brueghel, 1563

7

OWL 1 DL is based on SHOIN(D)

• Axioms

• TBox: subclass relationships C ⊑ D

• RBox: subproperty relationships R ⊑ S (H),

inverse properties R- (I), transitivity ⊑+ (S)

• ABox: facts for classes C(a), properties R(a,b), equality a=b, difference a≠b

•Class constructors:

• conjunction C⊓D, disjunction C⊔D, negation ¬C of classes

• property restrictions: universal ∀R.C and existential ∃R.C

Page 26: OpenHPI 5.4 - Web Ontology Language

Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamTurmbau zu Babel, Pieter Brueghel, 1563

7

OWL 1 DL is based on SHOIN(D)

• Axioms

• TBox: subclass relationships C ⊑ D

• RBox: subproperty relationships R ⊑ S (H),

inverse properties R- (I), transitivity ⊑+ (S)

• ABox: facts for classes C(a), properties R(a,b), equality a=b, difference a≠b

•Class constructors:

• conjunction C⊓D, disjunction C⊔D, negation ¬C of classes

• property restrictions: universal ∀R.C and existential ∃R.C

• number restrictions: ≤n R and ≥n R (N)

Page 27: OpenHPI 5.4 - Web Ontology Language

Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamTurmbau zu Babel, Pieter Brueghel, 1563

7

OWL 1 DL is based on SHOIN(D)

• Axioms

• TBox: subclass relationships C ⊑ D

• RBox: subproperty relationships R ⊑ S (H),

inverse properties R- (I), transitivity ⊑+ (S)

• ABox: facts for classes C(a), properties R(a,b), equality a=b, difference a≠b

•Class constructors:

• conjunction C⊓D, disjunction C⊔D, negation ¬C of classes

• property restrictions: universal ∀R.C and existential ∃R.C

• number restrictions: ≤n R and ≥n R (N)

• closed classes (nominals): {a} (O)

Page 28: OpenHPI 5.4 - Web Ontology Language

Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamTurmbau zu Babel, Pieter Brueghel, 1563

7

OWL 1 DL is based on SHOIN(D)

• Axioms

• TBox: subclass relationships C ⊑ D

• RBox: subproperty relationships R ⊑ S (H),

inverse properties R- (I), transitivity ⊑+ (S)

• ABox: facts for classes C(a), properties R(a,b), equality a=b, difference a≠b

•Class constructors:

• conjunction C⊓D, disjunction C⊔D, negation ¬C of classes

• property restrictions: universal ∀R.C and existential ∃R.C

• number restrictions: ≤n R and ≥n R (N)

• closed classes (nominals): {a} (O)

•Datatypes (D)

Page 29: OpenHPI 5.4 - Web Ontology Language

Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

8

• 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 Syntax Variants

Page 30: OpenHPI 5.4 - Web Ontology Language

Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

9

OWL 2 - Functional Syntax

SubClassOf(  :Teenager DataSomeValuesFrom( :hasAge DatatypeRestriction( xsd:integer xsd:minExclusive "12"^^xsd:integer xsd:maxInclusive "19"^^xsd:integer ) ) )SubClassOf( :Woman :Person )SubClassOf( :Mother :Woman )...SubObjectPropertyOf( :hasWife :hasSpouse )SymmetricObjectProperty( :hasSpouse ) AsymmetricObjectProperty( :hasChild )...Declaration( NamedIndividual( :John ) )Declaration( NamedIndividual( :Mary ) )Declaration( NamedIndividual( :Jim ) )...ClassAssertion( :Person :Mary )ClassAssertion( :Woman :Mary )...ObjectPropertyAssertion( :hasWife :John :Mary )NegativeObjectPropertyAssertion( :hasWife :Bill :Mary )

Page 31: OpenHPI 5.4 - Web Ontology Language

Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

10

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 ,...

ObjectProperty: hasWife Annotations: ... Characteristics: Functional, InverseFunctional, Reflexive, Irreflexive, Asymmetric, Transitive Domain: Man Range: Person, Woman SubPropertyOf: hasSpouse, loves EquivalentTo: isMarriedTo ,... DisjointWith: hates ,... InverseOf: hasSpouse

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 ,...

Page 32: OpenHPI 5.4 - Web Ontology Language

Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

11

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 ] ) ].

Page 33: OpenHPI 5.4 - Web Ontology Language

Vorlesung Semantic Web, Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

12

Standard Namespaces and Prefixes

(cf. http://www.w3.org/TR/owl2-syntax/ )

http://prefix.cc/

Page 34: OpenHPI 5.4 - Web Ontology Language

Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

13

05 Web Ontology Language - OWL (Part 2)Open HPI - Course: Semantic Web Technologies - Lecture 5: Knowledge Representations II