semantic data chapter 3 : the semantic web resource...

68
Semantic Data Chapter 3 : The semantic web resource description framework Jean-Louis Binot 19/02/2020 Semantic Data 1

Upload: others

Post on 19-Jul-2020

13 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Semantic Data Chapter 3 : The semantic web resource ...montefiore.ulg.ac.be/~binot/INFO8005/Theory/Semantic-data-ch3.pdf · Semantic Data Chapter 3 : The semantic web resource description

Semantic Data

Chapter 3 : The semantic web

resource description framework

Jean-Louis Binot

19/02/2020Semantic Data1

Page 2: Semantic Data Chapter 3 : The semantic web resource ...montefiore.ulg.ac.be/~binot/INFO8005/Theory/Semantic-data-ch3.pdf · Semantic Data Chapter 3 : The semantic web resource description

Course content outline

2

Page 3: Semantic Data Chapter 3 : The semantic web resource ...montefiore.ulg.ac.be/~binot/INFO8005/Theory/Semantic-data-ch3.pdf · Semantic Data Chapter 3 : The semantic web resource description

Sources and recommended readings

3

Page 4: Semantic Data Chapter 3 : The semantic web resource ...montefiore.ulg.ac.be/~binot/INFO8005/Theory/Semantic-data-ch3.pdf · Semantic Data Chapter 3 : The semantic web resource description

Agenda

4

Why not HTML or XML ?2

Resource description framework3

The semantic web stack1

RDF Schema4

Page 5: Semantic Data Chapter 3 : The semantic web resource ...montefiore.ulg.ac.be/~binot/INFO8005/Theory/Semantic-data-ch3.pdf · Semantic Data Chapter 3 : The semantic web resource description

The semantic web standards (W3C consortium)

5

Page 6: Semantic Data Chapter 3 : The semantic web resource ...montefiore.ulg.ac.be/~binot/INFO8005/Theory/Semantic-data-ch3.pdf · Semantic Data Chapter 3 : The semantic web resource description

Agenda

6

Why not HTML or XML ?2

Resource description framework3

The semantic web stack1

RDF Schema4

Page 7: Semantic Data Chapter 3 : The semantic web resource ...montefiore.ulg.ac.be/~binot/INFO8005/Theory/Semantic-data-ch3.pdf · Semantic Data Chapter 3 : The semantic web resource description

Why not just HTML ?

7

Page 8: Semantic Data Chapter 3 : The semantic web resource ...montefiore.ulg.ac.be/~binot/INFO8005/Theory/Semantic-data-ch3.pdf · Semantic Data Chapter 3 : The semantic web resource description

Might XML be a better solution ?

8

Page 9: Semantic Data Chapter 3 : The semantic web resource ...montefiore.ulg.ac.be/~binot/INFO8005/Theory/Semantic-data-ch3.pdf · Semantic Data Chapter 3 : The semantic web resource description

Why not just XML : an example

9

lecturer)

Page 10: Semantic Data Chapter 3 : The semantic web resource ...montefiore.ulg.ac.be/~binot/INFO8005/Theory/Semantic-data-ch3.pdf · Semantic Data Chapter 3 : The semantic web resource description

Agenda

10

Why not HTML or XML ?2

Resource description framework3

The semantic web stack1

RDF Schema4

Page 11: Semantic Data Chapter 3 : The semantic web resource ...montefiore.ulg.ac.be/~binot/INFO8005/Theory/Semantic-data-ch3.pdf · Semantic Data Chapter 3 : The semantic web resource description

Basic ideas of the Resource Description Framework (RDF)

11

Page 12: Semantic Data Chapter 3 : The semantic web resource ...montefiore.ulg.ac.be/~binot/INFO8005/Theory/Semantic-data-ch3.pdf · Semantic Data Chapter 3 : The semantic web resource description

Resources

12

Page 13: Semantic Data Chapter 3 : The semantic web resource ...montefiore.ulg.ac.be/~binot/INFO8005/Theory/Semantic-data-ch3.pdf · Semantic Data Chapter 3 : The semantic web resource description

Properties

13

Page 14: Semantic Data Chapter 3 : The semantic web resource ...montefiore.ulg.ac.be/~binot/INFO8005/Theory/Semantic-data-ch3.pdf · Semantic Data Chapter 3 : The semantic web resource description

Statements

14

Page 15: Semantic Data Chapter 3 : The semantic web resource ...montefiore.ulg.ac.be/~binot/INFO8005/Theory/Semantic-data-ch3.pdf · Semantic Data Chapter 3 : The semantic web resource description

The RDF data model is based on directed labelled graphs

15

Page 16: Semantic Data Chapter 3 : The semantic web resource ...montefiore.ulg.ac.be/~binot/INFO8005/Theory/Semantic-data-ch3.pdf · Semantic Data Chapter 3 : The semantic web resource description

Triples with URIs

16

Page 17: Semantic Data Chapter 3 : The semantic web resource ...montefiore.ulg.ac.be/~binot/INFO8005/Theory/Semantic-data-ch3.pdf · Semantic Data Chapter 3 : The semantic web resource description

RDF serialization - Turtle

17

Page 18: Semantic Data Chapter 3 : The semantic web resource ...montefiore.ulg.ac.be/~binot/INFO8005/Theory/Semantic-data-ch3.pdf · Semantic Data Chapter 3 : The semantic web resource description

Namespaces and reference vocabularies

18

Page 19: Semantic Data Chapter 3 : The semantic web resource ...montefiore.ulg.ac.be/~binot/INFO8005/Theory/Semantic-data-ch3.pdf · Semantic Data Chapter 3 : The semantic web resource description

19

Page 21: Semantic Data Chapter 3 : The semantic web resource ...montefiore.ulg.ac.be/~binot/INFO8005/Theory/Semantic-data-ch3.pdf · Semantic Data Chapter 3 : The semantic web resource description

Namespaces ./.

21

Page 22: Semantic Data Chapter 3 : The semantic web resource ...montefiore.ulg.ac.be/~binot/INFO8005/Theory/Semantic-data-ch3.pdf · Semantic Data Chapter 3 : The semantic web resource description

Types of triple elements

22

✓ ✓ ✓

✕ ✕ ✓

✓ ✕ ✓

Page 24: Semantic Data Chapter 3 : The semantic web resource ...montefiore.ulg.ac.be/~binot/INFO8005/Theory/Semantic-data-ch3.pdf · Semantic Data Chapter 3 : The semantic web resource description

Literals and datatypes

24

Page 25: Semantic Data Chapter 3 : The semantic web resource ...montefiore.ulg.ac.be/~binot/INFO8005/Theory/Semantic-data-ch3.pdf · Semantic Data Chapter 3 : The semantic web resource description

Blank nodes

25

Page 26: Semantic Data Chapter 3 : The semantic web resource ...montefiore.ulg.ac.be/~binot/INFO8005/Theory/Semantic-data-ch3.pdf · Semantic Data Chapter 3 : The semantic web resource description

Use of blank nodes for structured data

26

Page 27: Semantic Data Chapter 3 : The semantic web resource ...montefiore.ulg.ac.be/~binot/INFO8005/Theory/Semantic-data-ch3.pdf · Semantic Data Chapter 3 : The semantic web resource description

Instances and typing

27

Page 28: Semantic Data Chapter 3 : The semantic web resource ...montefiore.ulg.ac.be/~binot/INFO8005/Theory/Semantic-data-ch3.pdf · Semantic Data Chapter 3 : The semantic web resource description

Syntactic sugar

28

Page 29: Semantic Data Chapter 3 : The semantic web resource ...montefiore.ulg.ac.be/~binot/INFO8005/Theory/Semantic-data-ch3.pdf · Semantic Data Chapter 3 : The semantic web resource description

The Mona Lisa example in Turtle

29

Page 30: Semantic Data Chapter 3 : The semantic web resource ...montefiore.ulg.ac.be/~binot/INFO8005/Theory/Semantic-data-ch3.pdf · Semantic Data Chapter 3 : The semantic web resource description

Reification

30

Page 32: Semantic Data Chapter 3 : The semantic web resource ...montefiore.ulg.ac.be/~binot/INFO8005/Theory/Semantic-data-ch3.pdf · Semantic Data Chapter 3 : The semantic web resource description

The Mona Lisa example in RDF/XML

32

Page 34: Semantic Data Chapter 3 : The semantic web resource ...montefiore.ulg.ac.be/~binot/INFO8005/Theory/Semantic-data-ch3.pdf · Semantic Data Chapter 3 : The semantic web resource description

RDFa example

34

Page 35: Semantic Data Chapter 3 : The semantic web resource ...montefiore.ulg.ac.be/~binot/INFO8005/Theory/Semantic-data-ch3.pdf · Semantic Data Chapter 3 : The semantic web resource description

A review snippet from Google

35

Page 36: Semantic Data Chapter 3 : The semantic web resource ...montefiore.ulg.ac.be/~binot/INFO8005/Theory/Semantic-data-ch3.pdf · Semantic Data Chapter 3 : The semantic web resource description

Triples generated from the review snipet

36

Page 37: Semantic Data Chapter 3 : The semantic web resource ...montefiore.ulg.ac.be/~binot/INFO8005/Theory/Semantic-data-ch3.pdf · Semantic Data Chapter 3 : The semantic web resource description

Formal semantics of RDF

37

Page 38: Semantic Data Chapter 3 : The semantic web resource ...montefiore.ulg.ac.be/~binot/INFO8005/Theory/Semantic-data-ch3.pdf · Semantic Data Chapter 3 : The semantic web resource description

Semantics of RDF graphs

38

∃ ∧

Page 39: Semantic Data Chapter 3 : The semantic web resource ...montefiore.ulg.ac.be/~binot/INFO8005/Theory/Semantic-data-ch3.pdf · Semantic Data Chapter 3 : The semantic web resource description

Semantics of RDF graphs ./.

◼ I I I I

◼ I I

◼ ⊨

39

Page 40: Semantic Data Chapter 3 : The semantic web resource ...montefiore.ulg.ac.be/~binot/INFO8005/Theory/Semantic-data-ch3.pdf · Semantic Data Chapter 3 : The semantic web resource description

The interpolation lemma

◼ ⊨

40

Page 41: Semantic Data Chapter 3 : The semantic web resource ...montefiore.ulg.ac.be/~binot/INFO8005/Theory/Semantic-data-ch3.pdf · Semantic Data Chapter 3 : The semantic web resource description

Interpolation lemma: example

❑ ⊨

❑ ⊭

41

Page 42: Semantic Data Chapter 3 : The semantic web resource ...montefiore.ulg.ac.be/~binot/INFO8005/Theory/Semantic-data-ch3.pdf · Semantic Data Chapter 3 : The semantic web resource description

Agenda

42

Why not HTML or XML ?2

Resource description framework3

The semantic web stack1

RDF Schema4

Page 43: Semantic Data Chapter 3 : The semantic web resource ...montefiore.ulg.ac.be/~binot/INFO8005/Theory/Semantic-data-ch3.pdf · Semantic Data Chapter 3 : The semantic web resource description

Motivation for RDFS

43

Page 44: Semantic Data Chapter 3 : The semantic web resource ...montefiore.ulg.ac.be/~binot/INFO8005/Theory/Semantic-data-ch3.pdf · Semantic Data Chapter 3 : The semantic web resource description

Example of a simple RDFS ontology

44

RDFS

Page 45: Semantic Data Chapter 3 : The semantic web resource ...montefiore.ulg.ac.be/~binot/INFO8005/Theory/Semantic-data-ch3.pdf · Semantic Data Chapter 3 : The semantic web resource description

RDFS basic ideas

http://www.w3.org/2000/01/rdf-schema#>

45

Page 46: Semantic Data Chapter 3 : The semantic web resource ...montefiore.ulg.ac.be/~binot/INFO8005/Theory/Semantic-data-ch3.pdf · Semantic Data Chapter 3 : The semantic web resource description

RDFS main constructs

46

Construct (construct type) Syntactic form Description

Class (a class) C rdf:type rdfs:Class C (a resource) is an RDF class

Property (a class) P rdf:type rdf:Property P (a resource) is an RDF property

type (a property) I rdf:type C I (a resource) is an instance of C (a class)

subClassOf (a property) C1 rdfs:subClassOf C2 C1 (a class) is a subclass of C2 (a class)

subPropertyOf (a property) P1 rdfs:subPropertyOf P2 P1 (a property) is a sub-property of P2 (a property)

domain (a property) P rdfs:domain C domain of P (a property) is C (a class)

range (a property) P rdfs:range C range of P (a property) is C (a class)

Page 47: Semantic Data Chapter 3 : The semantic web resource ...montefiore.ulg.ac.be/~binot/INFO8005/Theory/Semantic-data-ch3.pdf · Semantic Data Chapter 3 : The semantic web resource description

Defining classes and instances

47

Page 48: Semantic Data Chapter 3 : The semantic web resource ...montefiore.ulg.ac.be/~binot/INFO8005/Theory/Semantic-data-ch3.pdf · Semantic Data Chapter 3 : The semantic web resource description

Defining classes and instances ./.

48

Page 49: Semantic Data Chapter 3 : The semantic web resource ...montefiore.ulg.ac.be/~binot/INFO8005/Theory/Semantic-data-ch3.pdf · Semantic Data Chapter 3 : The semantic web resource description

More on RDFS classes

49

Page 50: Semantic Data Chapter 3 : The semantic web resource ...montefiore.ulg.ac.be/~binot/INFO8005/Theory/Semantic-data-ch3.pdf · Semantic Data Chapter 3 : The semantic web resource description

Subsumption

50

Page 51: Semantic Data Chapter 3 : The semantic web resource ...montefiore.ulg.ac.be/~binot/INFO8005/Theory/Semantic-data-ch3.pdf · Semantic Data Chapter 3 : The semantic web resource description

Class hierarchy and instances

51

Page 52: Semantic Data Chapter 3 : The semantic web resource ...montefiore.ulg.ac.be/~binot/INFO8005/Theory/Semantic-data-ch3.pdf · Semantic Data Chapter 3 : The semantic web resource description

Example of hierarchy with corresponding triples

52

Page 53: Semantic Data Chapter 3 : The semantic web resource ...montefiore.ulg.ac.be/~binot/INFO8005/Theory/Semantic-data-ch3.pdf · Semantic Data Chapter 3 : The semantic web resource description

Defining Properties

53

Page 54: Semantic Data Chapter 3 : The semantic web resource ...montefiore.ulg.ac.be/~binot/INFO8005/Theory/Semantic-data-ch3.pdf · Semantic Data Chapter 3 : The semantic web resource description

Range and domain of properties

54

Page 55: Semantic Data Chapter 3 : The semantic web resource ...montefiore.ulg.ac.be/~binot/INFO8005/Theory/Semantic-data-ch3.pdf · Semantic Data Chapter 3 : The semantic web resource description

Range and domain inference rules

55

Page 56: Semantic Data Chapter 3 : The semantic web resource ...montefiore.ulg.ac.be/~binot/INFO8005/Theory/Semantic-data-ch3.pdf · Semantic Data Chapter 3 : The semantic web resource description

Specialization of properties

56

Page 57: Semantic Data Chapter 3 : The semantic web resource ...montefiore.ulg.ac.be/~binot/INFO8005/Theory/Semantic-data-ch3.pdf · Semantic Data Chapter 3 : The semantic web resource description

Complex cases for range and domain of properties

57

Page 58: Semantic Data Chapter 3 : The semantic web resource ...montefiore.ulg.ac.be/~binot/INFO8005/Theory/Semantic-data-ch3.pdf · Semantic Data Chapter 3 : The semantic web resource description

Multiple range or domain statements

58

Page 59: Semantic Data Chapter 3 : The semantic web resource ...montefiore.ulg.ac.be/~binot/INFO8005/Theory/Semantic-data-ch3.pdf · Semantic Data Chapter 3 : The semantic web resource description

59

Page 60: Semantic Data Chapter 3 : The semantic web resource ...montefiore.ulg.ac.be/~binot/INFO8005/Theory/Semantic-data-ch3.pdf · Semantic Data Chapter 3 : The semantic web resource description

RDFS Semantics

60

Page 62: Semantic Data Chapter 3 : The semantic web resource ...montefiore.ulg.ac.be/~binot/INFO8005/Theory/Semantic-data-ch3.pdf · Semantic Data Chapter 3 : The semantic web resource description

Revisiting the example from chapter 1

62

(example after Paulheim, Semantic Web Technologies)

Page 63: Semantic Data Chapter 3 : The semantic web resource ...montefiore.ulg.ac.be/~binot/INFO8005/Theory/Semantic-data-ch3.pdf · Semantic Data Chapter 3 : The semantic web resource description

Revisiting the example from chapter 1

63

(example after Paulheim, Semantic Web Technologies)

Page 64: Semantic Data Chapter 3 : The semantic web resource ...montefiore.ulg.ac.be/~binot/INFO8005/Theory/Semantic-data-ch3.pdf · Semantic Data Chapter 3 : The semantic web resource description

More on the limitations of RDFS

64

(after Antoniou and Van Harmelen 2004)

Page 65: Semantic Data Chapter 3 : The semantic web resource ...montefiore.ulg.ac.be/~binot/INFO8005/Theory/Semantic-data-ch3.pdf · Semantic Data Chapter 3 : The semantic web resource description

Summary

65

Page 66: Semantic Data Chapter 3 : The semantic web resource ...montefiore.ulg.ac.be/~binot/INFO8005/Theory/Semantic-data-ch3.pdf · Semantic Data Chapter 3 : The semantic web resource description

Annex : RDF/RDFS entailment patterns

If S contains: then S RDF(S)_entails :

rdfD1 a p "v"^^d . a p _:b . _b rdf:type d .

rdfD2 a p b . p rdf:type rdf:Property .

rdfs1 any IRI a in D a rdf:type rdfs:Datatype .

rdfs2p rdfs:domain x .

a p b .a rdf:type x .

rdfs3p rdfs:range x .

a p b .b rdf:type x .

rdfs4a a p b . a rdf:type rdf:Resource .

rdfs4b a p b . b rdf:type rdf:Resource .

rdfs5p rdfs:subPropertyOf q .

q rdfs:subPropertyOf r .p rdfs:subPropertyOf r .

rdfs6 a rdf:type rdf:Property . a rdfs:subPropertyOf a .

rdfs7rdfs:subPropertyOf q .

a p b.a q b .

rdfs8 c rdf:type rdfs:Class . c rdfs:subClassOf rdf:Resource .

rdfs9c rdfs:subClassOf d .

a rdf:type c.a rdf:type d .

rdfs10 c rdf:type rdfs:Class . c rdfs:subClassOf c .

rdfs11c rdfs:subClassOf d .

d rdfs:subClassOf e .c rdfs:subClassOf e .

rdfs12 rdf:type rdfs:ContainerMembershipProperty . p rdfs:subPropertyOf rdfs:member .

rdfs13 d rdf:type rdfs:Datatype . d rdfs:subClassOf rdfs:Literal .

66

Page 67: Semantic Data Chapter 3 : The semantic web resource ...montefiore.ulg.ac.be/~binot/INFO8005/Theory/Semantic-data-ch3.pdf · Semantic Data Chapter 3 : The semantic web resource description

References

67

Page 68: Semantic Data Chapter 3 : The semantic web resource ...montefiore.ulg.ac.be/~binot/INFO8005/Theory/Semantic-data-ch3.pdf · Semantic Data Chapter 3 : The semantic web resource description

THANK YOU

68