Complex Event Processing and Pattern
Matching
Syed Gillani1,2 Gauthier Picard1 Fr´ed´erique Laforest2
Antoine Zimmermann1
Institute Henri Fayol, EMSE, Saint-Etienne, France1
Overview
Introduction
Traditional Vs Real-Time Data Processing Event Processing Vs Time Axis
Complex Event Processing
Semantic Complex Event Processing
Proposed Approach
Traditional Vs Real-Time Data Processing
Database
One Shot Database Queries
E2 E4 E1 E3 E5 En Continuous Event Query Processing
Event Arrival Time
Time-Past Time-Future
Incoming Events
Time-Current
Event Processing Vs Time Axis
Before Event Arrival
At Event Arrival Some Time
After the Event
After Considerable Time e.g. 2 Hours, 1 Day, 3 Months
Time Axis Proactive Actions Pr edictive A nal ysis (Based on Historical Anal ysis ) Real-Time Complex Event Pr ocessing and Patter n Matching Late Reaction Historical Events Post Processing and Historical Analysis
Complex Event Processing
I Aggregation, derivation of Primitive Events
I Occurrence and non-occurrence of certain events
I Imposing Temporal Constraints (application of certain
rules )
I For Instance
I Detection of state changes based on observations (If total
consumed electricity > 10MWatt)
I Matching sequence of events that describes a scenario (If
A<10 AND B>40 OR B<80 AND C>90)
Primitive Events Primitive Events Primitive Events Complex Events Event Source 1 Event Source 2 Event Source n
Overview
Introduction
Semantic Complex Event Processing SCEP
State-of-the-art SCEP
Foundational Challenges for SCEP
Proposed Approach
SCEP
I Complex Event Processing +Stream Reasoning+ Semantic
Technologies (rules & ontologies) + Heterogeneous Data Handling?
I Incoming Stream Reasoning + Background Knowledge
I Distributed into TWO flavours
I Stream Reasoning (Real Time + Background Information +
Aggregation through Windows) (C-SPARQL, CQELS....)
I Pattern Matching (Sequence, Optional, Negation)
State-of-the-art SCEP
*Streaming the Web: Reasoning over Dynamic Data: Alessandro Margara, Jacopo Urbani, Frank van Harmelen, Henri Bal
State-of-the-art SCEP
I Complex Pattern Matching (Approaches)
I Relational Community
I NFA, EDG, RETE algorithm, Rule based system
I Semantic Web Community
I RETE algorithm, Logical Rule based system
I How about NFA and EDG in SCEP context?
I NFA and EDG are proven to be the most efficient for
Pattern Matching in relational community
*Non-Deterministic Finite Automata *Event Detection Graphs
Foundational Challenges for SCEP
I Distributed Event Processing (per Query): Moving from
centralised push based event processing
I Distributed Temporal Pattern Matching: Dedicated language
for Pattern Matching (Implementation of Kleene Closure, Negation in distributed manner)
I Historical Management of Events: Storing and Partitioning of
events
I Defining Event Boundaries: Triple based to Graph based
streaming, preserving graph model to implement Event boundaries
I Predictive Event Processing: A new paradigm for SCEP
Overview
Introduction
Semantic Complex Event Processing
Proposed Approach
Event and Stream Data Model
Query Model and Language Specification
Event and Stream Data Model
I Considering RDF as first class citizen (even for temporal
reasoning, instead relying on external engines)
I Temporally Annotated RDF Named Graph
(<NG, [ts, te] >)
< h t t p :// www . s t r e a m i n g i n f o . com / ElecGen > [ st1 , et1 ]
: g e n 1 : h a s N a m e ‘ PowGen - Sect1 ’.
: g e n 1 : h a s L o c a t i o n ‘ St - Etienne ’. : g e n 1 : h a s C u r r e n t P o w e r ‘60 ’.
Proposed Data Model
I Data Partitioning ==> Optimises query time
I Summarisation ==> Merging of similar NG
I Event Boundaries ==> With NG
I Access Control ==> With NG
I Provenance Tracking ==> With NG
Query Model and Language Specification
I Former Query Models
I Reliance on Triple-Based Data Model
I Uses black-box approach (delegation to external Engines)
I Overhead in query and data translation
I Query Semantics not suitable for distributed processing per
Proposed Query Model
Sub-Query 1 (Event Pattern A)
Sub-Query 2 (Event Pattern B)
Sub-Query 3 (Event Pattern C)
(a) (b) Stream Source Selection, Temporal Operators Pattern Duration Temporal Pattern Description Rewritten Subqueries (Stream Processing) KB Integration
System Overview
S1 S2 S3 S4 J1 J2 G1 G2 Pattern Module E1 E2 E3 Rule n . . . Rule 2 Rule 1 D B A∆ =P1⇒True ∆ =P1&P2⇒True
∆ =P1&P2⇒True
∆ =P2&P3⇒True
Stream
1 Stream 2 Stream 3 Stream 4
Stage 1: Stream Selection Stage 2: Continuous Query Processing and Inference Stage 3: Rule or Pattern Mapping Stage 4: Distributed and Parallel Pattern Matching
(a) EDG (b) NFA
Storage of Archived Streams
Archived Streams
Streami : Incoming Streams Sk : Select Operators Ji : Join Operations Gt : Generated Events
Proposed Model
I Supports Triple based and NG based data model
I Offers event source based Filtering
I Historical management of events through summarisation
(Facts Assignments)
I Provide dedicated design for SCEP (No Data or Query
Translation unlike EP-SPARQL and other systems)
I Distributed and parallel sub-query processing with query
Proposed Model
I Integrating stream processing and CEP
I Offers various new operators including, Sequencing,
Kleene Closure and Negation for RDF Graph patterns
I Allows NFA and EDG to be used in the context of SCEP
through query rewriting (from Rule based to State based system)
Overview
Introduction
Semantic Complex Event Processing
Proposed Approach
Conclusion
I Annotated RDF NG enables temporal reasoning at RDF
level
I Our data/query model and query rewriting allows
I Annotated NG based event data model I Historical management of stream data
I Integration of various new operators for RDF Graphs
(Kleene Closure, Negation )
I Integration of NFA and EDG in the context of SCEP I Parallel and distributed event processing (per query)