Upload
daniele-dellaglio
View
226
Download
1
Embed Size (px)
DESCRIPTION
Presentation on RDF Stream Processing models given at the RSP2014 tutorial (ESWC 2014)
Citation preview
Tutorial on RDF
Stream Processing M. Balduini, J-P Calbimonte, O. Corcho,
D. Dell'Aglio, E. Della Valle
http://streamreasoning.org/rsp2014
RDF Stream models
Continuous query models Daniele Dell’Aglio
http://streamreasoning.org/rsp2014
Share, Remix, Reuse — Legally
This work is licensed under the Creative Commons Attribution 3.0 Unported License.
Your are free:
to Share — to copy, distribute and transmit the work
to Remix — to adapt the work
Under the following conditions
Attribution — You must attribute the work by inserting – “[source http://streamreasoning.org/rsp2014]” at the end of
each reused slide – a credits slide stating
- These slides are partially based on “Tutorial on RDF stream processing 2014” by M. Balduini, J-P Calbimonte, O. Corcho, D. Dell'Aglio and E. Della Valle http://streamreasoning.org/rsp2014
To view a copy of this license, visit http://creativecommons.org/licenses/by/3.0/
2
http://streamreasoning.org/rsp2014
Outline
1. Continuous RDF model extensions • RDF Streams, timestamps
2. Continuous extensions of SPARQL • Continuous evaluation • Additional operators
3. Overview of existing systems • Features • Comparison
3
http://streamreasoning.org/rsp2014
Outline
1. Continuous RDF model extensions • RDF Streams, timestamps
2. Continuous extensions of SPARQL • Continuous evaluation • Additional operators
3. Overview of existing systems • Features • Comparison
4
http://streamreasoning.org/rsp2014
Continuous extensions of RDF
As you know, “RDF is a standard model for data interchange on the Web” (http://www.w3.org/RDF/)
<sub1 pred
1 obj
1>
<sub2 pred
2 obj
2>
We want to extend RDF to model data streams
A data stream is an (infinite) ordered sequence of data items
A data item is a self-consumable informative unit
5
http://streamreasoning.org/rsp2014
Data items
With data item we can refer to: 1. A triple
2. A graph
6
<:alice :isWith :bob>
<:alice :posts :p>
<:p :who :bob>
<:p :where :redRoom>
:graph1
http://streamreasoning.org/rsp2014
Data items and time
Do we need to associate the time to data items? • It depends on what we want to achieve (see next!)
If yes, how to take into account the time? • Time should not (but could) be part of the schema • Time should not be accessible through the query language • Time as object would require a lot of reification
How to extend the RDF model to take into account the time?
7
http://streamreasoning.org/rsp2014
Application time
A timestamp is a temporal identifier associated to a data item
The application time is a set of one or more timestamps associated to the data item
Two data items can have the same application time • Contemporaneity
Who does assign the application time to an event? • The one that generates the data stream!
8
http://streamreasoning.org/rsp2014
Missing application time
A RDF stream without timestamp is an ordered sequence of data items
9
S e1
:alice :isWith :bob
http://streamreasoning.org/rsp2014
Missing application time
A RDF stream without timestamp is an ordered sequence of data items
9
S e1
:alice :isWith :bob
e2
:alice :isWith :carl
http://streamreasoning.org/rsp2014
Missing application time
A RDF stream without timestamp is an ordered sequence of data items
9
S e1
:alice :isWith :bob
e2
:alice :isWith :carl
e3
:bob :isWith :diana
http://streamreasoning.org/rsp2014
Missing application time
A RDF stream without timestamp is an ordered sequence of data items
9
S e1
:alice :isWith :bob
e2
:alice :isWith :carl
e3
:bob :isWith :diana
e4
:diana :isWith :carl
http://streamreasoning.org/rsp2014
Missing application time
A RDF stream without timestamp is an ordered sequence of data items
The order can be exploited to perform queries • Does Alice meet Bob before Carl? • Who does Carl meet first?
9
S e1
:alice :isWith :bob
e2
:alice :isWith :carl
e3
:bob :isWith :diana
e4
:diana :isWith :carl
http://streamreasoning.org/rsp2014
Application time: point-based extension
One timestamp: the time instant on which the data item occurs
10
e1 S
t 3 6 9 1
:alice :isWith :bob
http://streamreasoning.org/rsp2014
Application time: point-based extension
One timestamp: the time instant on which the data item occurs
10
e1 e2 S
t 3 6 9 1
:alice :isWith :bob
:alice :isWith :carl
http://streamreasoning.org/rsp2014
Application time: point-based extension
One timestamp: the time instant on which the data item occurs
10
e1 e2 e3 S
t 3 6 9 1
:alice :isWith :bob
:alice :isWith :carl
:bob :isWith :diana
http://streamreasoning.org/rsp2014
Application time: point-based extension
One timestamp: the time instant on which the data item occurs
10
e1 e2 e3 e4 S
t 3 6 9 1
:alice :isWith :bob
:alice :isWith :carl
:bob :isWith :diana
:diana :isWith :carl
http://streamreasoning.org/rsp2014
Application time: point-based extension
One timestamp: the time instant on which the data item occurs
We can start to compose queries taking into account the time • How many people has Alice met in the last 5m? • Does Diana meet Bob and then Carl within 5m?
10
e1 e2 e3 e4 S
t 3 6 9 1
:alice :isWith :bob
:alice :isWith :carl
:bob :isWith :diana
:diana :isWith :carl
http://streamreasoning.org/rsp2014
Application time: interval-based extension
Two timestamps: the time range on which the data item is valid (from, to]
11
S
t 3 6 9 1
:alice :isWith :bob
e1
http://streamreasoning.org/rsp2014
Application time: interval-based extension
Two timestamps: the time range on which the data item is valid (from, to]
11
S
t 3 6 9 1
:alice :isWith :bob
:alice :isWith :carl
e1
e2
http://streamreasoning.org/rsp2014
Application time: interval-based extension
Two timestamps: the time range on which the data item is valid (from, to]
11
S
t 3 6 9 1
:alice :isWith :bob
:alice :isWith :carl
:bob :isWith :diana
e1
e2
e3
http://streamreasoning.org/rsp2014
Application time: interval-based extension
Two timestamps: the time range on which the data item is valid (from, to]
11
S
t 3 6 9 1
:alice :isWith :bob
:alice :isWith :carl
:bob :isWith :diana
:diana :isWith :carl
e1
e2
e3
e4
http://streamreasoning.org/rsp2014
Application time: interval-based extension
Two timestamps: the time range on which the data item is valid (from, to]
It is possible to write even more complex constraints: • Which are the meetings the last less than 5m? • Which are the meetings with conflicts?
11
S
t 3 6 9 1
:alice :isWith :bob
:alice :isWith :carl
:bob :isWith :diana
:diana :isWith :carl
e1
e2
e3
e4
http://streamreasoning.org/rsp2014
Outline
1. Continuous RDF model extensions • RDF Streams, timestamps
2. Continuous extensions of SPARQL • Continuous evaluation • Additional operators
3. Overview of existing systems • Features • Comparison
12
http://streamreasoning.org/rsp2014
Continuous query evaluation
From SPARQL • One query, one answer • The query is sent after that the data is available
To a continuous query language • One query, multiple answers • The query is registered in the query engine • The registration usually happens before that the data arrives • Real-time responsiveness is usually required
13
http://streamreasoning.org/rsp2014
Let’s process the RDF streams!
In literature there are two different main approaches to process streams
Data Stream Management Systems (DSMSs) • Roots in DBMS research • Aggregations and filters
Complex Event Processors (CEPs) • Roots in Discrete Event Simulation • Search of relevant patterns in the stream • Non-equi-join on the timestamps (after, before, etc.)
Current systems implements feature of both of them • EPL (e.g. Esper, ORACLE CEP)
Now we focus on the CQL/STREAM model • Developed in the DSMS research • C-SPARQL (and others) is inspired to this model
14
http://streamreasoning.org/rsp2014
Our assumptions
In the following we will consider the following setting • A RDF triple is an event • Application time: point-based
<:alice :isWith:bob>:[1]
<:alice :isWith:carl>:[3]
<:bob :isWith :diana>:[6]
...
15
e1 e2 e3 e4 S
t 3 6 9 1
:alice :isWith :bob
:alice :isWith :carl
:bob :isWith :diana
:diana :isWith :carl
http://streamreasoning.org/rsp2014
Querying data streams – The CQL model
16
Streams Relations
… <s,τ>
…
<s1> <s2> <s3>
infinite unbounded sequence
finite bag
Mapping: T R Stream Relation R(t)
http://streamreasoning.org/rsp2014
Querying data streams – The CQL model
16
Streams Relations
… <s,τ>
…
<s1> <s2> <s3>
infinite unbounded sequence
finite bag
Mapping: T R
stream-to-relation
Stream Relation R(t)
http://streamreasoning.org/rsp2014
Querying data streams – The CQL model
16
Streams Relations
… <s,τ>
…
<s1> <s2> <s3>
infinite unbounded sequence
finite bag
Mapping: T R
stream-to-relation
Stream Relation R(t)
Sliding windows
http://streamreasoning.org/rsp2014
Querying data streams – The CQL model
16
Streams Relations
… <s,τ>
…
<s1> <s2> <s3>
infinite unbounded sequence
finite bag
Mapping: T R
stream-to-relation relation-to-relation
Stream Relation R(t)
Sliding windows
http://streamreasoning.org/rsp2014
Querying data streams – The CQL model
16
Streams Relations
… <s,τ>
…
<s1> <s2> <s3>
infinite unbounded sequence
finite bag
Mapping: T R
stream-to-relation relation-to-relation
Stream Relation R(t)
Relational algerbra Sliding windows
http://streamreasoning.org/rsp2014
Querying data streams – The CQL model
16
Streams Relations
… <s,τ>
…
<s1> <s2> <s3>
infinite unbounded sequence
finite bag
Mapping: T R
stream-to-relation
relation-to-stream
relation-to-relation
Stream Relation R(t)
Relational algerbra Sliding windows
http://streamreasoning.org/rsp2014
Querying data streams – The CQL model
16
Streams Relations
… <s,τ>
…
<s1> <s2> <s3>
infinite unbounded sequence
finite bag
Mapping: T R
stream-to-relation
relation-to-stream
relation-to-relation
Stream Relation R(t)
Relational algerbra
*Stream operators
Sliding windows
http://streamreasoning.org/rsp2014
CQL extension for querying RDF data streams
17
RDF Streams
RDF Mappings
http://streamreasoning.org/rsp2014
CQL extension for querying RDF data streams
17
RDF Streams
RDF Mappings
S2R operators
Sliding windows
http://streamreasoning.org/rsp2014
CQL extension for querying RDF data streams
17
RDF Streams
RDF Mappings
S2R operators SPARQL operators
Sliding windows
http://streamreasoning.org/rsp2014
CQL extension for querying RDF data streams
17
RDF Streams
RDF Mappings
S2R operators
R2S operators
SPARQL operators
*Stream operators
Sliding windows
http://streamreasoning.org/rsp2014 39
Time-based sliding window
S3
S4 S5
S6
S7
S8
S9 S10
S11
S12
S S1
S2
t
http://streamreasoning.org/rsp2014 40
R2R operator
Time-based sliding window
S3
S4 S5
S6
S7
S8
S9 S10
S11
S12
S S1
S2
W(ω,β)
t
http://streamreasoning.org/rsp2014 41
R2R operator
Time-based sliding window
S3
S4 S5
S6
S7
S8
S9 S10
S11
S12
S S1
S2
W(ω,β)
t
http://streamreasoning.org/rsp2014 42
R2R operator
Time-based sliding window
S3
S4 S5
S6
S7
S8
S9 S10
S11
S12
S S1
S2
W(ω,β)
ω
t
width
http://streamreasoning.org/rsp2014 43
R2R operator
Time-based sliding window
S3
S4 S5
S6
S7
S8
S9 S10
S11
S12
S S1
S2
W(ω,β)
ω
t
width
http://streamreasoning.org/rsp2014 44
R2R operator
Time-based sliding window
S3
S4 S5
S6
S7
S8
S9 S10
S11
S12
S S1
S2
W(ω,β)
β
ω
t
width slide
http://streamreasoning.org/rsp2014 45
R2R operator
Time-based sliding window
S3
S4 S5
S6
S7
S8
S9 S10
S11
S12
S S1
S2
W(ω,β)
β
ω
t
width slide
http://streamreasoning.org/rsp2014 46
Time-based sliding window - tumbling
S3
S4 S5
S6
S7
S8
S9 S10
S11
S12
S S1
S2
t
http://streamreasoning.org/rsp2014 47
R2R operator
Time-based sliding window - tumbling
S3
S4 S5
S6
S7
S8
S9 S10
S11
S12
S S1
S2
W(ω,β)
t
http://streamreasoning.org/rsp2014 48
R2R operator
Time-based sliding window - tumbling
S3
S4 S5
S6
S7
S8
S9 S10
S11
S12
S S1
S2
W(ω,β)
t
http://streamreasoning.org/rsp2014 49
R2R operator
Time-based sliding window - tumbling
S3
S4 S5
S6
S7
S8
S9 S10
S11
S12
S S1
S2
W(ω,β)
ω
t
width
http://streamreasoning.org/rsp2014 50
R2R operator
Time-based sliding window - tumbling
S3
S4 S5
S6
S7
S8
S9 S10
S11
S12
S S1
S2
W(ω,β)
ω
t
width
http://streamreasoning.org/rsp2014 51
R2R operator
Time-based sliding window - tumbling
S3
S4 S5
S6
S7
S8
S9 S10
S11
S12
S S1
S2
W(ω,β)
β
ω
t
width slide
http://streamreasoning.org/rsp2014 52
R2R operator
Time-based sliding window - tumbling
S3
S4 S5
S6
S7
S8
S9 S10
S11
S12
S S1
S2
W(ω,β)
β
ω
t
width slide
http://streamreasoning.org/rsp2014 53
Tuple-based sliding window
S3
S4 S5 S6
S7
S8 S9
S11
S12
S S1
S2
t
http://streamreasoning.org/rsp2014 54
R2R operator
Tuple-based sliding window
S3
S4 S5 S6
S7
S8 S9
S11
S12
S S1
S2
W(ω,β)
t
http://streamreasoning.org/rsp2014 55
R2R operator
Tuple-based sliding window
S3
S4 S5 S6
S7
S8 S9
S11
S12
S S1
S2
W(ω,β)
t
http://streamreasoning.org/rsp2014 56
R2R operator
Tuple-based sliding window
S3
S4 S5 S6
S7
S8 S9
S11
S12
S S1
S2
W(ω,β)
ω tuples
in the window
t
http://streamreasoning.org/rsp2014 57
R2R operator
Tuple-based sliding window
S3
S4 S5 S6
S7
S8 S9
S11
S12
S S1
S2
W(ω,β)
ω tuples
in the window
t
http://streamreasoning.org/rsp2014 58
R2R operator
Tuple-based sliding window
S3
S4 S5 S6
S7
S8 S9
S11
S12
S S1
S2
W(ω,β)
Slide of β
tuples ω tuples
in the window
t
http://streamreasoning.org/rsp2014 59
R2R operator
Tuple-based sliding window
S3
S4 S5 S6
S7
S8 S9
S11
S12
S S1
S2
W(ω,β)
Slide of β
tuples ω tuples
in the window
t
http://streamreasoning.org/rsp2014 60
R2R operator
Tuple-based sliding window
S3
S4 S5 S6
S7
S8 S9
S11
S12
S S1
S2
W(ω,β)
Slide of β
tuples ω tuples
in the window
t
http://streamreasoning.org/rsp2014 61
R2R operator
Tuple-based sliding window
S3
S4 S5 S6
S7
S8 S9
S11
S12
S S1
S2
W(ω,β)
Slide of β
tuples ω tuples
in the window
t
Contemporaneity
implies a
non-deterministic
selection
http://streamreasoning.org/rsp2014 62
SPARQL: a quick recap
http://streamreasoning.org/rsp2014 63
SPARQL: a quick recap
http://streamreasoning.org/rsp2014
The query output
Which is the format of the answer?
We can distinguish two cases 1. No R2S operator: the output is a relation (that changes during
the time) 2. R2S operator: a stream.
– An RDF stream? It depends by the Query Form
22
S2R operators
R2S operators
SPARQL operators
RDF Mappings
RDF Streams
http://streamreasoning.org/rsp2014
No R2S operator: relation
23
RSP
SELECT ?a ?b …
FROM ….
WHERE ….
a … b… [t1] a … b…
a … b… [t3]
a … b… [t5]
a … b… [t7]
queries bindings
http://streamreasoning.org/rsp2014
No R2S operator: relation
23
RSP
SELECT ?a ?b …
FROM ….
WHERE ….
CONSTRUCT {?a :prop ?b }
FROM ….
WHERE ….
a … b… [t1] a … b…
a … b… [t3]
a … b… [t5]
a … b… [t7]
<… :prop … > [t1]
<… :prop … >
<… :prop … > [t3]
<… :prop … > [t5]
<… :prop … > [t7]
queries bindings
triples
http://streamreasoning.org/rsp2014
R2S operator: stream
R2S operators
Three operators:
Rstream: streams out all data in the last step
Istream: streams out data in the last step that wasn’t on the previous step, i.e. streams out what is new
Dstream: streams out data in the previous step that isn’t in the last step, i.e. streams out what is old
24
CONSTRUCT RSTREAM {?a :prop ?b }
FROM ….
WHERE ….
… <… :prop … > [t1] <… :prop … > [t1] <… :prop … > [t3] <… :prop … > [t5] < …:prop … > [t7]
…
RSP query
stream
http://streamreasoning.org/rsp2014
Brief overview on the CEP operators
Sequence operators and CEP world
SEQ: joins eti,tf and e’ti’,tf’ if e’ occurs after e
EQUALS: joins eti,tf and e’ti’,tf’ if they occur simultaneously
OPTIONALSEQ, OPTIONALEQUALS: Optional join variants
25
e1 e2 e3
e4
S
3 6 9 1
Sequence Simultaneous
http://streamreasoning.org/rsp2014
Outline
1. Continuous RDF model extensions • RDF Streams, timestamps
2. Continuous extensions of SPARQL • Continuous evaluation • Additional operators
3. Overview of existing systems • Features • Comparison
26
http://streamreasoning.org/rsp2014
Existing RSP systems (oversimplified!)
C-SPARQL: RDF Store + Stream processor • Combined architecture
27
RDF Store
Stream processor
C-SPARQL query
continuous results
translator
http://streamreasoning.org/rsp2014
Existing RSP systems (oversimplified!)
C-SPARQL: RDF Store + Stream processor • Combined architecture
CQELS: Implemented from scratch. Focus on performance • Native + adaptive joins for static-data and streaming data
27
RDF Store
Stream processor
C-SPARQL query
continuous results
Native RSP CQELS query
continuous results
translator
http://streamreasoning.org/rsp2014
Existing RSP systems (oversimplified!)
SPARQLstream: Ontology-based stream query answering • Virtual RDF views, using R2RML mappings • SPARQL stream queries over the original data streams.
EP-SPARQL: Complex-event detection • SEQ, EQUALS operators
28
DSMS/CEP SPARQLStream query
continuous results
rewriter
R2RML mappings
Prolog engine
EP-SPARQL query
continuous results
translator
http://streamreasoning.org/rsp2014
Existing RSP systems (oversimplified!)
SPARQLstream: Ontology-based stream query answering • Virtual RDF views, using R2RML mappings • SPARQL stream queries over the original data streams.
EP-SPARQL: Complex-event detection • SEQ, EQUALS operators
Instans: RETE-based evaluation
28
DSMS/CEP SPARQLStream query
continuous results
rewriter
R2RML mappings
Prolog engine
EP-SPARQL query
continuous results
translator
http://streamreasoning.org/rsp2014
Classification of existing systems
Mo
de
l
Co
nti
nu
ou
s
ex
ec
uti
on
Un
ion
, Jo
in,
Op
tio
na
l,
Fil
ter
Ag
gre
gate
s
Tim
e w
ind
ow
Tri
ple
win
do
w
R2
S o
pe
rato
r
Se
qu
en
ce
,
Co
-oc
urr
en
ce
TA-
SPARQL
TA-RDF ✗ ✔ Limited ✗ ✗ ✗ ✗
tSPARQL tRDF ✗ ✔ ✗ ✗ ✗ ✗ ✗
Streaming
SPARQL
RDF
Stream
✔ ✔ ✗
✔ ✔ ✗ ✗
C-SPARQL RDF
Stream
✔ ✔ ✔ ✔ ✔ Rstream
only
time
function
CQELS RDF
Stream
✔ ✔ ✔ ✔ ✔ Istream
only
✗
SPARQLStr
eam
(Virtual)
RDF
Stream
✔ ✔ ✔ ✔ ✗
✔ ✗
EP-
SPARQL
RDF
Stream
✔ ✔ ✔ ✗ ✗
✗ ✔
Instans RDF ✔ ✔ ✔ ✗ ✗ ✗ ✗
29 Disclaimer: other features may be missing
http://streamreasoning.org/rsp2014
Classification of existing systems
Mo
de
l
Co
nti
nu
ou
s
ex
ec
uti
on
Un
ion
, Jo
in,
Op
tio
na
l,
Fil
ter
Ag
gre
gate
s
Tim
e w
ind
ow
Tri
ple
win
do
w
R2
S o
pe
rato
r
Se
qu
en
ce
,
Co
-oc
urr
en
ce
TA-
SPARQL
TA-RDF ✗ ✔ Limited ✗ ✗ ✗ ✗
tSPARQL tRDF ✗ ✔ ✗ ✗ ✗ ✗ ✗
Streaming
SPARQL
RDF
Stream
✔ ✔ ✗
✔ ✔ ✗ ✗
C-SPARQL RDF
Stream
✔ ✔ ✔ ✔ ✔ Rstream
only
time
function
CQELS RDF
Stream
✔ ✔ ✔ ✔ ✔ Istream
only
✗
SPARQLStr
eam
(Virtual)
RDF
Stream
✔ ✔ ✔ ✔ ✗
✔ ✗
EP-
SPARQL
RDF
Stream
✔ ✔ ✔ ✗ ✗
✗ ✔
Instans RDF ✔ ✔ ✔ ✗ ✗ ✗ ✗
29 Disclaimer: other features may be missing
http://streamreasoning.org/rsp2014
Similar models, similar (not equals!) query languages
30
http://streamreasoning.org/rsp2014
Similar models, similar (not equals!) query languages
30
SELECT ?sensor
FROM NAMED STREAM <http://www.cwi.nl/SRBench/observations> [NOW-3 HOURS SLIDE 10
MINUTES]
WHERE {
?observation om-owl:procedure ?sensor ;
om-owl:observedProperty weather:WindSpeed ;
om-owl:result [ om-owl:floatValue ?value ] . }
GROUP BY ?sensor HAVING ( AVG(?value) >= "74"^^xsd:float )
SPARQLStream
http://streamreasoning.org/rsp2014
Similar models, similar (not equals!) query languages
30
SELECT ?sensor
FROM NAMED STREAM <http://www.cwi.nl/SRBench/observations> [NOW-3 HOURS SLIDE 10
MINUTES]
WHERE {
?observation om-owl:procedure ?sensor ;
om-owl:observedProperty weather:WindSpeed ;
om-owl:result [ om-owl:floatValue ?value ] . }
GROUP BY ?sensor HAVING ( AVG(?value) >= "74"^^xsd:float )
SELECT ?sensor
FROM STREAM <http://www.cwi.nl/SRBench/observations> [RANGE 1h STEP 10m]
WHERE {
?observation om-owl:procedure ?sensor ;
om-owl:observedProperty weather:WindSpeed ;
om-owl:result [ om-owl:floatValue ?value ] . }
GROUP BY ?sensor HAVING ( AVG(?value) >= "74"^^xsd:float )
SPARQLStream
C-SPARQL
http://streamreasoning.org/rsp2014
Similar models, similar (not equals!) query languages
30
SELECT ?sensor
FROM NAMED STREAM <http://www.cwi.nl/SRBench/observations> [NOW-3 HOURS SLIDE 10
MINUTES]
WHERE {
?observation om-owl:procedure ?sensor ;
om-owl:observedProperty weather:WindSpeed ;
om-owl:result [ om-owl:floatValue ?value ] . }
GROUP BY ?sensor HAVING ( AVG(?value) >= "74"^^xsd:float )
SELECT ?sensor
WHERE {
STREAM <http://www.cwi.nl/SRBench/observations> [RANGE 10800s SLIDE 600s] {
?observation om-owl:procedure ?sensor ;
om-owl:observedProperty weather:WindSpeed ;
om-owl:result [ om-owl:floatValue ?value ] .} }
GROUP BY ?sensor HAVING ( AVG(?value) >= "74"^^xsd:float )
SELECT ?sensor
FROM STREAM <http://www.cwi.nl/SRBench/observations> [RANGE 1h STEP 10m]
WHERE {
?observation om-owl:procedure ?sensor ;
om-owl:observedProperty weather:WindSpeed ;
om-owl:result [ om-owl:floatValue ?value ] . }
GROUP BY ?sensor HAVING ( AVG(?value) >= "74"^^xsd:float )
SPARQLStream
CQELS
C-SPARQL
http://streamreasoning.org/rsp2014 80
The correctness problem (1)
S1 S
t 1
:alice :isIn :hall
http://streamreasoning.org/rsp2014 81
The correctness problem (1)
S1 S2 S
t 3 1
:alice :isIn :hall
:bob :isIn :hall
http://streamreasoning.org/rsp2014 82
The correctness problem (1)
S1 S2 S3 S
t 3 6 1
:alice :isIn :hall
:bob :isIn :hall
:alice :isIn :kitchen
http://streamreasoning.org/rsp2014 83
The correctness problem (1)
S1 S2 S3 S4 S
t 3 6 9 1
:alice :isIn :hall
:bob :isIn :hall
:alice :isIn :kitchen
:bob :isIn :kitchen
http://streamreasoning.org/rsp2014 84
The correctness problem (1)
Where are Alice and Bob, when they are together?
S1 S2 S3 S4 S
t 3 6 9 1
:alice :isIn :hall
:bob :isIn :hall
:alice :isIn :kitchen
:bob :isIn :kitchen
http://streamreasoning.org/rsp2014 85
The correctness problem (1)
Where are Alice and Bob, when they are together?
Let’s consider a tumbling window W(ω=β=5)
S1 S2 S3 S4 S
t 3 6 9 1
:alice :isIn :hall
:bob :isIn :hall
:alice :isIn :kitchen
:bob :isIn :kitchen
http://streamreasoning.org/rsp2014 86
The correctness problem (1)
Where are Alice and Bob, when they are together?
Let’s consider a tumbling window W(ω=β=5)
Let’s execute the experiment 4 times on C-SPARQL
S1 S2 S3 S4 S
t 3 6 9 1
:alice :isIn :hall
:bob :isIn :hall
:alice :isIn :kitchen
:bob :isIn :kitchen
http://streamreasoning.org/rsp2014 87
The correctness problem (1)
Where are Alice and Bob, when they are together?
Let’s consider a tumbling window W(ω=β=5)
Let’s execute the experiment 4 times on C-SPARQL
Execution 1° answer 2° answer
1 :hall [6] :kitchen [11]
2 :hall [5] :kitchen [10]
3 :hall [6] :kitchen [11]
4 - [7] - [12]
S1 S2 S3 S4 S
t 3 6 9 1
:alice :isIn :hall
:bob :isIn :hall
:alice :isIn :kitchen
:bob :isIn :kitchen
http://streamreasoning.org/rsp2014 88
The correctness problem (1)
Where are Alice and Bob, when they are together?
Let’s consider a tumbling window W(ω=β=5)
Let’s execute the experiment 4 times on C-SPARQL
Execution 1° answer 2° answer
1 :hall [6] :kitchen [11]
2 :hall [5] :kitchen [10]
3 :hall [6] :kitchen [11]
4 - [7] - [12]
S1 S2 S3 S4 S
t 3 6 9 1
:alice :isIn :hall
:bob :isIn :hall
:alice :isIn :kitchen
:bob :isIn :kitchen
Which is the correct answer?
http://streamreasoning.org/rsp2014 89
RSP output correctness: the t0 parameter
Exec 1° answer 2° answer
1 :hall [6] :kitchen [11]
2 :hall [5] :kitchen [10]
3 :hall [6] :kitchen [11]
4 - [7] - [12]
S1 S2 S3 S4 S
t 3 6 9 1
:bob :isIn :hall :bob :isIn :kitchen
:alice :isIn :hall :alice :isIn :kitchen
http://streamreasoning.org/rsp2014 90
RSP output correctness: the t0 parameter
Exec 1° answer 2° answer
1 :hall [6] :kitchen [11]
2 :hall [5] :kitchen [10]
3 :hall [6] :kitchen [11]
4 - [7] - [12]
S1 S2 S3 S4 S
t 3 6 9 1
:bob :isIn :hall :bob :isIn :kitchen
t0=0
:alice :isIn :hall :alice :isIn :kitchen
http://streamreasoning.org/rsp2014 91
RSP output correctness: the t0 parameter
Exec 1° answer 2° answer
1 :hall [6] :kitchen [11]
2 :hall [5] :kitchen [10]
3 :hall [6] :kitchen [11]
4 - [7] - [12]
S1 S2 S3 S4 S
t 3 6 9 1
:bob :isIn :hall :bob :isIn :kitchen
t0=0
Window 1° answer 2° answer
t0=0 :hall [5] :kitchen [10]
:alice :isIn :hall :alice :isIn :kitchen
http://streamreasoning.org/rsp2014 92
RSP output correctness: the t0 parameter
Exec 1° answer 2° answer
1 :hall [6] :kitchen [11]
2 :hall [5] :kitchen [10]
3 :hall [6] :kitchen [11]
4 - [7] - [12]
S1 S2 S3 S4 S
t 3 6 9 1
:bob :isIn :hall :bob :isIn :kitchen
t0=0
Window 1° answer 2° answer
t0=0 :hall [5] :kitchen [10]
:alice :isIn :hall :alice :isIn :kitchen
t0=1
http://streamreasoning.org/rsp2014 93
RSP output correctness: the t0 parameter
Exec 1° answer 2° answer
1 :hall [6] :kitchen [11]
2 :hall [5] :kitchen [10]
3 :hall [6] :kitchen [11]
4 - [7] - [12]
S1 S2 S3 S4 S
t 3 6 9 1
:bob :isIn :hall :bob :isIn :kitchen
t0=0
Window 1° answer 2° answer
t0=0 :hall [5] :kitchen [10]
t0=1 :hall [6] :kitchen [11]
:alice :isIn :hall :alice :isIn :kitchen
t0=1
http://streamreasoning.org/rsp2014 94
RSP output correctness: the t0 parameter
Exec 1° answer 2° answer
1 :hall [6] :kitchen [11]
2 :hall [5] :kitchen [10]
3 :hall [6] :kitchen [11]
4 - [7] - [12]
S1 S2 S3 S4 S
t 3 6 9 1
:bob :isIn :hall :bob :isIn :kitchen
t0=0
Window 1° answer 2° answer
t0=0 :hall [5] :kitchen [10]
t0=1 :hall [6] :kitchen [11]
:alice :isIn :hall :alice :isIn :kitchen
t0=1
t0=2
http://streamreasoning.org/rsp2014 95
RSP output correctness: the t0 parameter
Exec 1° answer 2° answer
1 :hall [6] :kitchen [11]
2 :hall [5] :kitchen [10]
3 :hall [6] :kitchen [11]
4 - [7] - [12]
S1 S2 S3 S4 S
t 3 6 9 1
:bob :isIn :hall :bob :isIn :kitchen
t0=0
Window 1° answer 2° answer
t0=0 :hall [5] :kitchen [10]
t0=1 :hall [6] :kitchen [11]
t0=2 - [7] - [12]
:alice :isIn :hall :alice :isIn :kitchen
t0=1
t0=2
http://streamreasoning.org/rsp2014 96
RSP output correctness: the t0 parameter
Exec 1° answer 2° answer
1 :hall [6] :kitchen [11]
2 :hall [5] :kitchen [10]
3 :hall [6] :kitchen [11]
4 - [7] - [12]
S1 S2 S3 S4 S
t 3 6 9 1
:bob :isIn :hall :bob :isIn :kitchen
t0=0
Window 1° answer 2° answer
t0=0 :hall [5] :kitchen [10]
t0=1 :hall [6] :kitchen [11]
t0=2 - [7] - [12]
:alice :isIn :hall :alice :isIn :kitchen
t0=1
t0=2
http://streamreasoning.org/rsp2014 97
The correctness problem (2)
Execution 1° answer 2° answer
1 :hall [6] :kitchen [11]
2 :hall [5] :kitchen [10]
3 :hall [6] :kitchen [11]
4 - [7] - [12]
C-SPARQL
S1 S2 S3 S4 S
t 3 6 9 1
:bob :isIn :hall :bob :isIn :kitchen
:alice :isIn :hall :alice :isIn :kitchen
http://streamreasoning.org/rsp2014 98
The correctness problem (2)
Execution 1° answer 2° answer
1 :hall [6] :kitchen [11]
2 :hall [5] :kitchen [10]
3 :hall [6] :kitchen [11]
4 - [7] - [12]
Execution 1° answer 2° answer
1 :hall [3] :kitchen [9]
2 No answers
3 :hall [3] :kitchen [9]
4 No answers
C-SPARQL CQELS
S1 S2 S3 S4 S
t 3 6 9 1
:bob :isIn :hall :bob :isIn :kitchen
:alice :isIn :hall :alice :isIn :kitchen
http://streamreasoning.org/rsp2014 99
The correctness problem (2)
Execution 1° answer 2° answer
1 :hall [6] :kitchen [11]
2 :hall [5] :kitchen [10]
3 :hall [6] :kitchen [11]
4 - [7] - [12]
Execution 1° answer 2° answer
1 :hall [3] :kitchen [9]
2 No answers
3 :hall [3] :kitchen [9]
4 No answers
C-SPARQL CQELS
Which system behaves in the
correct way?
S1 S2 S3 S4 S
t 3 6 9 1
:bob :isIn :hall :bob :isIn :kitchen
:alice :isIn :hall :alice :isIn :kitchen
http://streamreasoning.org/rsp2014 100
The correctness problem (2)
Execution 1° answer 2° answer
1 :hall [6] :kitchen [11]
2 :hall [5] :kitchen [10]
3 :hall [6] :kitchen [11]
4 - [7] - [12]
Execution 1° answer 2° answer
1 :hall [3] :kitchen [9]
2 No answers
3 :hall [3] :kitchen [9]
4 No answers
C-SPARQL CQELS
Which system behaves in the
correct way?
S1 S2 S3 S4 S
t 3 6 9 1
:bob :isIn :hall :bob :isIn :kitchen
:alice :isIn :hall :alice :isIn :kitchen
Both!
http://streamreasoning.org/rsp2014 101
R2R operator
The window operator (through SECRET)
S3
S4 S5
S6
S7
S8
S9 S10
S11
S12
S S1
S2
W(ω,β)
β
ω
t
http://streamreasoning.org/rsp2014 102
R2R operator
The window operator (through SECRET)
S3
S4 S5
S6
S7
S8
S9 S10
S11
S12
S S1
S2
W(ω,β)
β
ω
t0: When does the
window start?
(internal window
param)
t
http://streamreasoning.org/rsp2014 103
R2R operator
The window operator (through SECRET)
S3
S4 S5
S6
S7
S8
S9 S10
S11
S12
S S1
S2
W(ω,β)
β
ω
t0: When does the
window start?
(internal window
param)
TICK: When are
data stream
elements added to
the window?
Triple-based vs
graph-based
t
http://streamreasoning.org/rsp2014 104
R2R operator
The window operator (through SECRET)
S3
S4 S5
S6
S7
S8
S9 S10
S11
S12
S S1
S2
W(ω,β)
β
ω
t0: When does the
window start?
(internal window
param)
TICK: When are
data stream
elements added to
the window?
Triple-based vs
graph-based
REPORT: When is the window content
made available to the R2R operator?
Non-empty content, Content-change,
Window-close, Periodic
t
http://streamreasoning.org/rsp2014
Understanding the RSPs
They share similar models, but they behave in different ways
The C-SPARQL, CQELS and SPARQLstream models does not allow to determine in a unique way which should be the answer given the inputs and the query • There are missing parameters (encoded in the implementations)
Why is it important to understand those behaviours? • To assess the correct implementation of the systems • To improve the comprehension of the benchmarking
W3C RDF stream processor community group started to jointly work out a recommendation in 2014
http://www.w3.org/community/rsp/
35
http://streamreasoning.org/rsp2014
References
DSMSs and CEPs • Arasu, A., Babu, S., Widom, J.: The CQL continuous query language : semantic foundations. The
VLDB Journal 15(2) (2006) 121–142 • Gianpaolo Cugola, Alessandro Margara: Processing flows of information: From data stream to
complex event processing. ACM Comput. Surv. 44(3): 15 (2012) • Botan, I., Derakhshan, R., Dindar, N., Haas, L., Miller, R.J., Tatbul, N.: Secret: A model for analysis
of the execution semantics of stream processing systems. PVLDB 3(1) (2010) 232–243
RDF Stream Processors • Barbieri, D.F., Braga, D., Ceri, S., Della Valle, E., Grossniklaus, M.: C-SPARQL: A continuous query
language for RDF data streams. IJSC 4(1) (2010) 3–25 • Calbimonte, J.P., Jeung, H., Corcho, O., Aberer, K.: Enabling Query Technologies for the Semantic
Sensor Web. IJSWIS 8(1) (2012) 43–63 • Le-Phuoc, D., Dao-Tran, M., Xavier Parreira, J., Hauswirth, M.: A native and adaptive approach for
unified processing of linked streams and linked data. In: ISWC. (2011) 370–388 • Anicic, D., Fodor, P., Rudolph, S., Stojanovic, N.: EP-SPARQL: a unified language for event
processing and stream reasoning. In: WWW. (2011) 635–644
Benchmarks and RSP comparison • Ying Zhang, Minh-Duc Pham, Óscar Corcho, Jean-Paul Calbimonte: SRBench: A Streaming
RDF/SPARQL Benchmark. International Semantic Web Conference (1) 2012: 641-657 • Danh Le Phuoc, Minh Dao-Tran, Minh-Duc Pham, Peter A. Boncz, Thomas Eiter, Michael Fink: Linked
Stream Data Processing Engines: Facts and Figures. International Semantic Web Conference (2) 2012: 300-312
• Daniele Dell'Aglio, Jean-Paul Calbimonte, Marco Balduini, Óscar Corcho, Emanuele Della Valle: On Correctness in RDF Stream Processor Benchmarking. International Semantic Web Conference (2) 2013: 326-342
36
Tutorial on RDF
Stream Processing M. Balduini, J-P Calbimonte, O. Corcho,
D. Dell'Aglio, E. Della Valle
http://streamreasoning.org/rsp2014
RDF Stream models
Continuous query models Daniele Dell’Aglio