DL-based Stream Reasoning Emanuele Della Valle Share, Remix, Reuse - - PowerPoint PPT Presentation

dl based stream reasoning
SMART_READER_LITE
LIVE PREVIEW

DL-based Stream Reasoning Emanuele Della Valle Share, Remix, Reuse - - PowerPoint PPT Presentation

How to Build a Stream Reasoning Application D. Dell'Aglio, E. Della Valle, T. Le-Pham, A. Mileo, and R. Tommasini http://streamreasoning.org/events/streamapp2017 DL-based Stream Reasoning Emanuele Della Valle Share, Remix, Reuse Legally


slide-1
SLIDE 1

How to Build a Stream Reasoning Application

  • D. Dell'Aglio, E. Della Valle,
  • T. Le-Pham, A. Mileo, and R. Tommasini

http://streamreasoning.org/events/streamapp2017

DL-based Stream Reasoning

Emanuele Della Valle

slide-2
SLIDE 2

http://streamreasoning.org/events/streamapp2017

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 a

credits slide stating

– These slides are partially based on “How to Build a Stream Reasoning Application 2017” by D. Dell'Aglio, E. Della Valle,

  • T. Le-Pham, Mileo, and R. Tommasini available online at

http://streamreasoning.org/events/streamapp2017

  • To view a copy of this license, visit

http://creativecommons.org/licenses/by/3.0/

2

slide-3
SLIDE 3

http://streamreasoning.org/events/streamapp2017

A model to describe stream processing

  • D. Dell’Aglio, On Unified Stream Reasoning, PhD thesis, Politecnico di Milano, 2016.

Stream Processing (DSMS) Event Processing (CEP) Window merge Window operator Streams Application

Stream Processing

3

slide-4
SLIDE 4

http://streamreasoning.org/events/streamapp2017

Solutions vs. requirements

Requirement DSMS CEP Sem Web volume velocity variety incompleteness noise reactive answers fine-grained information access complex domain models high-level languages

4

slide-5
SLIDE 5

http://streamreasoning.org/events/streamapp2017

Stream Reasoning

  • Research question

– is it possible to make sense in real time of multiple, heterogeneous, gigantic and inevitably noisy and incomplete data streams in order to support the decision processes of extremely large numbers of concurrent users?

Emanuele Della Valle: On Stream Reasoning. PhD thesis, Vrije Universiteit Amsterdam, 2015. Available online at http://dare.ubvu.vu.nl/handle/1871/53293 .

5

slide-6
SLIDE 6

http://streamreasoning.org/events/streamapp2017

Is this feasible?

  • Proposed approach: cascading Stream Reasoning

Complexity Raw Stream Processing Semantic Streams DL-Lite DL Abstraction Selection Interpretation Reasoning Querying Re-writing Change Frequency

PTIME NEXPTIME

104 Hz 1 Hz

Complexity vs. Dynamics

AC0

  • H. Stuckenschmidt, S. Ceri, E. Della Valle, F. van Harmelen: Towards Expressive Stream Reasoning.

Proceedings of the Dagstuhl Seminar on Semantic Aspects of Sensor Networks, 2010.

6

slide-7
SLIDE 7

http://streamreasoning.org/events/streamapp2017

A model to describe stream reasoning

  • D. Dell’Aglio, On Unified Stream Reasoning, PhD thesis, Politecnico di Milano, 2016.

Stream Processing (DSMS) Event Processing (CEP) Window merge Window operator Streams Graph-level entailment Window-level entailment Stream-level entailment Application

Stream Reasoning

7

slide-8
SLIDE 8

http://streamreasoning.org/events/streamapp2017

A model to describe stream reasoning

  • D. Dell’Aglio, On Unified Stream Reasoning, PhD thesis, Politecnico di Milano, 2016.

Stream Processing (DSMS) Event Processing (CEP) Window merge Window operator Streams Graph-level entailment Window-level entailment Stream-level entailment Application

Stream Reasoning

8

slide-9
SLIDE 9

http://streamreasoning.org/events/streamapp2017

  • DL Ontology Stream ST

– A ontology stream with respect to a static Tbox T is a sequence of Abox axioms ST(i)

  • A Windowed Ontology Stream ST(o,c]

– A windowed ontology stream with respect to a static Tbox T is the union of the Abox axioms ST(i) where

  • <i≤c
  • Reasoning on a Windowed Ontology Stream

ST(o,c] is as reasoning on a static DL KB

continuous deductive reasoning

Emanuele Della Valle, Stefano Ceri, Davide Francesco Barbieri, Daniele Braga, Alessandro Campi: A First Step Towards Stream Reasoning. FIS 2008: 72-81

slide-10
SLIDE 10

http://streamreasoning.org/events/streamapp2017

  • Query: measure the the impact of Alice's microposts

MEMO: our running example data model

  • For example

p1 p3 p5 p8

discusses discusses discusses

p2 p4 p7 p6

discusses discusses discusses discusses

now 10 min ago 20 min ago 30 min ago 40 min ago 50 min ago

Post discusses Alice posts p1 . Bob posts p2 .

Example of Stream Reasoning 1/2

10

slide-11
SLIDE 11

http://streamreasoning.org/events/streamapp2017

discusses discusses discusses discusses discusses discusses discusses

Example of Stream Reasoning 2/2

What impact has been my micropost p1 creating in the last hour? Let’s count the number of microposts that discuss it … REGISTER STREAM ImpactMeter AS SELECT (count(?p) AS ?impact) FROM STREAM <http://…/fb> [RANGE 60m STEP 10m] WHERE { :Alice posts [ sr:discusses ?p ] } p1 p3 p5 p8 p2 p4 p7 p6

Transitive property Alice posts p1 .

11

slide-12
SLIDE 12

http://streamreasoning.org/events/streamapp2017

MEMO: forms of reasoning for Q/A

  • Data-driven (a.k.a. forward reasoning)
  • Query-driven – backward reasoning
  • Query-driven – query rewriting (a.k.a. ontology based data access)

Reasoner RDF data SPARQL Inferred data

  • ntology

SPARQL

  • ntology

Rewritten query Reasoner Reasoner RDF data SPARQL

  • ntology

data 12

slide-13
SLIDE 13

http://streamreasoning.org/events/streamapp2017

Naïve Stream Reasoning

  • Data-driven (a.k.a. forward reasoning)
  • Query-driven – backward reasoning

Reasoner RDF data SPARQL Inferred data

  • ntology

Reasoner RDF data

  • ntology

S2R S2R SPARQL 13

slide-14
SLIDE 14

http://streamreasoning.org/events/streamapp2017

Backward and forward naïve Stream Reasoners

  • Streaming knowledge base
  • Ref: O. Walavalkar, A. Joshi, T. Finin and Y. Yesha, Streaming knowledge

bases, in: In International Workshop on Scalable Semantic Web Knowledge Base Systems, 2008.

  • C-SPARQL
  • Ref: D.F. Barbieri, D. Braga, S. Ceri, E. Della Valle, Y. Huang, V. Tresp, A.

Rettinger and H. Wermser, Deductive and inductive stream reasoning for semantic social media analytics, IEEE Intelligent Systems 25(6) (2010), 32–41.

  • Sparkwave
  • Ref: Sparkwave: Continuous Schema-Enhanced Pattern Matching over

RDF Data Streams. Komazec S, Cerri D. DEBS 2012

  • Dynamite
  • Ref: J. Urbani, A. Margara, C.J.H. Jacobs, F. van Harmelen and H.E. Bal,

DynamiTE: Parallel materialization of dynamic 25 RDF data, in: International Semantic Web Conference (1), Lecture Notes in Computer Science, Vol. 8218, Springer, 2013, pp. 657–672.

  • Yasper
  • Ref.. R. Tommasini, E. Della Valle, Challenges and issues of an RSP-QL

implementation, in: Web Stream Processing workshop, 2017

  • You will use it in the next hands on session

14

slide-15
SLIDE 15

http://streamreasoning.org/events/streamapp2017

Naïve Stream Reasoning

  • Data-driven (a.k.a. forward reasoning)
  • Query-driven – backward reasoning
  • Query-driven – query rewriting (a.k.a. ontology based data access)

Reasoner RDF data SPARQL Inferred data

  • ntology
  • ntology

Rewritten query Reasoner Reasoner RDF data

  • ntology

S2R S2R S2R SPARQL SPARQL data 15

slide-16
SLIDE 16

http://streamreasoning.org/events/streamapp2017

Naïve query-driven stream reasoning by query rewriting

  • MEMO
  • It is not that straight forward :-(
  • Lack of a standard query language for DSMS and CEP
  • Lack of a well-understood operational semantics for DSMS

and CEP (cf. SECRET by I. Botan et al., PVLDB 3(1), 2010)

  • Lack of expressiveness in OWL2QL
  • ntology

Rewritten query Reasoner S2R SPARQL data 16

slide-17
SLIDE 17

http://streamreasoning.org/events/streamapp2017

Query rewriting naïve Stream Reasoners

  • Jean-Paul Calbimonte, Óscar Corcho, Alasdair J. G. Gray:

Enabling Ontology-Based Access to Streaming Data

  • Sources. International Semantic Web Conference (1)

2010: 96-111

  • J-P, Calbimonte, J. Mora, O. Corcho, Query rewriting in

RDF stream processing, in: Extended Semantic Web Conference, 2016

17

slide-18
SLIDE 18

http://streamreasoning.org/events/streamapp2017

Not so naïve stream reasoning

  • Naïve data-driven approach
  • From snapshots to changes
  • What has just been inserted?
  • What has just been deleted?

Reasoner RDF data Inferred data

  • ntology

S2R Reasoner Inferred data

  • ntology

S2R insertions deletions

Incremental!!!

SPARQL SPARQL 18

slide-19
SLIDE 19

http://streamreasoning.org/events/streamapp2017

Not so naïve stream reasoning

  • MEMO
  • The problem is that materialization (the result of data-

driven processing) are very difficult to decrement efficiently.

  • State-of-the-art: DReD algorithm

– Over delete – Re-derive – Insert

Reasoner Inferred data

  • ntology

S2R insertions deletions Incremental !!! SPARQL Ceri, S., Widom, J.: Deriving production rules for incremental view maintenance. In: Lohman,G.M., Sernadas, A., Camps, R. (eds.) VLDB, pp. 577–589. Morgan Kaufmann, San Francisco (1991) 19

slide-20
SLIDE 20

http://streamreasoning.org/events/streamapp2017

The Intuition of DRed Algorithm

  • Let’s assume that we have the following materialized graph
  • While inserts are not problematic, deletion are difficult to
  • handle. If we delete p2 discusses p1 (p2->p1), we have
  • verestimate the impact of the deletion and mark for

deletion p4->p1 that can be derived by p4->p2 and p2->p1

  • look for alternative derivation of p4->p1 and eventually

find the chain p4->p3 and p3->p1 p1 p2 p3 p4

discusses discusses discusses discusses discusses

p1 p2 p3 p4

discusses discusses discusses discusses discusses

p1 p3 p4

discusses discusses discusses 20

slide-21
SLIDE 21

http://streamreasoning.org/events/streamapp2017

DReD-based stream reasoners

  • TROWL
  • How: DRed in the context of approximate reasoning
  • Ref: Y. Ren, J. Z. Pan. Optimising ontology stream

reasoning with truth maintenance system. In CIKM (2011)

  • The Backward/Forward Algorithm
  • How: optimizing DRed
  • B. Motik, Y. Nenov, R.E.F. Piro, I. Horrocks: Incremental

Update of Datalog Materialisation: the Backward/Forward Algorithm. AAAI 2015: 1560-1568

21

slide-22
SLIDE 22

http://streamreasoning.org/events/streamapp2017

Is DReD needed?

  • DReD works with random insertions and deletions
  • In a streaming setting, when a triple enters the window,

given the size of the window, the reasoner knows already when it will be deleted!

  • E.g.,
  • if the window is 40 minutes

long, and,

  • it is 10:00, the triple(s)

entering now

  • will exit on 10:40.
  • Conclusion
  • deletions are predictable

Time Enter window Exit window Explicitly in window In 10:00 AßB 10:10 BßC 10:20 AßE 10:30 EßC 10:40 AßB 10:50 BßC 11:00 AßE A B A B C A B C E A B C E A C E A B C E C E

22

slide-23
SLIDE 23

http://streamreasoning.org/events/streamapp2017

IMaRS algorithm

  • Idea:
  • add an expiration time to each triple and
  • use an hash table to index triples by their expiration time
  • The algorithm
  • 1. deletes expired triples
  • 2. Adds the new derivations that are consequences of insertions

annotating each inferred triple with an expiration time (the min of those of the triple it is derived from), and

  • 3. when multiple derivations occur, for each multiple

derivation, it keeps the max expiration time.

D.F. Barbieri, D. Braga, S.Ceri, E. Della Valle, M. Grossniklaus: Incremental Reasoning on Streams and Rich Background Knowledge. ESWC (1) 2010: 1-15

  • D. Dell'Aglio, E. Della Valle: Incremental Reasoning on RDF Streams. In A.Harth, K.Hose,

R.Schenkel (Eds.) Linked Data Management, CRC Press 2014, ISBN 9781466582408 23

slide-24
SLIDE 24

http://streamreasoning.org/events/streamapp2017

IMaRS algorithm

  • Incremental Reasoning on RDF streams (IMaRS): new

reasoning algorithm optimized for reactive query answering

§ Re-materialize after each window slide § Use DRed § IMaRS

% of deletions w.r.t. the content of the window

24

slide-25
SLIDE 25

http://streamreasoning.org/events/streamapp2017

A model to describe stream reasoning

  • D. Dell’Aglio, On Unified Stream Reasoning, PhD thesis, Politecnico di Milano, 2016.

Stream Processing (DSMS) Event Processing (CEP) Window merge Window operator Streams Graph-level entailment Window-level entailment Stream-level entailment Application

Stream Reasoning

25

slide-26
SLIDE 26

http://streamreasoning.org/events/streamapp2017

  • Graph-level entailment considers data item contents, but it does

not use the temporal annotations

  • Window-level entailment applies the inference process on the

non-merged stream items.

  • E.g.,

– A door cannot be open and close at the same time – A window contains: door A is open @1, door A is close @2 – At graph-level the reasoner tells that there is an inconsistency in the window because it ignore the parts in italics – At window-level the reasoner does not

  • Best approaches I saw so far

– ÖL Özçep, R Möller. Ontology Based Data Access on Temporal and Streaming Data. Reasoning Web, 2014 – D. Dell'Aglio et al. :A Query Model to Capture Event Pattern Matching in RDF Stream Processing Query Languages EKAW 2016: 145-162

window level entailment

slide-27
SLIDE 27

http://streamreasoning.org/events/streamapp2017

A model to describe stream reasoning

  • D. Dell’Aglio, On Unified Stream Reasoning, PhD thesis, Politecnico di Milano, 2016.

Stream Processing (DSMS) Event Processing (CEP) Window merge Window operator Streams Graph-level entailment Window-level entailment Stream-level entailment Application

Stream Reasoning

27

slide-28
SLIDE 28

http://streamreasoning.org/events/streamapp2017

  • Window-level entailment only considers a recent portion of

the stream

  • Stream-level entailment aims at considering the entire

stream

  • This is not just a theoretical dream, CEP does so

– E.g., rise C for every A that follows a B without a C in the middle

  • Best approaches I saw so far

– ETALIS

  • Anicic, D., Rudolph, S., Fodor, P., & Stojanovic, N. Stream reasoning and

complex event processing in ETALIS Semantic Web,3(4), 2012, 397–407.

– LARS

  • H. Beck, M. Dao-Tran, T. Eiter, M. Fink: LARS: A Logic-Based Framework

for Analyzing Reasoning over Streams. AAAI 2015: 1431-1438H.

Stream-level entailment

slide-29
SLIDE 29

How to Build a Stream Reasoning Application

  • D. Dell'Aglio, E. Della Valle,
  • T. Le-Pham, A. Mileo, and R. Tommasini

http://streamreasoning.org/events/streamapp2017

DL-based Stream Reasoning

Emanuele Della Valle