Semantic Data Chapter 3 : The semantic web resource ...Semantic Data Chapter 3 : The semantic web...

65
Semantic Data Chapter 3 : The semantic web resource description framework Jean-Louis Binot 17/02/2021 Semantic Data 1

Transcript of Semantic Data Chapter 3 : The semantic web resource ...Semantic Data Chapter 3 : The semantic web...

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

Semantic Data

Chapter 3 : The semantic web

resource description framework

Jean-Louis Binot

17/02/2021Semantic Data1

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

Course content outline

2

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

Sources and recommended readings

3

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

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 ...Semantic Data Chapter 3 : The semantic web resource description framework Jean-Louis Binot 1 Semantic Data 19/02/2020

The semantic web standards (W3C consortium)

5

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

Industrial relevance

6

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

Agenda

7

Why not HTML or XML ?2

Resource description framework3

The semantic web stack1

RDF Schema4

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

Why not just HTML ?

8

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

Might XML be a better solution ?

9

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

Why not just XML : an example

10

lecturer)

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

Agenda

11

Why not HTML or XML ?2

Resource description framework3

The semantic web stack1

RDF Schema4

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

Basic ideas of the Resource Description Framework (RDF)

12

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

Resources

13

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

Properties

14

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

Statements

15

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

The RDF data model is based on directed labelled graphs

16

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

Triples with URIs

17

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

RDF serialization - Turtle

18

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

Namespaces and reference vocabularies

19

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

20

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

Namespaces ./.

22

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

Types of triple elements

23

✓ ✓ ✓

✕ ✕ ✓

✓ ✕ ✓

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

Literals and datatypes

25

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

Blank nodes

26

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

Instances and typing

27

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

Syntactic sugar

28

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

The Mona Lisa example in Turtle

29

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

Reification

30

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

The Mona Lisa example in RDF/XML

32

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

RDFa example

34

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

Application example : a review snippet from Google

35

[] a ns1:Product ;

ns1:image <catcher-in-the-rye-book-cover.jpg> ;

ns1:name "The Catcher in the Rye" ;

ns1:review [ a ns1:Review ;

ns1:author [ a ns1:Person ;

ns1:name "John Doe" ] ;

ns1:datePublished "2006-05-04" ;

ns1:name "A masterpiece of literature" ;

ns1:publisher [ a ns1:Organization ;

ns1:name "Washington Times" ] ;

ns1:reviewBody "I really enjoyed this book.

It captures the essential challenge people face as

they try make sense of their lives and grow to

adulthood." ;

ns1:reviewRating [ a ns1:Rating ;

ns1:ratingValue "5" ] ] .

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

Formal semantics of RDF

36

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

Semantics of RDF graphs

37

∃ ∧

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

Semantics of RDF graphs ./.

◼ I I I I

◼ I I

◼ ⊨

38

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

The interpolation lemma

◼ ⊨

39

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

Interpolation lemma: example

❑ ⊨

❑ ⊭

40

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

Agenda

41

Why not HTML or XML ?2

Resource description framework3

The semantic web stack1

RDF Schema4

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

Motivation for RDFS

42

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

Example of a simple RDFS ontology

43

RDFS

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

RDFS basic ideas

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

44

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

RDFS main constructs

45

Construct (construct type) Syntactic form Description

Class (a class) C rdf:type rdfs:Class C (a resource) is an RDFS 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 46: Semantic Data Chapter 3 : The semantic web resource ...Semantic Data Chapter 3 : The semantic web resource description framework Jean-Louis Binot 1 Semantic Data 19/02/2020

Defining classes and instances

46

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

Defining classes and instances ./.

47

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

Subsumption

48

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

Class hierarchy and instances

49

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

Example of hierarchy with corresponding triples

50

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

Defining Properties

51

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

Range and domain of properties

52

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

Range and domain inference rules

53

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

Specialization of properties

54

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

Complex cases for range and domain of properties

55

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

Multiple range or domain statements

56

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

57

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

RDFS Semantics

58

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

Revisiting the example from chapter 1

60

(example after Paulheim, Semantic Web Technologies)

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

Revisiting the example from chapter 1

61(example after Paulheim, Semantic Web Technologies)

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

Summary

62

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

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 .

63

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

References

64

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

THANK YOU

65