![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](https://reader034.vdocument.in/reader034/viewer/2022042605/5f5af323200d7767830bf1d3/html5/thumbnails/1.jpg)
Semantic Data
Chapter 7 : The semantic web query language
SPARQL
Jean-Louis Binot
1 18/03/2020Semantic Data
![Page 2: 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](https://reader034.vdocument.in/reader034/viewer/2022042605/5f5af323200d7767830bf1d3/html5/thumbnails/2.jpg)
Sources
❑
❑
◼
◼
◼
❑
◼
◼
◼
2
![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](https://reader034.vdocument.in/reader034/viewer/2022042605/5f5af323200d7767830bf1d3/html5/thumbnails/3.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022042605/5f5af323200d7767830bf1d3/html5/thumbnails/4.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022042605/5f5af323200d7767830bf1d3/html5/thumbnails/5.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022042605/5f5af323200d7767830bf1d3/html5/thumbnails/6.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022042605/5f5af323200d7767830bf1d3/html5/thumbnails/7.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022042605/5f5af323200d7767830bf1d3/html5/thumbnails/8.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022042605/5f5af323200d7767830bf1d3/html5/thumbnails/9.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022042605/5f5af323200d7767830bf1d3/html5/thumbnails/10.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022042605/5f5af323200d7767830bf1d3/html5/thumbnails/11.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022042605/5f5af323200d7767830bf1d3/html5/thumbnails/12.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022042605/5f5af323200d7767830bf1d3/html5/thumbnails/13.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022042605/5f5af323200d7767830bf1d3/html5/thumbnails/14.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022042605/5f5af323200d7767830bf1d3/html5/thumbnails/15.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022042605/5f5af323200d7767830bf1d3/html5/thumbnails/16.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022042605/5f5af323200d7767830bf1d3/html5/thumbnails/17.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022042605/5f5af323200d7767830bf1d3/html5/thumbnails/18.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022042605/5f5af323200d7767830bf1d3/html5/thumbnails/19.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022042605/5f5af323200d7767830bf1d3/html5/thumbnails/20.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022042605/5f5af323200d7767830bf1d3/html5/thumbnails/21.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022042605/5f5af323200d7767830bf1d3/html5/thumbnails/22.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022042605/5f5af323200d7767830bf1d3/html5/thumbnails/23.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022042605/5f5af323200d7767830bf1d3/html5/thumbnails/24.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022042605/5f5af323200d7767830bf1d3/html5/thumbnails/25.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022042605/5f5af323200d7767830bf1d3/html5/thumbnails/26.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022042605/5f5af323200d7767830bf1d3/html5/thumbnails/27.jpg)
THANK YOU
27