streaming day - an overview of stream reasoning

74
Streaming Day: an overview of Stream Reasoning by: Riccardo Tommasini 1 Scuola di Ingegneria Industriale e dell’Informazione Computer Science and Engineering

Upload: riccardo-tommasini

Post on 22-Feb-2017

253 views

Category:

Software


1 download

TRANSCRIPT

Page 1: Streaming Day - an overview of Stream Reasoning

Streaming Day: an overview of Stream Reasoning

by: Riccardo Tommasini

1

Scuola di Ingegneria Industriale e dell’Informazione Computer Science and Engineering

Page 2: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini

Agenda

2

Background

Stream  Reasoning

Get  in  Touch

Heaven✓

SR  Example

Page 3: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini

GiT - Riccardo Tommasini

3

Master Degree in C.S. @ Politecnico Of Milano

M.D. Thesis on Stream Reasoning

I’ll start my Phd in November 2k15

Page 4: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini

GiT - Research Topic & Areas of Interest

4

• StreamReasoning @ CEP

• Techniques and Methods for Stream Reasoners Benchmarking

• RESTfull API

• Software Testing

• Programming Languages

RDF  Stream  Processing

Software  Engineering

Page 5: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini

GiT - Stream Reasoning Research Group

5

Daniele  Dell’Aglio  

Phd

Emanuele  Della  Valle  Advisor

Marco  Balduini  Phd

Page 6: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini

Agenda

6

Background

Stream  Reasoning

Get  in  Touch

Heaven✓

SR  Example

Page 7: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini

Background - Semantic Web

7

It provides a common framework to allow

interoperability applications.

The Semantic Web is a WWW extension.

Semantic Web world involves several

technologies.

Page 8: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini

Background - Semantic Web

7

It provides a common framework to allow

interoperability applications.

The Semantic Web is a WWW extension.

Semantic Web world involves several

technologies.

Page 9: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini

Background - Semantic Web

7

It provides a common framework to allow

interoperability applications.

The Semantic Web is a WWW extension.

Semantic Web world involves several

technologies.

Page 10: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini

Background - Semantic Web

7

It provides a common framework to allow

interoperability applications.

The Semantic Web is a WWW extension.

Semantic Web world involves several

technologies.

Page 11: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini

Background - RDF

8

Let I, B and L be three pairwise disjoint sets, defined as IRIs, Blank Nodes and Literals, respectively. A triple

(s, p, o) ∈ (I ∪ B)I(I ∪ B ∪ L) is an RDF triple, while a set of RDF triples is called an RDF graph.

subject objectpredicate

RDF describes a conceptual model of information in any given domain.

Page 12: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini

Background - OWL

9

• Web Ontology Language (OWL) is a language for writing ontologies for the Web

• An Ontology is a a specification of a conceptualisation (Tom Gruber)

• OWL extends RDF allowing to specific more about properties and classes

• OWL extends RDF enabling reasoning:

• Check logical correctness of statements

• Infer implied statements w.r.t. a set of inferences rules

Page 13: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini

Background - SPARQL

10

SPARQL Protocol and RDF Query Language 3 main parts

• CONSTRUCT query: used to provide an RDF graph created directly from the results of the query.• SELECT query: used to extract a set of variables and their matching values, called set of mappings in the table format. • Dataset clause -> FROM or FROM Named• WHERE: provides the graph pattern to match against the data graph.

Page 14: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini

Background - C-SPARQL

11

RICORDARE CAMBIO SEMANTICA!!!!Csparql language extends sparql in every 3 parts of query formsQuery form -> STREAM CLAUSE to create a RDF stream as query resultsDatasert clause -> FROM STREAM clause added to let engine get data from RDF streams specified by URIWhere Clause -> built in timestamp function to retrieve the timestamp of every single triple in the engine

Page 15: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini

Background - DSMS vs CEP

12

QQQQ

Throw

Scratch

Store

StreamStream 1

Stream2

Stream n

Complex EventProcessing

Engine

Event Observers Event Consumers

Processing Flows of Information: From Data Stream to Complex Event Processing- Gianpaolo Cugola & Alessandro Margara

Heterogeneous data stream processing

Data semantic is up to the client

Incoming data are notification of events

Events are semantically evaluate through rules

Pub/Sub Model

CEP

DSMS

Continuous queries execution

Page 16: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini 13

Background - Time Based Window

Tumbling  Window

Sliding  Window

Window Dimension ω [ms] Slide Parameter β [ms]

Page 17: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini 13

Background - Time Based Window

Tumbling  Window

Sliding  Window

Window Dimension ω [ms] Slide Parameter β [ms]

Page 18: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini 13

Background - Time Based Window

Tumbling  Window

Sliding  Window

Window Dimension ω [ms] Slide Parameter β [ms]

Page 19: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini 13

Background - Time Based Window

Tumbling  Window

Sliding  Window

Window Dimension ω [ms] Slide Parameter β [ms]

Page 20: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini

Agenda

14

Background

Stream  Reasoning

Get  in  Touch

Heaven✓

SR  Example

Page 21: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini

Stream Reasoning (SR)

15

Reasoning upon heterogeneous and rapidly changing information flows.

-- S. Ceri, E. Della Valle, F. van Harmelen and H. Stuckenschmidt, 2010

Page 22: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini

SR - RSP Engine

16

RDF  Stream    Processing    Engine

Page 23: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini

SR - RSP Engine

16

RDF  Stream    Processing    Engine

Page 24: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini

SR - RSP Engine

16

RDF  Stream    Processing    Engine

heterogeneous data (unbounded) streams

Page 25: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini

SR - RSP Engine

16

RDF  Stream    Processing    Engine

data streams integration through RDF data model

heterogeneous data (unbounded) streams

Page 26: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini

SR - RSP Engine

16

RDF  Stream    Processing    Engine

data streams integration through RDF data model

continuously infers implied triples w.r.t. ontology T

heterogeneous data (unbounded) streams

T

Page 27: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini

< ,Q>

SR - RSP Engine

16

RDF  Stream    Processing    Engine

data streams integration through RDF data model

continuously infers implied triples w.r.t. ontology T

heterogeneous data (unbounded) streams

continuous querying (Q) answering

T

Page 28: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini

SR - RSP Engine Execution Semantics

17

S2ROperator

Window

R2ROperator

SPARQL

R2SOperator

Rstream,Itream,Dstream

RDF StreamRDF Stream

Engine StreamMappings Mappings

Page 29: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini

SR - RSP Engine Execution Semantics

17

S2ROperator

Window

R2ROperator

SPARQL

R2SOperator

Rstream,Itream,Dstream

RDF StreamRDF Stream

Engine StreamMappings Mappings

Stream  to  Relation

Page 30: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini

SR - RSP Engine Execution Semantics

17

S2ROperator

Window

R2ROperator

SPARQL

R2SOperator

Rstream,Itream,Dstream

RDF StreamRDF Stream

Engine StreamMappings Mappings

Stream  to  Relation

Relation  to  Relation

Page 31: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini

SR - RSP Engine Execution Semantics

17

S2ROperator

Window

R2ROperator

SPARQL

R2SOperator

Rstream,Itream,Dstream

RDF StreamRDF Stream

Engine StreamMappings Mappings

Stream  to  Relation

Relation  to  Relation

Relation  to  Stream

Page 32: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini 18

SR - C-SPARQL Engine

Input TripleInferred Triple

Page 33: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini 18

SR - C-SPARQL Engine

RDF Stream

DSMS

Input TripleInferred Triple

Page 34: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini 18

SR - C-SPARQL Engine

RDF Stream

DSMS

active window

Input TripleInferred Triple

Page 35: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini 18

SR - C-SPARQL Engine

RDF Stream

DSMS Reasoner T,Q

active window

Input TripleInferred Triple

Page 36: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini 18

SR - C-SPARQL Engine

RDF Stream

DSMS Reasoner

RDF Stream

T,Q

active window

Input TripleInferred Triple

Page 37: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini 18

SR - C-SPARQL Engine

RDF Stream

DSMS Reasoner

RDF Stream

T,Q

active window

Input TripleInferred Triple

Page 38: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini 18

SR - C-SPARQL Engine

RDF Stream

DSMS Reasoner

RDF Stream

T,Q

active window

Input TripleInferred Triple

Page 39: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini 18

SR - C-SPARQL Engine

RDF Stream

DSMS Reasoner

RDF Stream

T,Q

C-SPARQL Query

active window

Input TripleInferred Triple

Page 40: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini 18

SR - C-SPARQL Engine

RDF Stream

DSMS Reasoner

RDF Stream

T,Q

Continuous Query

SPARQL Query

C-SPARQL Query

active window

Input TripleInferred Triple

Page 41: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini 18

SR - C-SPARQL Engine

RDF Stream

DSMS Reasoner

RDF Stream

T,Q

Continuous Query

SPARQL Query

C-SPARQL Query

active window

Input TripleInferred Triple

Page 42: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini 18

SR - C-SPARQL Engine

RDF Stream

DSMS Reasoner

RDF Stream

T,Q

Continuous Query

SPARQL Query

C-SPARQL Query

active window

Input TripleInferred Triple

Page 43: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini

Agenda

19

Background

Stream  Reasoning

Get  in  Touch

Heaven✓

SR  Example

Page 44: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini 20

BlueRoom RedRoom

is with

Running Example

Page 45: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini 20

BlueRoom RedRoom

RedSensor

BlueSensor

is with

Running Example

Page 46: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini 20

BlueRoom RedRoom

RedSensor

BlueSensor

R

Alice

R RFID is with

Running Example

Page 47: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini 20

BlueRoom RedRoom

RedSensor

BlueSensor

R

Alice

Bob

R RFID is withFoursquare

Running Example

Page 48: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini 20

BlueRoom RedRoom

RedSensor

BlueSensor

R

Alice

David

Bob

Carl

Elena

R RFID is withf FacebookFoursquare

Running Example

Page 49: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini 21

▪ Four ways to learn who is where

Sensor Room Person Time-stamp

RedSensor RedRoom Alice T1

… … … …

Person ChecksIn Time-stamp

Bob BlueRoom T2

… … …

Person IsIn With Time-stamp

Carl null Bob T2

David RedRoom Elena T3

… … … …

Running Example - Which Data?

Page 50: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini

Running Example - Data Model

22

Streaming Data Static Data

isWith

isConnectedTo

Page 51: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini

Running Example - Data Model

22

Streaming Data Static Data

isWith

isConnectedTo

Page 52: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini

RDF graph Time-stamp Stream

:RedSensor :observes [ :who :Alice; :where :RedRoom ] . t1 sensors

:Bob :posts [ :who :Bob ; :where :RedRoom] . t2 foursquare

• Data

• Query REGISTER QUERY whoIsInWhichRoom? AS PREFIX : <http://…/sr4ld2014-onto#> SELECT ?x ?room ?personFROM STREAM <http://…/fs> [RANGE 1m STEP 10s] FROM STREAM <http://…/sensors> [RANGE 1m STEP 10s] WHERE { ?x :observes [ :who ?person ; :where ?room ] .}

• Results at t2+10s

23

?x ?room ?person

:RedSensor :RedRoom :Alice

:Bob :RedRoom :Bob

Running Example - Query

Page 53: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini

Agenda

24

Background

Stream  Reasoning

Get  in  Touch

Heaven✓

SR  Example

Page 54: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini

Heaven - Research Question

My  contributions  are

Can  we  enable    Systematic  Comparative  Research  Approach  of  RSP  Engines,  exploiting  existing  queries,  

dataset  and  metrics?

25

Page 55: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini

Heaven - Research Question

My  contributions  are

Can  we  enable    Systematic  Comparative  Research  Approach  of  RSP  Engines,  exploiting  existing  queries,  

dataset  and  metrics?

Test  Stand

25

Page 56: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini

Evaluate  engines  with  Test  Stands

26

In Aerospace engineering…

Experimental Environment

Reproducibility, Repeatability, ComparabilityEvaluation of running systems

Heaven - Test Stand

Page 57: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini

Heaven - Test Stand

27

Disk

ResultCollector Streamer RSPEngine

Experiment

Analyser

Start MB StopTestStand

MB

Page 58: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini

My  contributions  are

Can  we  enable    Systematic  Comparative  Research  Approach  of  RSP  Engines,  exploiting  existing  queries,  

dataset  and  metrics?

28

Test  Stand

Heaven - Research Question

Page 59: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini

My  contributions  are

Can  we  enable    Systematic  Comparative  Research  Approach  of  RSP  Engines,  exploiting  existing  queries,  

dataset  and  metrics?

Method

28

Test  Stand

Heaven - Research Question

Page 60: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini

Heaven - Analyser

I  develop  a  layered  investigation  method,  which  tries  answer  different  possible  question  about  RSP  Engine

L0  -­‐    How  to  choose  an  engine?

L1  -­‐    What  distinguish  an  engine?

L2  -­‐    When  choosing  an  engine?

L3  -­‐    Why  choosing  this  engine?

29

Causalità dei livelli, sarebbe bello poter dire sempre quale engine è migliore

Page 61: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini

My  contributions  are

Can  we  enable    Systematic  Comparative  Research  Approach  of  RSP  Engines,  exploiting  existing  queries,  

dataset  and  metrics?

Test  Stand

Method

30

Heaven - Research Question

Page 62: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini

My  contributions  are

Can  we  enable    Systematic  Comparative  Research  Approach  of  RSP  Engines,  exploiting  existing  queries,  

dataset  and  metrics?

Test  Stand

Baselines

Method

Analysis

30

Heaven - Research Question

Page 63: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini

Heaven - Dashboard Example

31

Increasing Window

Dim

ension (ms)

Page 64: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini

Heaven - Dashboard Example

31

Memory(mb)

Latency(ms)

Increasing Window

Dim

ension (ms)

Page 65: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini

Heaven - Dashboard Example

31

Memory(mb)

Latency(ms)

Memory(mb)

Latency(ms)

Increasing Window

Dim

ension (ms)

Page 66: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini

Heaven - Dashboard Example

31

Memory(mb)

Latency(ms)

Memory(mb)

Latency(ms)

Memory(mb)

Latency(ms)

Increasing Window

Dim

ension (ms)

Page 67: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini

Heaven - Dashboard Example

31

Memory(mb)

Latency(ms)

Memory(mb)

Latency(ms)

Memory(mb)

Latency(ms)

Memory(mb)

Latency(ms)

Increasing Window

Dim

ension (ms)

Page 68: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini

Heaven - Pattern Identification Example

32

6.3 SOAK Test Evaluation Results

(a) Graph Naive

Triple Slots

in Number

Window 1 10 100 1000 10000

1

10

100

1000

10000

(b) Graph Incremental

Triple Slots

in Number

Window 1 10 100 1000 10000

1

10

100

1000

10000

Table 6.11 – The figure shows the representation in the time domain of mem-

ory for GN (a) and GI (b).

117

Memory

Naive

cancellare graph lasciare naive

Page 69: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini

Heaven- Visual Comparison Example

33

Page 70: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini

Agenda

34

Semantic  Web

Stream  Reasoning

Get  in  Touch

Heaven

Page 71: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini

Thank You

35

Thank You!

Page 72: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini

Contact

36

RiccardoTommasini+

@rictomm

tomma156

[email protected] Tommasini

riccardotommasini

Page 73: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini

Resources

37

Streamreasoning.org

StreamReasoning@GitHub

RDF Stream Processors

PhD CEP Course @Polimi

Stream Reasoning Tutorial

C-SPARQL Engine

Quick start availableSource code are released open source under Apache 2.0C-SPARQL Enginehttps://github.com/streamreasoning/CSPARQL-enginehttps://github.com/streamreasoning/CSPARQL-ReadyToGoPack

Page 74: Streaming Day - an overview of Stream Reasoning

Master Degree Thesis – Riccardo Tommasini

Resources

37

Streamreasoning.org

StreamReasoning@GitHub

RDF Stream Processors

PhD CEP Course @Polimi

Stream Reasoning Tutorial

Esper

Jena

C-SPARQL Engine

Quick start availableSource code are released open source under Apache 2.0C-SPARQL Enginehttps://github.com/streamreasoning/CSPARQL-enginehttps://github.com/streamreasoning/CSPARQL-ReadyToGoPack