27
Semantic Data Chapter 7 : The semantic web query language SPARQL Jean-Louis Binot 1 18/03/2020 Semantic Data

Semantic Data Chapter 7 : The semantic web query ...Semantic Data Chapter 7 : The semantic web query language SPARQL Jean-Louis Binot 1 Semantic Data 18/03/2020 Sources 2 Agenda 1

  • Upload
    others

  • View
    14

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Semantic Data Chapter 7 : The semantic web query ...Semantic Data Chapter 7 : The semantic web query language SPARQL Jean-Louis Binot 1 Semantic Data 18/03/2020 Sources 2 Agenda 1

Semantic Data

Chapter 7 : The semantic web query language

SPARQL

Jean-Louis Binot

1 18/03/2020Semantic Data

Page 3: Semantic Data Chapter 7 : The semantic web query ...Semantic Data Chapter 7 : The semantic web query language SPARQL Jean-Louis Binot 1 Semantic Data 18/03/2020 Sources 2 Agenda 1

Agenda

Querying RDF graphs1

SPARQL syntax and semantics2

Entailment regimes and OWL3

3

Page 4: Semantic Data Chapter 7 : The semantic web query ...Semantic Data Chapter 7 : The semantic web query language SPARQL Jean-Louis Binot 1 Semantic Data 18/03/2020 Sources 2 Agenda 1

What is SPARQL ?

SPARQL engine

SPARQL queries

SPARQL updatesRDF dataset

RDF store

4

Page 5: Semantic Data Chapter 7 : The semantic web query ...Semantic Data Chapter 7 : The semantic web query language SPARQL Jean-Louis Binot 1 Semantic Data 18/03/2020 Sources 2 Agenda 1

Graph matching: basic idea

Dataset

Query pattern

Result

5

Page 6: Semantic Data Chapter 7 : The semantic web query ...Semantic Data Chapter 7 : The semantic web query language SPARQL Jean-Louis Binot 1 Semantic Data 18/03/2020 Sources 2 Agenda 1

Graph matching: basic idea

6

Page 7: Semantic Data Chapter 7 : The semantic web query ...Semantic Data Chapter 7 : The semantic web query language SPARQL Jean-Louis Binot 1 Semantic Data 18/03/2020 Sources 2 Agenda 1

Graph matching: basic idea ./.

Dataset

Query pattern

Result

7

Page 8: Semantic Data Chapter 7 : The semantic web query ...Semantic Data Chapter 7 : The semantic web query language SPARQL Jean-Louis Binot 1 Semantic Data 18/03/2020 Sources 2 Agenda 1

Graph matching: combining triples

DatasetQuery pattern

Result

8

Page 9: Semantic Data Chapter 7 : The semantic web query ...Semantic Data Chapter 7 : The semantic web query language SPARQL Jean-Louis Binot 1 Semantic Data 18/03/2020 Sources 2 Agenda 1

Graph matching: traversing a graph

DatasetQuery pattern

Result

9

Page 10: Semantic Data Chapter 7 : The semantic web query ...Semantic Data Chapter 7 : The semantic web query language SPARQL Jean-Louis Binot 1 Semantic Data 18/03/2020 Sources 2 Agenda 1

Agenda

Querying RDF graphs1

SPARQL syntax and semantics2

Entailment regimes and OWL3

10

Page 11: Semantic Data Chapter 7 : The semantic web query ...Semantic Data Chapter 7 : The semantic web query language SPARQL Jean-Louis Binot 1 Semantic Data 18/03/2020 Sources 2 Agenda 1

A full example

SPARQL QUERY ENDPOINT

http://librdf.org/query/

DATASET FILE (Turtle)

RDF/XML

11

Page 12: Semantic Data Chapter 7 : The semantic web query ...Semantic Data Chapter 7 : The semantic web query language SPARQL Jean-Louis Binot 1 Semantic Data 18/03/2020 Sources 2 Agenda 1

SPARQL basic query structure

12

Page 13: Semantic Data Chapter 7 : The semantic web query ...Semantic Data Chapter 7 : The semantic web query language SPARQL Jean-Louis Binot 1 Semantic Data 18/03/2020 Sources 2 Agenda 1

Graph patterns

13

Page 14: Semantic Data Chapter 7 : The semantic web query ...Semantic Data Chapter 7 : The semantic web query language SPARQL Jean-Louis Binot 1 Semantic Data 18/03/2020 Sources 2 Agenda 1

Examples

14

Page 15: Semantic Data Chapter 7 : The semantic web query ...Semantic Data Chapter 7 : The semantic web query language SPARQL Jean-Louis Binot 1 Semantic Data 18/03/2020 Sources 2 Agenda 1

Matching literals and blank nodes

15

Page 16: Semantic Data Chapter 7 : The semantic web query ...Semantic Data Chapter 7 : The semantic web query language SPARQL Jean-Louis Binot 1 Semantic Data 18/03/2020 Sources 2 Agenda 1

Query modifiers

16

Page 17: Semantic Data Chapter 7 : The semantic web query ...Semantic Data Chapter 7 : The semantic web query language SPARQL Jean-Louis Binot 1 Semantic Data 18/03/2020 Sources 2 Agenda 1

Query form DESCRIBE

17

Page 18: Semantic Data Chapter 7 : The semantic web query ...Semantic Data Chapter 7 : The semantic web query language SPARQL Jean-Louis Binot 1 Semantic Data 18/03/2020 Sources 2 Agenda 1

Aggregates

18

Page 19: Semantic Data Chapter 7 : The semantic web query ...Semantic Data Chapter 7 : The semantic web query language SPARQL Jean-Louis Binot 1 Semantic Data 18/03/2020 Sources 2 Agenda 1

Semantics of an answer to a graph pattern query

◼ ⊨

19

Page 20: Semantic Data Chapter 7 : The semantic web query ...Semantic Data Chapter 7 : The semantic web query language SPARQL Jean-Louis Binot 1 Semantic Data 18/03/2020 Sources 2 Agenda 1

Agenda

Querying RDF graphs1

SPARQL syntax and semantics2

Entailment regimes and OWL3

20

Page 21: Semantic Data Chapter 7 : The semantic web query ...Semantic Data Chapter 7 : The semantic web query language SPARQL Jean-Louis Binot 1 Semantic Data 18/03/2020 Sources 2 Agenda 1

Beyond RDF ?

21

Page 22: Semantic Data Chapter 7 : The semantic web query ...Semantic Data Chapter 7 : The semantic web query language SPARQL Jean-Louis Binot 1 Semantic Data 18/03/2020 Sources 2 Agenda 1

Reminder : RDF/RDFS entailment patterns

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

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

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

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

p rdfs:domain x .

a p b .a rdf:type x .

p rdfs:range x .

a p b .b rdf:type x .

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

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

p rdfs:subPropertyOf q .

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

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

rdfs:subPropertyOf q .

a p b.a q b .

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

c rdfs:subClassOf d .

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

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

c rdfs:subClassOf d .

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

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

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

22

Page 23: Semantic Data Chapter 7 : The semantic web query ...Semantic Data Chapter 7 : The semantic web query language SPARQL Jean-Louis Binot 1 Semantic Data 18/03/2020 Sources 2 Agenda 1

Influence of entailment regime

23

Page 24: Semantic Data Chapter 7 : The semantic web query ...Semantic Data Chapter 7 : The semantic web query language SPARQL Jean-Louis Binot 1 Semantic Data 18/03/2020 Sources 2 Agenda 1

Querying OWL with SPARQL

24

Page 25: Semantic Data Chapter 7 : The semantic web query ...Semantic Data Chapter 7 : The semantic web query language SPARQL Jean-Louis Binot 1 Semantic Data 18/03/2020 Sources 2 Agenda 1

Summary

25

Page 26: Semantic Data Chapter 7 : The semantic web query ...Semantic Data Chapter 7 : The semantic web query language SPARQL Jean-Louis Binot 1 Semantic Data 18/03/2020 Sources 2 Agenda 1

References

26

Page 27: Semantic Data Chapter 7 : The semantic web query ...Semantic Data Chapter 7 : The semantic web query language SPARQL Jean-Louis Binot 1 Semantic Data 18/03/2020 Sources 2 Agenda 1

THANK YOU

27