•For more information visit http://wiki.larkc.eu/UrbanComputing Stream Reasoning Stream Reasoning Where We Got So Far Where We Got So Far Oxford - 2010.1.18 Oxford - 2010.1.18 http://streamreasoning.org http://streamreasoning.org Emanuele Della Valle DEI - Politecnico di Milano [email protected]http://emanueledellavalle.org Joint work with: Davide Francesco Barbieri, Daniele Braga, Stefano Ceri, and Michael Grossniklaus
33
Embed
Stream Reasoning: Where we got so far. Oxford 2010.1.18
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
•For more information visit http://wiki.larkc.eu/UrbanComputing
Stream ReasoningStream ReasoningWhere We Got So FarWhere We Got So Far
Emanuele Della Valle - visit http://streamreasoning.org
Achievements C-SPARQL [WWW2009,EDBT2010,IJSC2010]
• We specificied of C-SPARQL syntax– Incrementally, from existing specifications
• Including windows, grouping, aggregates, timestamping
• We gave the formal semantics of C-SPARQL – Query registration, handling overloads– Order of evaluation, pattern matching over time, …
• We investigated efficiency of evaluation – Defining a suitable algebra– Applying optimizations – Efficient materialization of inferred data from streams
17Oxford, 2011-1-18
Emanuele Della Valle - visit http://streamreasoning.org
Achievements An Example of C-SPARQL Query
Who are the opinion makers? i.e., the users who are likely to influence the behavior of other users who follow them
REGISTER STREAM OpinionMakers COMPUTED EVERY 5m AS
CONSTRUCT { ?opinionMaker sd:about ?resource }
FROM STREAM <http://streamingsocialdata.org/interactions> [RANGE 30m STEP 5m]
Emanuele Della Valle - visit http://streamreasoning.org
Achievements Efficiency of Evaluation 1/3 [IEEE-IS2010]
• Evaluation of Window-based Selection
20Oxford, 2011-1-18
Emanuele Della Valle - visit http://streamreasoning.org
Achievements Efficiency of Evaluation 2/3 [EDBT2010]
• Several transformations can be applied to algebraic representation of C-SPARQL
• some recalling well known results from classical relational optimization
– push of FILTERs and projections
• some being more specific to the domain of streams.– push of aggregates.
21Oxford, 2011-1-18
Emanuele Della Valle - visit http://streamreasoning.org
Achievements Efficiency of Evaluation 3/3 [EDBT2010]
• Push of filters and projections
22Oxford, 2011-1-18
0
25
50
75
100
125
10 100 1000 10000 100000
ms
Window Size
None Static Only Streaming Only Both
Emanuele Della Valle - visit http://streamreasoning.org
Achievements Example of C-SPARQL and Reasoning 1/2
What impact have I been creating with my tweets in the last hour? Is it positive or negative? Let’s count them …REGISTER QUERY CountPositiveAndNegativeReactions AS
PREFIX : <http://ex.org/twitterImpactMining#>
SELECT ?t count(?pos) count(?neg)
FROM STREAM <http://ex.org/discussions.trdf>
[RANGE 30m STEP 30s]
WHERE {
?t a :MonitoredTweet .
{ ?pos :discuss ?t ;
:ProduceReaction [ a :PositiveReaction ] .
} UNION {
?neg :discuss ?t ;
:ProduceReaction [ a :NegativeReaction ] .
}
} GROUP BY ?t
23Oxford, 2011-1-18
:discuss a owl:TransitiveProperty .:reply rdfs:subPropertyOf :discuss .
:retweet rdfs:subPropertyOf :discuss .
Emanuele Della Valle - visit http://streamreasoning.org
Achievements Example of C-SPARQL and Reasoning 2/2
24Oxford, 2011-1-18
t1 t1-1 t1-2 t1-3retweet reply retweet
discuss
discuss
discuss discuss discuss
discuss
Monitored Positive Negative
Emanuele Della Valle - visit http://streamreasoning.org
Achievements
State-of-the-Art Approach [Ceri1994,Volz2005]
1. Overestimation of deletion: Overestimates deletions by computing all direct consequences of a deletion.
2. Rederivation: Prunes those estimated deletions for which alternative derivations (via some other facts in the program) exist.
3. Insertion: Adds the new derivations that are consequences of insertions to extensional predicates.
25Oxford, 2011-1-18
Emanuele Della Valle - visit http://streamreasoning.org
Achievements
our approach [ESWC2010] 1/2
• Assuption– Insertions and deletions are triples respectively
entering and exiting the window– The window size is known
• Therefore– The time when each triple will expire is known and
determined by the window size• E.g. if the window is 10s long a triple entering at time t will
exit at time t+10s
– Note: all knowledge can be annotated with an expiration time
• i.e., background knowledge is annotated with +
26Oxford, 2011-1-18
Emanuele Della Valle - visit http://streamreasoning.org
Achievements
our approach [ESWC2010] 2/2
• The algorithm1. deletes all triples (asserted or inferred) that have just
expired
2. computes the entailments derived by the inserts,
3. annotates each entailed triple with a expiration time, and
4. eliminates from the current state all copies of derived triples except the one with the highest timestamp.
• Comparison of the average time needed to answer a C-SPARQL query using
– a forward reasoner, – the naive approach of re-computing the materialization– our approach
29Oxford, 2011-1-18
Emanuele Della Valle - visit http://streamreasoning.org
Retrospective and Conclusions
Wrap Up• RDF Streams
– Notion defined• C-SPARQL
– Syntax and semantics defined as a SPARQL extension– Engine designed– Engine implemented based on the decision to keep stream
management and query evaluation separated• Experiments with C-SPARQL under simple RDF entailment
regimes– window based selection of C-SPARQL outperforms the standard
FILTER based selection– having formally defined C-SPARQL semantics algebraic
optimizations are possible• Experiment with C-SPARQL under OWL-RL entailment
regimes– efficient incremental updates of deductive closures investigated – our approach outperform state-of-the-art when updates comes as
stream
30Oxford, 2011-1-18
Emanuele Della Valle - visit http://streamreasoning.org
Retrospective and Conclusions
Achievements vs. Research Challenges• Relation with data-stream systems
– Notion of RDF stream :-|• Query languages for semantic streams
– C-SPARQL :-D• Reasoning on Streams
– Formal representations for stream reasoning• :-P
– Notions of soundness and completeness• :-P
– Efficient incremental updates of deductive closures• ESWC 2010 paper :-) ... but much more work is needed!
– How to combine streams and background knowledge• ESWC 2010 paper :-| ... but a lot needs to be studied ...
• Dealing with incomplete & noisy data– :-P
• Distributed and parallel processing– :-P
31Oxford, 2011-1-18
Emanuele Della Valle - visit http://streamreasoning.org
References• Vision
[IEEE-IS2009] Emanuele Della Valle, Stefano Ceri, Frank van Harmelen, Dieter Fensel It's a Streaming World! Reasoning upon Rapidly Changing Information. IEEE Intelligent Systems 24(6): 83-89 (2009)
• Continuous SPARQL (C-SPARQL) [EDBT2010] Davide Francesco Barbieri, Daniele Braga, Stefano Ceri and Michael
Grossniklaus. An Execution Environment for C-SPARQL Queries. EDBT 2010 [WWW2009] Davide Francesco Barbieri, Daniele Braga, Stefano Ceri, Emanuele Della Valle,
Michael Grossniklaus: C-SPARQL: SPARQL for continuous querying. WWW 2009: 1061-1062
[IJSC2010] Davide Francesco Barbieri, Daniele Braga, Stefano Ceri, Emanuele Della Valle, Michael Grossniklaus: C-SPARQL: a Continuous Query Language for RDF Data Streams. Int. J. Semantic Computing 4(1): 3-25 (2010)
[IEEE-IS2010] Davide Barbieri, Daniele Braga, Stefano Ceri, Emanuele Della Valle, Yi Huang, Volker Tresp, Achim Rettinger, Hendrik Wermser, "Deductive and Inductive Stream Reasoning for Semantic Social Media Analytics," IEEE Intelligent Systems, 30 Aug. 2010.
• Stream Reasoning[ESWC2010] Davide Francesco Barbieri, Daniele Braga, Stefano Ceri, Emanuele Della Valle,
Michael Grossniklaus. Incremental Reasoning on Streams and Rich Background Knowledge. In. 7th Extended Semantic Web Conference (ESWC 2010)
• Background work[Ceri1994] Stefano Ceri, Jennifer Widom: Deriving Incremental Production Rules for Deductive