38
IoT-Intelligence and Web Stream Reasoning Towards Complex Reasoning over Big Data Streams with Answer Set Programming Alessandra Mileo Senior Research Fellow Insight Centre for Data Analytics, NUIG alessandra.mileo@insight-centre-org Ali Intizar Research Fellow Insight Centre for Data Analytics, NUIG ali.intizar@insight-centre-org

IoT-Intelligence and Web Stream Reasoning · 2015-11-12 · • Streaming new learning examples are added to the set of learning examples E • Assert/Retract, time decay and sliding

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: IoT-Intelligence and Web Stream Reasoning · 2015-11-12 · • Streaming new learning examples are added to the set of learning examples E • Assert/Retract, time decay and sliding

IoT-Intelligence and Web Stream Reasoning

Towards Complex Reasoning over Big Data Streams with Answer Set Programming

Alessandra Mileo Senior Research Fellow Insight Centre for Data Analytics, NUIG alessandra.mileo@insight-centre-org

Ali Intizar Research Fellow Insight Centre for Data Analytics, NUIG ali.intizar@insight-centre-org

Page 2: IoT-Intelligence and Web Stream Reasoning · 2015-11-12 · • Streaming new learning examples are added to the set of learning examples E • Assert/Retract, time decay and sliding

IoT- Intelligence at Unit for Reasoning & Querying (URQ)

1.  Representation and linking

2.  Finding what we need

3.  Dynamic Problem Solving (Stream Reasoning)

2  Stream  Reasoning  Workshop,  Vienna,  9th  November  2015  

Page 3: IoT-Intelligence and Web Stream Reasoning · 2015-11-12 · • Streaming new learning examples are added to the set of learning examples E • Assert/Retract, time decay and sliding

IoT- Intelligence at Unit for Reasoning & Querying (URQ)

1.  Representation and linking

2.  Finding what we need

3.  Dynamic Problem Solving (Stream Reasoning)

Smart  Ci=es  Enterprise  

Communica=on  

3  Stream  Reasoning  Workshop,  Vienna,  9th  November  2015  

Page 4: IoT-Intelligence and Web Stream Reasoning · 2015-11-12 · • Streaming new learning examples are added to the set of learning examples E • Assert/Retract, time decay and sliding

What  streams  do  I  need  and  how  “good”  are  they?  (Stream  Discovery  and  

Federa;on)  

4  Stream  Reasoning  Workshop,  Vienna,  9th  November  2015  

Page 5: IoT-Intelligence and Web Stream Reasoning · 2015-11-12 · • Streaming new learning examples are added to the set of learning examples E • Assert/Retract, time decay and sliding

Quality and context-aware stream discovery

•  What information do I need? –  Data interoperability: Semantic descriptions –  Interface interoperability: streams as event

services •  How good is it?

–  ADAPT to quality requirements and preferences for data source selection

–  Efficient processing of event logic

5  Stream  Reasoning  Workshop,  Vienna,  9th  November  2015  

Page 6: IoT-Intelligence and Web Stream Reasoning · 2015-11-12 · • Streaming new learning examples are added to the set of learning examples E • Assert/Retract, time decay and sliding

Quality and context-aware stream discovery

•  What information do I need? –  Data interoperability: Semantic descriptions –  Interface interoperability: streams as event

services •  How good is it?

–  ADAPT to quality requirements and preferences for data source selection

–  Efficient processing of event logic

6  

Seman=c  Web  

Stream  Reasoning  Workshop,  Vienna,  9th  November  2015  

Page 7: IoT-Intelligence and Web Stream Reasoning · 2015-11-12 · • Streaming new learning examples are added to the set of learning examples E • Assert/Retract, time decay and sliding

Quality and context-aware stream discovery

•  What information do I need? –  Data interoperability: Semantic descriptions –  Interface interoperability: streams as event

services •  How good is it?

–  ADAPT to quality requirements and preferences for data source selection

–  Efficient processing of event logic

7  

Seman=c  Web  

Service  Oriented  Architectures  

Stream  Reasoning  Workshop,  Vienna,  9th  November  2015  

Page 8: IoT-Intelligence and Web Stream Reasoning · 2015-11-12 · • Streaming new learning examples are added to the set of learning examples E • Assert/Retract, time decay and sliding

Quality and context-aware stream discovery

•  What information do I need? –  Data interoperability: Semantic descriptions –  Interface interoperability: streams as event

services •  How good is it?

–  ADAPT to quality requirements and preferences for data source selection

–  Efficient processing of event logic

8  

Seman=c  Web  

Service  Oriented  Architectures  

Con=nuous  constraint  checking  

Stream  Reasoning  Workshop,  Vienna,  9th  November  2015  

Page 9: IoT-Intelligence and Web Stream Reasoning · 2015-11-12 · • Streaming new learning examples are added to the set of learning examples E • Assert/Retract, time decay and sliding

Quality and context-aware stream discovery

•  What information do I need? –  Data interoperability: Semantic descriptions –  Interface interoperability: streams as event

services •  How good is it?

–  ADAPT to quality requirements and preferences for data source selection

–  Efficient processing of event logic

9  

Seman=c  Web  

Service  Oriented  Architectures  

DSMS  and  CEP  

Con=nuous  constraint  checking  

Stream  Reasoning  Workshop,  Vienna,  9th  November  2015  

Page 10: IoT-Intelligence and Web Stream Reasoning · 2015-11-12 · • Streaming new learning examples are added to the set of learning examples E • Assert/Retract, time decay and sliding

Summary of the Approach

•  How to describe complex event services? –  Create an Event Service Ontology with Event Patterns.

•  How to determine if two event patterns are functionally equivalent? –  Create and compare canonical event patterns to find substitutes.

•  How to create event compositions and choose the optimal? –  Top-down traverse to find functionally-equivalent canonical

patterns. •  How to derive event service compositions efficiently?

–  Construct and utilize an Event Reusability Hierarchy for event service composition.

10  

Gao,  F.,  Ali,  M.I.,  Curry,  E.,  Mileo,  A.:  On  Discovery  and  Integra2on  of  Urban  Data  Streams  for  Real2me  Smart  City  Applica2ons.  J.  Data  Seman=cs  (2015)  to  appear  

Stream  Reasoning  Workshop,  Vienna,  9th  November  2015  

Page 11: IoT-Intelligence and Web Stream Reasoning · 2015-11-12 · • Streaming new learning examples are added to the set of learning examples E • Assert/Retract, time decay and sliding

Automated Complex Event Implementation System

Semantic Annotation

ACEIS Core

ResourceManagement

Application Interface

Knowledge Base

QoI/QoS

Stream Description

Data Mgmt, Indexing, Caching

User Input

Event Request

Data Federation

Resource Discovery

Event Service Composer

Composition Plan

Subscription Manager

Query Transformer

Query Engine

Query

Results

Constraint Validation

Constraint Violation

Adaptation Manager

Data Store IoT Data Stream

Social Data Stream

11 Stream  Reasoning  Workshop,  Vienna,  9th  November  2015  

Page 12: IoT-Intelligence and Web Stream Reasoning · 2015-11-12 · • Streaming new learning examples are added to the set of learning examples E • Assert/Retract, time decay and sliding

IoT- Intelligence at Unit for Reasoning & Querying (URQ)

1.  Representation and linking

2.  Finding what we need

3.  Dynamic Problem Solving (Stream Reasoning)

Smart  Ci=es  Enterprise  

Communica=on  

12  Stream  Reasoning  Workshop,  Vienna,  9th  November  2015  

Page 13: IoT-Intelligence and Web Stream Reasoning · 2015-11-12 · • Streaming new learning examples are added to the set of learning examples E • Assert/Retract, time decay and sliding

How  to  leverage  the  IoT  and  Seman;c  Web  infrastructure  for  (efficient)  

Web  Stream  Reasoning?  

13  Stream  Reasoning  Workshop,  Vienna,  9th  November  2015  

Page 14: IoT-Intelligence and Web Stream Reasoning · 2015-11-12 · • Streaming new learning examples are added to the set of learning examples E • Assert/Retract, time decay and sliding

Data  

Stream

s  

Stream  Query  Processing  

Seman=c  Complex  Event  Processing  

relevant  events  

complex  events  

Stream  Reasoning  

solu=on  sets  

Data  

Stream

s  Da

ta  

Stream

s  Applica=ons  

Scalability  

Expressivity  

14  Stream  Reasoning  Workshop,  Vienna,  9th  November  2015  

Page 15: IoT-Intelligence and Web Stream Reasoning · 2015-11-12 · • Streaming new learning examples are added to the set of learning examples E • Assert/Retract, time decay and sliding

The StreamRule idea

15  

•  2-tier approach: not all data streams are relevant for complex reasoning •  Enrich the ability of complex reasoning over data streams •  Keep the solution scalable •  Leverage existing engines from both stream processing and non-

monotonic reasoning research areas

Mileo,  A.,  Abdelrahman,  A.,  Policarpio,  S.,  Hauswirth,  M.:  Streamrule:  A  nonmonotonic  stream  reasoning  system  for  the  Seman2c  Web.  In:  RR  2013,  247–252  

Stream  Reasoning  Workshop,  Vienna,  9th  November  2015  

Page 16: IoT-Intelligence and Web Stream Reasoning · 2015-11-12 · • Streaming new learning examples are added to the set of learning examples E • Assert/Retract, time decay and sliding

Limitations

16  

•  The more expressive the inference task, the longer it takes to perform reasoning

•  Bottleneck when results are returned not as fast as the next input arrives

Stream  Reasoning  Workshop,  Vienna,  9th  November  2015  

Page 17: IoT-Intelligence and Web Stream Reasoning · 2015-11-12 · • Streaming new learning examples are added to the set of learning examples E • Assert/Retract, time decay and sliding

Limitations

17  

•  The more expressive the inference task, the longer it takes to perform reasoning

•  Bottleneck when results are returned not as fast as the next input arrives

Stream  Reasoning  Workshop,  Vienna,  9th  November  2015  

Page 18: IoT-Intelligence and Web Stream Reasoning · 2015-11-12 · • Streaming new learning examples are added to the set of learning examples E • Assert/Retract, time decay and sliding

Adaptation Heuristics: ongoing work

•  More than an engineering problem –  How to model interactions between RSP and ASP components,

including different semantics, input split, window-size tuning,…

•  Design and runtime features –  E.g. operational semantics (design) and throughput (runtime)

•  Streaming rate and window size: where’s the tradeoff?

•  Reasoning Complexity: how far can we go? How can we parametrise the complexity to estimate the execution time

18  Stream  Reasoning  Workshop,  Vienna,  9th  November  2015  

Page 19: IoT-Intelligence and Web Stream Reasoning · 2015-11-12 · • Streaming new learning examples are added to the set of learning examples E • Assert/Retract, time decay and sliding

Goal

Given a fixed streaming size S with fixed complexity C and unit of time U, find a window size W such that the time required to process S events using windows of

size W is less than or equal to one unit of time

19  

Tω S,W( )≤U

ClingoTranslator Translatorfacts answer setevents answers

Asp Rules

Reasoner

Germano,  S.,  Pham,  T.L.,  Mileo,  A.:  Web  stream  reasoning  in  prac2ce:  on  the  expressivity  vs.  scalability  tradeoff.  In:  Web  Reasoning  and  Rule  Systems  -­‐  9th  Interna=onal  Conference,  RR  2015,  Berlin,  Germany,  August  4-­‐5,  2015,  Proceedings.  (2015)  105–112  

Stream  Reasoning  Workshop,  Vienna,  9th  November  2015  

Page 20: IoT-Intelligence and Web Stream Reasoning · 2015-11-12 · • Streaming new learning examples are added to the set of learning examples E • Assert/Retract, time decay and sliding

Experimental setup

•  Dataset –  Simulated randomly generated events of the type

event(type, name, value, latitude, longitude) E.g. event(weather, strong-wind, 2014-11-26T13:00:00, 38.011736, 12.186724)

•  Reasoning tasks –  Ranking event criticality –  Contextualizing events based on user status –  Default rule to detect changes in event criticality

•  Run –  Streaming size up to 30000 –  Reasoner triggered 20 times for each S

20  Stream  Reasoning  Workshop,  Vienna,  9th  November  2015  

Page 21: IoT-Intelligence and Web Stream Reasoning · 2015-11-12 · • Streaming new learning examples are added to the set of learning examples E • Assert/Retract, time decay and sliding

Empirical Results

21  Stream  Reasoning  Workshop,  Vienna,  9th  November  2015  

Page 22: IoT-Intelligence and Web Stream Reasoning · 2015-11-12 · • Streaming new learning examples are added to the set of learning examples E • Assert/Retract, time decay and sliding

Empirical Results

T 20000( ) =1232ms

22  Stream  Reasoning  Workshop,  Vienna,  9th  November  2015  

Page 23: IoT-Intelligence and Web Stream Reasoning · 2015-11-12 · • Streaming new learning examples are added to the set of learning examples E • Assert/Retract, time decay and sliding

Empirical Results

T 20000( ) =1232msT 5000( ) = 216ms

23  Stream  Reasoning  Workshop,  Vienna,  9th  November  2015  

Page 24: IoT-Intelligence and Web Stream Reasoning · 2015-11-12 · • Streaming new learning examples are added to the set of learning examples E • Assert/Retract, time decay and sliding

Empirical Results

Tω 20000, 5000( ) = 200005000

⎡⎢⎢

⎤⎥⎥×T(5000)

= 4×216ms = 864ms

T 20000( ) =1232msT 5000( ) = 216ms

24  Stream  Reasoning  Workshop,  Vienna,  9th  November  2015  

Page 25: IoT-Intelligence and Web Stream Reasoning · 2015-11-12 · • Streaming new learning examples are added to the set of learning examples E • Assert/Retract, time decay and sliding

Empirical Results

Tω 20000, 5000( ) = 200005000

⎡⎢⎢

⎤⎥⎥×T(5000)

= 4×216ms = 864ms

T 20000( ) =1232msT 5000( ) = 216ms

Tω 20000, 2000( ) = 200002000

⎡⎢⎢

⎤⎥⎥×T(2000)

=10×72ms = 720ms

25  Stream  Reasoning  Workshop,  Vienna,  9th  November  2015  

Page 26: IoT-Intelligence and Web Stream Reasoning · 2015-11-12 · • Streaming new learning examples are added to the set of learning examples E • Assert/Retract, time decay and sliding

Ongoing work

•  Relaxing the independence assumption –  Extended notion of dependency graph –  Possibly use duplication –  Smaller input sets given to the same ASP program –  Demonstrate correctness of results

•  Going parallel –  Explore parallelism of SPARK for higher scalability –  Requires to map an ASP program to SPARK jobs

•  Correlation between reasoning complexity and execution time

Stream  Reasoning  Workshop,  Vienna,  9th  November  2015   26  

Reasoning Complexity

Streaming rate Window size

Page 27: IoT-Intelligence and Web Stream Reasoning · 2015-11-12 · • Streaming new learning examples are added to the set of learning examples E • Assert/Retract, time decay and sliding

Dealing  with  Uncertainty  and  learning  rela;onal  

structures  

27  Stream  Reasoning  Workshop,  Vienna,  9th  November  2015  

Page 28: IoT-Intelligence and Web Stream Reasoning · 2015-11-12 · • Streaming new learning examples are added to the set of learning examples E • Assert/Retract, time decay and sliding

IoT data are messy: deal with uncertainty

•  Expressive inference –  non-monotonicity, noisy, partial and inconsistent data

•  “ease of” declarative logic-based reasoning to model a problem/domain. Still we need to manage uncertainty and non-monotonicity

•  Probabilistic rules for uncertain knowledge and learning by example –  represent, use, infer and learn probabilistic knowledge (PrASP)

28  

Can we (learn the) answer to questions about uncertain knowledge using qualitative (declarative) inference in dynamic environments?

Stream  Reasoning  Workshop,  Vienna,  9th  November  2015  

Page 29: IoT-Intelligence and Web Stream Reasoning · 2015-11-12 · • Streaming new learning examples are added to the set of learning examples E • Assert/Retract, time decay and sliding

What is Streaming PrASP

A framework that uses: 1.  PrASP as an uncertainty reasoning server to reason over Streaming

Web Data 2.  Continuous Query Processing over Linked Data Streams for data

filtering

29  

Nickles,  M.,  Mileo,  A.:  Web  stream  reasoning  using  probabilis2c  answer  set  programming.  In:  Web  Reasoning  and  Rule  Systems  (RR)  2014.  (2014)  197–205  

Stream  Reasoning  Workshop,  Vienna,  9th  November  2015  

Page 30: IoT-Intelligence and Web Stream Reasoning · 2015-11-12 · • Streaming new learning examples are added to the set of learning examples E • Assert/Retract, time decay and sliding

What is Streaming PrASP

A framework that uses: 1.  PrASP as an uncertainty reasoning server to reason over Streaming

Web Data 2.  Continuous Query Processing over Linked Data Streams for data

filtering

30  

What  is  PrASP  then?  

Nickles,  M.,  Mileo,  A.:  Web  stream  reasoning  using  probabilis2c  answer  set  programming.  In:  Web  Reasoning  and  Rule  Systems  (RR)  2014.  (2014)  197–205  

Stream  Reasoning  Workshop,  Vienna,  9th  November  2015  

Page 31: IoT-Intelligence and Web Stream Reasoning · 2015-11-12 · • Streaming new learning examples are added to the set of learning examples E • Assert/Retract, time decay and sliding

PrASP is…

… an experimental Statistical Relational Learning (SRL) reasoner based on Answer Set Programming (ASP) … represent, use infer and learn probabilistic knowledge

31  

PrASP can…

Ma`hias  Nickles,  Alessandra  Mileo:  A  System  for  Probabilis2c  Induc2ve  Answer  Set  Programming.  SUM  2015:  99-­‐105  

Stream  Reasoning  Workshop,  Vienna,  9th  November  2015  

Page 32: IoT-Intelligence and Web Stream Reasoning · 2015-11-12 · • Streaming new learning examples are added to the set of learning examples E • Assert/Retract, time decay and sliding

Queries

Examples

Hypotheses

PrASP 0.6 inference core

ASP grounder/solver

(default: Clingo 3)

PrASP program (given knowledge base)

Pre-processing(translation of FOL

syntax, ...)

Spanning program(disjunctions from

weighted formulas)

F2LP(optional)

Filteringof formulas

with no or very little influence

on queries

Possible worlds(sampled answer sets)

System of linear equations (or inequalities)

CVC4(SMT solver;

optional)

Probability distribution over possible worlds (maximum entropy

solution of equations)

Query probabilities

Simplificationof rules with

independent events Native solver for linear systems

PrASP learning core

Stream  Reasoning  Workshop,  Vienna,  9th  November  2015   32  

Page 33: IoT-Intelligence and Web Stream Reasoning · 2015-11-12 · • Streaming new learning examples are added to the set of learning examples E • Assert/Retract, time decay and sliding

Streaming PrASP

•  Streaming new beliefs are added incrementally to a loaded PrASP program

•  Streaming new learning examples are added to the set of learning examples E

•  Assert/Retract, time decay and sliding windows supported

•  Windows prefixes realized by a caching mechanism (no reactive ASP used) for faster processing

•  Preprocessing based on RDF query processing over streams (SPARQL 1.1 + streaming operators)

33  Stream  Reasoning  Workshop,  Vienna,  9th  November  2015  

Page 34: IoT-Intelligence and Web Stream Reasoning · 2015-11-12 · • Streaming new learning examples are added to the set of learning examples E • Assert/Retract, time decay and sliding

Streaming PrASP framework

34  

PrASPASP grounder/

solver

PrASP CQELS client(RDF filtering client)

RDF data stream

Probabilistic ASP/FOLbeliefs/examples stream

CQELS/SPARQL query

PrASP program (knowledge base)

Probabilistic queries

Static learning examples

CQELS

Incremental results

Hypotheses

trans-formation

pattern

t

t

Query & learningresults

t window

window

Stream  Reasoning  Workshop,  Vienna,  9th  November  2015  

Page 35: IoT-Intelligence and Web Stream Reasoning · 2015-11-12 · • Streaming new learning examples are added to the set of learning examples E • Assert/Retract, time decay and sliding

Streaming PrASP framework

35  

PrASPASP grounder/

solver

PrASP CQELS client(RDF filtering client)

RDF data stream

Probabilistic ASP/FOLbeliefs/examples stream

CQELS/SPARQL query

PrASP program (knowledge base)

Probabilistic queries

Static learning examples

CQELS

Incremental results

Hypotheses

trans-formation

pattern

t

t

Query & learningresults

t window

window

Stream  Reasoning  Workshop,  Vienna,  9th  November  2015  

Page 36: IoT-Intelligence and Web Stream Reasoning · 2015-11-12 · • Streaming new learning examples are added to the set of learning examples E • Assert/Retract, time decay and sliding

Ongoing work

•  More experiments on Web Stream Reasoning with PrASP

–  Looking for Usecase Scenarios and DATA to test PrASP –  Building a set of modules that can be downloaded and used for

feedback •  Continuously exploring options for optimization, especially in the

learning task

•  More ambitious goals –  Structure Learning –  Relation between Streaming ASP and PrASP (currently not using

Streaming ASP)

Stream  Reasoning  Workshop,  Vienna,  9th  November  2015   36  

Page 37: IoT-Intelligence and Web Stream Reasoning · 2015-11-12 · • Streaming new learning examples are added to the set of learning examples E • Assert/Retract, time decay and sliding

Data  

Stream

s  

Stream  Query  Processing  

Seman=c  Complex  Event  Processing  

relevant  events  

complex  events  

Stream  Reasoning  

solu=on  sets  

Data  

Stream

s  Da

ta  

Stream

s  Applica=ons  

Scalability  

Expressivity  

37  Stream  Reasoning  Workshop,  Vienna,  9th  November  2015  

Page 38: IoT-Intelligence and Web Stream Reasoning · 2015-11-12 · • Streaming new learning examples are added to the set of learning examples E • Assert/Retract, time decay and sliding

IoT-Intelligence and Web Stream Reasoning

Towards Complex Reasoning over Big Data Streams with Answer Set Programming

Alessandra Mileo Senior Research Fellow Insight Centre for Data Analytics, NUIG alessandra.mileo@insight-centre-org

Ali Intizar Research Fellow Insight Centre for Data Analytics, NUIG ali.intizar@insight-centre-org