Naïve solution: an example TBOX dom( ) ⊑ rng( ) ⊑ ∈ ∈ 1 2 ∈ ∈ S 1 3 2 Della Valle, Dell’Aglio and Margara 32
Naïve solution: an example TBOX dom( ) ⊑ rng( ) ⊑ S 1 3 2 Della Valle, Dell’Aglio and Margara 33
Naïve solution: an example TBOX dom( ) ⊑ rng( ) ⊑ ∈ ∈ ∈ 2 3 2 ∈ ∈ ∈ S 1 3 2 Della Valle, Dell’Aglio and Margara 34
Incremental maintenance: an example TBOX dom( ) ⊑ rng( ) ⊑ ∈ ∈ 1 2 ∈ ∈ S 1 2 Della Valle, Dell’Aglio and Margara 35
Incremental maintenance: an example TBOX dom( ) ⊑ rng( ) ⊑ ∈ ∈ 1 2 ∈ ∈ S 1 3 2 Della Valle, Dell’Aglio and Margara 36
Incremental maintenance: an example TBOX dom( ) ⊑ rng( ) ⊑ ∈ ∈ 1 2 To be deleted ∈ ∈ S 1 3 2 Della Valle, Dell’Aglio and Margara 37
Incremental maintenance: an example TBOX dom( ) ⊑ ∈ 3 To be rng( ) ⊑ added ∈ ∈ 1 2 To be deleted ∈ ∈ S 1 3 2 Della Valle, Dell’Aglio and Margara 38
Incremental maintenance: an example To be renewed TBOX dom( ) ⊑ ∈ 3 To be rng( ) ⊑ added ∈ ∈ 1 2 To be deleted ∈ ∈ S 1 3 2 Della Valle, Dell’Aglio and Margara 39
Agenda Incremental Materializations of Ontologies – DRed – DynamiTE – TrOWL Incremental Materialization of Ontologies in Stream Processing – IMaRS – Sparkwave Continuous ontology-based query answering – ETALIS and EP-SPARQL – Stream Reasoning with ASP – STARQL Formal Semantics of Stream Reasoning – LARS Della Valle, Dell’Aglio and Margara 40
IMaRS What Add reasoning in window-based RSPs – RDFS (with transitive property) Time-based windows slide: – The materialisation is executed every time the window updates – Only part of data changes at each window update – Materialisation is (usually) an expensive task Intuition: the sliding window operator allows to determine when statements will be removed Della Valle, Dell’Aglio and Margara 41
IMaRS What Variation of DRed for RDF streams It pushes the maintenance algorithm in the window operator An IMaRS window is a sliding window with four parameters: – ω : the size of the window – β : the slide of the window – T: the TBox that describes the data model – M: the maintenance program One of the central IMaRS concepts is the expiration time Della Valle, Dell’Aglio and Margara 43
Expiration time Every time a statement is added to the window, it is annotated with an expiration time The expiration time indicates when the statement should be removed from the materialization TBOX Window (2,1) dom( ) ⊑ rng( ) ⊑ Current time 10 1 S t 7 8 9 10 Della Valle, Dell’Aglio and Margara 44
Expiration time Every time a statement is added to the window, it is annotated with an expiration time The expiration time indicates when the statement should be removed from the materialization TBOX Window (2,1) dom( ) ⊑ rng( ) ⊑ Current time 11 The statement will exit at 13 1 S t 8 9 10 11 Della Valle, Dell’Aglio and Margara 45
Expiration time Every time a statement is added to the window, it is annotated with an expiration time The expiration time indicates when the statement should be removed from the materialization TBOX Window (2,1) dom( ) ⊑ The inferred ∈ 1 rng( ) ⊑ statements will exit at 13 Current time ∈ 11 The statement will exit at 13 1 S t 8 9 10 11 Della Valle, Dell’Aglio and Margara 46
Expiration time Every time a statement is added to the window, it is annotated with an expiration time The expiration time indicates when the statement should be removed from the materialization TBOX Window (2,1) dom( ) ⊑ ∈ 1 rng( ) ⊑ Current time ∈ 12 1 S t 9 10 11 12 Della Valle, Dell’Aglio and Margara 47
Expiration time Every time a statement is added to the window, it is annotated with an expiration time The expiration time indicates when the statement should be removed from the materialization The inferred statements TBOX Window (2,1) expire dom( ) ⊑ ∈ 1 rng( ) ⊑ Current time ∈ 13 1 S t 10 11 12 13 Della Valle, Dell’Aglio and Margara 48
Expiration time Every time a statement is added to the window, it is annotated with an expiration time The expiration time indicates when the statement should be removed from the materialization The inferred statements TBOX Window (2,1) expire dom( ) ⊑ rng( ) ⊑ Current time 13 1 S t 10 11 12 13 Della Valle, Dell’Aglio and Margara 49
Expiration time generation At each window update removed Toberenewed added To be To be Inferred statements Statement deletion Explicit statements The computation is done through the execution of a maintenance program Della Valle, Dell’Aglio and Margara 50
Expiration time generation At each window update removed Toberenewed added To be To be Inferred statements Statement deletion Explicit statements The computation is done through the execution of a maintenance program Expiration time assignment Della Valle, Dell’Aglio and Margara 51
Expiration time generation Expiration time Expiration time assignment update At each window update removed Toberenewed added To be To be Inferred statements Statement deletion Explicit statements The computation is done through the execution of a maintenance program Expiration time assignment Della Valle, Dell’Aglio and Margara 52
IMaRS At a glance DRed IMaRS Delete Lookup Rederive Insert + Renew Insert Della Valle, Dell’Aglio and Margara 53
IMaRS Maintenance Program The maintenance program computes the delta sets ∆ − and ∆ + – It is a logic program The program is executed every time the content changes – In our context, the program is executed every time the window slides The program is composed of maintenance rules – A maintenance rule adds a statement in a set ( context ) if the preconditions are satisfied Della Valle, Dell’Aglio and Margara 54
IMaRS Generation of the maintenance program Rewriting functions Maintenance Ontological program language generator Maintenance TBox program IMaRS Window (ω, β ) Della Valle, Dell’Aglio and Margara 55
Example: DRed 2 1 TBOX Window (3,1) tr( ) Current time 11 2 1 S t 7 8 9 10 Della Valle, Dell’Aglio and Margara 56
Example: DRed 2 1 3 4 TBOX Window (3,1) tr( ) Current time 3 1 12 3 2 2 1 S 4 1 t 8 9 10 11 Della Valle, Dell’Aglio and Margara 57
Example: DRed 2 1 3 4 TBOX Window (3,1) tr( ) Current time 3 1 13 3 2 2 1 3 4 S 4 1 t 9 10 11 12 Della Valle, Dell’Aglio and Margara 58
Example: DRed 2 1 3 4 TBOX Window (3,1) tr( ) Current time 3 1 14 3 2 2 1 3 4 S 4 1 t 10 11 12 13 Della Valle, Dell’Aglio and Margara 59
Example: DRed Delete 2 1 3 4 TBOX Window (3,1) tr( ) Current time 3 1 14 3 2 2 1 3 4 S 4 1 t 10 11 12 13 Della Valle, Dell’Aglio and Margara 60
Example: DRed Delete 2 1 3 4 TBOX Window (3,1) tr( ) Current time 3 1 14 3 2 2 1 3 4 S 4 1 t 10 11 12 13 Della Valle, Dell’Aglio and Margara 61
Example: DRed Delete 2 1 3 Rederive 4 TBOX Window (3,1) tr( ) Current time 3 1 14 3 2 2 1 3 4 S 4 1 t 10 11 12 13 Della Valle, Dell’Aglio and Margara 62
Example: IMaRS 2 1 TBOX Window (3,1) tr( ) Current time 11 2 1 S t 7 8 9 10 Della Valle, Dell’Aglio and Margara 63
Example: IMaRS 2 1 3 4 TBOX Window (3,1) tr( ) Current time 3 1 12 3 2 2 1 S 4 1 t 8 9 10 11 Della Valle, Dell’Aglio and Margara 64
Example: IMaRS 2 1 3 4 TBOX Window (3,1) tr( ) Current time 3 1 13 3 2 2 1 3 4 S 4 1 t 9 10 11 12 Della Valle, Dell’Aglio and Margara 65
Example: IMaRS 2 1 3 4 TBOX Window (3,1) tr( ) Current time 3 1 13 3 2 2 1 3 4 S 4 1 t 9 10 11 12 Della Valle, Dell’Aglio and Margara 66
Example: IMaRS 2 1 3 4 TBOX Window (3,1) tr( ) Current time 3 1 13 3 2 2 1 3 4 S 4 1 t 9 10 11 12 Della Valle, Dell’Aglio and Margara 67
Example: IMaRS 2 1 3 4 TBOX Window (3,1) tr( ) Current time 3 1 14 3 2 2 1 3 4 S 4 1 t 10 11 12 13 Della Valle, Dell’Aglio and Margara 68
Agenda Incremental Materializations of Ontologies – DRed – DynamiTE – TrOWL Incremental Materialization of Ontologies in Stream Processing – IMaRS – Sparkwave Continuous ontology-based query answering – ETALIS and EP-SPARQL – Stream Reasoning with ASP – STARQL Formal Semantics of Stream Reasoning – LARS Della Valle, Dell’Aglio and Margara 69
Sparkwave Goal: – RDF data stream processing with additional RDF Schema-based entailments (including inverse and symmetric properties). Key contributions: – Usage of RETE for stream processing and reasoning, and extension to account for temporal requirements ( time windows ) and RDF Schema (+inverse and symmetric) entailments Who and When – STI Innsbruck (http://sparkwave.sti2.at/), 2011-2013 References – Sparkwave: Continuous Schema-Enhanced Pattern Matching over RDF Data Streams. Komazec S, Cerri D. DEBS 2012 Code – https://github.com/Rogger/Sparkwave/ – Maintenance, activity: unknown Della Valle, Dell’Aglio and Margara 70
Sparkwave Basic principles: the RETE algorithm We will illustrate how Sparkwave works with the following basic SPARQL query: – SELECT ?x ?y WHERE { ?x a b . ?x c ?y . ?y m n } – We will show it from now on as the following conjunctive query: • (?x a b) ^ (?x c ?y) ^ (?y m n) Traditional RETE networks are based on: – α -network, to account for intra-pattern conditions • One node created for each constant in the triple pattern, so as to filter incoming triples (e.g., five nodes in our sample query) – β -network, to account for inter-pattern conditions • Partial matches are stored in the network as tokens. Della Valle, Dell’Aglio and Margara 71
Sparkwave Generation of the RETE network Let’s consider the query: (?x a b) ^ (?x c ?y) ^ (?y m n) Della Valle, Dell’Aglio and Margara 72
Sparkwave Sparkwave adds to RETE… Sparkwave additions – The ε -network generates triples obtained from RDF Schema entailments – The β -network nodes check if partial or complete pattern matches apply for the current time window. Della Valle, Dell’Aglio and Margara 73
Sparkwave Sparkwave adds to RETE… Sparkwave additions – The ε -network generates triples obtained from RDF Schema entailments – The β -network nodes check if partial or complete pattern matches apply for the current time window. Della Valle, Dell’Aglio and Margara 74
Sparkwave limitations Sparkwave operates over a fixed schema – The ε -network is created at pre-processing time. Limitations – Expressiveness in the data schema (only RDF Schema + inverse and symmetric properties) – Background knowledge cannot be too large, as it is incorporated in memory Della Valle, Dell’Aglio and Margara 75
Agenda Incremental Materializations of Ontologies – DRed – DynamiTE – TrOWL Incremental Materialization of Ontologies in Stream Processing – IMaRS – Sparkwave Continuous ontology-based query answering – ETALIS and EP-SPARQL – Stream Reasoning with ASP – STARQL Formal Semantics of Stream Reasoning – LARS Della Valle, Dell’Aglio and Margara 76
ETALIS/EP-SPARQL Goal: Logic-based Complex Event Processing and Stream – Key contributions: Modeling of Complex Event Processing and Continuous RDFS reasoning in – Prolog – Modeling of iterative (recursive) patterns – The engine runs on many Prolog systems: SWI, XSB, … Who and When: – D.Anicic, S.Rudolph, P.Fodor, N.Stojanovic 2010-2012 References – D.Anicic, S.Rudolph, P.Fodor, N.Stojanovic: Stream reasoning and complex event processing in ETALIS. Semantic Web 3(4): 397-407 (2012) – D.Anicic, P.Fodor, S.Rudolph, N.Stojanovic: EP-SPARQL: a unified language for event processing and stream reasoning. WWW 2011: 635-644 Code: – https://code.google.com/p/etalis/ – Tutorial support Della Valle, Dell’Aglio and Margara 77
ETALIS A Logic Rule-based CEP Iterative (recursive) patterns – An output (complex) event is treated as an input event of the same CEP processing agent; A rule-based approach – Rules can express complex relationships between events by matching certain temporal, relational or causal conditions – It can specify and evaluate contextual knowledge Della Valle, Dell’Aglio and Margara 79
ETALIS Language Syntax ETALIS Language for Events is formally defined by: – pr – a predicate name with arity n; – t (i) – denote terms; – t – s a term of type boolean; – q – is a nonnegative rational number; – BIN – is one of the binary operators: SEQ, AND, PAR, OR, EQUALS, MEETS, STARTS, or FINISHES. Event rule is defined as a formula of the following shape where p is an event pattern containing all variables occurring in Della Valle, Dell’Aglio and Margara 80
EP-SPARQL Extended SPARQL interface to ETALIS Basics – SPARQL extension (as with other previously seen languages) – Interval-based: 2 timestamps Operators – FILTER, AND, UNION, OPTIONAL, SEQ, EQUALS, OPTIONALSEQ, and EQUALSOPTIONAL • Be careful with the management of timestamps (see next) • E.g., Special functions: getDuration(), getStartTime(), getEndTime() Della Valle, Dell’Aglio and Margara 81
EP-SPARQL Extended SPARQL interface to ETALIS Sequence operators and CEP world e 4 S e 1 e 2 e 3 1 3 6 9 Sequence Simultaneous SEQ: joins e ti,tf and e’ ti ’, tf ’ if e’ occurs after e EQUALS: joins e ti,tf and e’ ti ’, tf ’ if they occur simultaneously OPTIONALSEQ, OPTIONALEQUALS: Optional join variants Prolog continuous EP-SPARQL translator engine results query Della Valle, Dell’Aglio and Margara 82
EP-SPARQL Example Della Valle, Dell’Aglio and Margara 83
Agenda Incremental Materializations of Ontologies – DRed – DynamiTE – TrOWL Incremental Materialization of Ontologies in Stream Processing – IMaRS – Sparkwave Continuous ontology-based query answering – ETALIS and EP-SPARQL – Stream Reasoning with ASP – STARQL Formal Semantics of Stream Reasoning – LARS Della Valle, Dell’Aglio and Margara 84
Answer Set Programming Declarative problem solving approach – “ what is the problem? ” vs “ how to solve the problem? ” – Problem is modeled using a logic program (set of logic rules) – Correct interpretations (or Answer Sets) correspond to problem solutions ASP combines: – Rich yet simple modeling language • Negation, disjunction, integrity constraints, weak constraints, aggregates, … – High-performance solving capabilities • Based on guess/check/optimize strategy • Relies on CWA ASP has its roots in: – Deductive databases, Logic programming (with negation), KR and NMR, Constraint solving (mostly SAT) Della Valle, Dell’Aglio and Margara 85
The StreamRule idea 2-tier approach: not all dynamic 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 Della Valle, Dell’Aglio and Margara 86
The StreamRule idea in other words... StreamRule is coupling: • the linked data stream query processing power of RSP engines • the expressivity and reasoning capabilities of Answer Set Programming with the CLINGO4 stream reasoning solver • … in a 2 -tier approach so that the size of the input is reduced as the reasoning task becomes more computationally intensive. Della Valle, Dell’Aglio and Margara 88 04/07/2016
Limitations RDF Files Rule-based (e.g. Expressive Query maps) Reasoning Processing Controller Application LSD Wrappers C-SPARQL Clingo Web of Data CQELS Sensor Streams Scalability requires adaptation! 04/07/2016 Della Valle, Dell’Aglio and Margara 90
StreamRule: Potentials Complex reasoning over dynamic streams and their temporal dependencies, makes StreamRule suitable for: – Dynamic optimal planning/routing – Spatial reasoning, geofencing, access control, tracking – Inconsistency checking or constraint-based programming (e.g. configuration, diagnosis) – … BUT needs to be investigated further (among others): – Window size vs program complexity – Information flow between the components, more flexible coupling, e.g. to adapt window size – Parallel, distributed computation (e.g. via STORM/SPARK framework, orchestrated Logic Programs,…) Della Valle, Dell’Aglio and Margara 91
Agenda Incremental Materializations of Ontologies – DRed – DynamiTE – TrOWL Incremental Materialization of Ontologies in Stream Processing – IMaRS – Sparkwave Continuous ontology-based query answering – ETALIS and EP-SPARQL – Stream Reasoning with ASP – STARQL Formal Semantics of Stream Reasoning – LARS Della Valle, Dell’Aglio and Margara 92
STARQL Addressed task: – Continuous query answering over data streams Key contributions: Use of expressive ontology languages to cope with complex use o cases (Partially) cover the semantics of temporal ontology languages o Who and When: – Lubeck University, 2013-ongoing (Some) Publications: – ÖL Özçep, R Möller , “Ontology Based Data Access on Temporal and Streaming Data”. Reasoning Web, 2014 – ÖL Özçep, R Möller, C Neuenstadt, “ A Stream-Temporal Query Language for Ontology Based Data Access ”. KI, 2014 – ÖL Özçep, R Möller, C Neuenstadt, “A Stream-Temporal Query Language for Ontology Based Data Access”. Description Logics, 2014 Della Valle, Dell’Aglio and Margara 93
STARQL A two-layer framework Streaming and Temporal ontology Access with a Reasoning-based Query Language – A framework to access and query hetereogeneous sensor data through ontologies STARQL implenetation in an OBDA system: – An ontology to give an holistic view over the static and streaming data – Query are composed using the ontology concepts – Meet the author(s) at the demo session: • Enabling Semantic Access to Static and Streaming Distributed Data with Optique, E. Kharlamov et al. Della Valle, Dell’Aglio and Margara 94
STARQL A two-layer framework Example: – In gas turbine monitoring, detect critical sensors when, in a 5-minute window: • There is a monotonic increase of the sensor value for 2 minutes • Followed by a failure 2 mins 5 mins Della Valle, Dell’Aglio and Margara 95
STARQL A two-layer framework • STARQL is a 2-layer framework • STARQL(OL,ECL) composed by: – an Ontology Language (OL) to model the data and its schema – an Embedded Constraint Language (ECL) to compose the queries Della Valle, Dell’Aglio and Margara 96
STARQL A two-layer framework Examples: – STARQL(DL-Lite,UCQ): Union of Conjunctive Queries over DL-Lite ontologies. FOL-rewritability property • – STARQL(SHI,GCQ): Grounded Conjunctive Queries over SHI ontologies • Expressive language for more complex domains Della Valle, Dell’Aglio and Margara 97
STARQL Queries • The inputs of a STARQL query are static Tboxes T i , static Aboxes A i st and streaming ABoxes S i • The syntax of the query is similar to a SPARQL CONSTRUCT query: CONSTRUCT Θ 1 (x,y)<timeExp 1 >,…, Θ r (x,y)<timeExp r > FROM winExp 1 ,…,S m winExp m ,A 0 st ,…,A k st ,T 0 ,…,T l WHERE ψ (x) SEQUENCE BY seqMeth HAVING φ (x,y) Della Valle, Dell’Aglio and Margara 98
STARQL query semantics Static WHERE clause ABoxes Bindings Static CONSTRUC TBoxes T clause HAVING clause Output Sequenced ontologies SEQ clause Stream 1 winExp 1 + joinStream winExp m Stream m Della Valle, Dell’Aglio and Margara 100
STARQL example The query that detects the critical sensors in STARQL is: Della Valle, Dell’Aglio and Margara 101
Agenda Incremental Materializations of Ontologies – DRed – DynamiTE – TrOWL Incremental Materialization of Ontologies in Stream Processing – IMaRS – Sparkwave Continuous ontology-based query answering – ETALIS and EP-SPARQL – Stream Reasoning with ASP – STARQL Formal Semantics of Stream Reasoning – LARS Della Valle, Dell’Aglio and Margara 102
LARS Addressed task: – A high-level unified formal foundation for stream reasoning that captures query answering and non-monotonic deduction and enables better comparison/benchmarking Key contributions: a framework to explain and capture the existing Stream o Reasoning approaches windows as first class citizen in formulas o Who and When: o – TU Vienna, 2013-ongoing Publications: – Harald Beck, Minh Dao-Tran, Thomas Eiter, Michael Fink: LARS: A Logic-Based Framework for Analyzing Reasoning over Streams. AAAI 2015: 1431-1438H. – Harald Beck, Minh Dao-Tran, Thomas Eiter: Answer Update for Rule-Based Stream Reasoning. IJCAI 2015: 2741-2747 Della Valle, Dell’Aglio and Margara 103
Formulas Formula elements: o Window operators ⊞ (substream generation) Boolean connectives: ∧ , ∨ , →, ¬ Temporal/modal operators: ◇ , , @ t o Formulas are defined by the grammar: α ::= a | ﹁ α | α ∧ α | α ∨ α | α→α | ◇ α | α | @ t α | ⊞ i α Where: α: α holds now Boolean connectives work as in first order logic ◇ α: α holds at some time instant in the past α: α holds every time in the past @ t α: α holds at the time instant t Della Valle, Dell’Aglio and Margara 104
Window By default, a formula α refers to the whole stream content The window ⊞ i x α is used to set the scope (substream) on which α applies x is a reference to a window function (identified by i ) that, given a time ⊞ i instant i and a stream, generates a substream with ± x timestamps from i (by default the counting goes backward, “+” goes forward) – CQL sliding windows are defined in the framework: Time-based sliding windows, Tuple-based sliding windows and partition-based sliding windows Windows can be combined to compose new formulas, e.g. in the last 60 minutes, α holds for 5 (continuous) minutes: 5 α 60 ◇ ⊞ i ⊞ i 60 and ⊞ i 5 are two time-based sliding windows of 60 and 5 (where ⊞ i minutes) Della Valle, Dell’Aglio and Margara 105
Rules to generate intensional data (inference) Based on datalog-style rules (grounding/solving) Inherit properties of stable model semantics: – Minimaility of models – supportedness Each formula in the rule can use operators in the framework – Language appears not very intuitive – Need some suitable form of program reduct for negation Offers advanced features: – Nondeterminism (multiple choice) – Preference and recursion Can capture: – CQL queries (including aggregates and orders) – ETALIS operators Della Valle, Dell’Aglio and Margara 106
Past, current and future work ? ? t-k – Past: lack of theoretical underpinning for stream reasoning Della Valle, Dell’Aglio and Margara 107
Past, current and future work ? ? c ⊞ (a ∧◇ b) t-k t (now) – Past: lack of theoretical underpinning for stream reasoning – Now (April 2015): a (basic) language with precise semantics for • Flexible window operator (first class citizen) • Time reference/time abstraction • Rule-based language for generating intensional data • Relationship with other languages (CQL, ETALIS, …) Della Valle, Dell’Aglio and Margara 108
Past, current and future work Expressiveness computation ? ? c ⊞ (a ∧◇ b) modelling t-k t (now) t + δ – Past: lack of theoretical underpinning for stream reasoning – Now (April 2015): a (basic) language with precise semantics for • Flexible window operator (first class citizen) • Time reference/time abstraction • Rule-based language for generating intensional data • Relationship with other languages (CQL, ETALIS, …) – Planned: extended complexity analysis and incremental evaluation (generalizing Truth Maintenance Systems) Della Valle, Dell’Aglio and Margara 109
Recommend
More recommend