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
with ASP Alessandra Mileo Share, Remix, Reuse Legally This work is - - 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 Expressive Stream Reasoning with ASP Alessandra Mileo Share, Remix, Reuse
http://streamreasoning.org/events/streamapp2017
http://streamreasoning.org/events/sr4ld2015
– These slides are partially based on “How to Build a Stream Reasoning Application 2017” by D. Dell'Aglio, E. Della Valle,
http://streamreasoning.org/events/streamapp2017
2
http://streamreasoning.org/events/sr4ld2015
relevant events entailed events Non-monotonic Stream Reasoning solution sets
3
http://streamreasoning.org/events/sr4ld2015
4
http://streamreasoning.org/events/sr4ld2015
5
http://streamreasoning.org/events/sr4ld2015
(set of rules)
6
Computation Modelling Interpretation
http://streamreasoning.org/events/sr4ld2015
– Default Reasoning, non-determinism, constraints, preferences, aggregates, …
– Based on guess/check/optimize strategy (generate & test) – Relies on CWA
7
http://streamreasoning.org/events/sr4ld2015
a1 :- b1,…,bk, not bk+1,…, not bm
l{a1,…,an}u :- b1,…,bk, not bk+1,…, not bm
8
http://streamreasoning.org/events/sr4ld2015
:- b1,…,bk, not bk+1,…, not bm
a1 . “a1 is true.”
9
http://streamreasoning.org/events/sr4ld2015
10
% generating plausible colorings 1{col_V(V,C) : col(C)}1 :- vertex(V). % defining constraints :- col_V(V,C), col_V(V1,C), edge(V,V1). col(red). col(green). col(blue). vertex(a). vertex(b). vertex(c). vertex(d). vertex(e). edge(a,b). edge(a,c). edge(a,d). edge(b,e). edge(c,d). edge(d,e). col_V(a,red). col_V(b,blue). col_V(c,blue). col_V(d,green). col_V(e,red).
http://streamreasoning.org/events/sr4ld2015
11
30/10/2017
Incremental ASP
http://streamreasoning.org/events/sr4ld2015
13
http://streamreasoning.org/events/sr4ld2015
14
http://streamreasoning.org/events/sr4ld2015
15
C-SPARQL CQELS
LSD Wrappers
30/10/2017
http://streamreasoning.org/events/sr4ld2015
16
30/10/2017
http://streamreasoning.org/events/sr4ld2015
17
#input cost_per_hour/2, vacancy/2, walkingDistance/2, parkingCost/2, parking/1. %define parking full parkingStatus(ParkingID, "full") :- vacancy(ParkingID,NUMBER), NUMBER == 0. parkingStatus(ParkingID, "full") :- parking(ParkingID), not vacancy(ParkingID,_). %define available parking availableParkingLocation(ParkingID) :- not parkingStatus(ParkingID,"full”), parking(ParkingID). %generation (must choose one parking among the available ones) 1{selected(ParkingID):availableParkingLocation(ParkingID)}1. %projection: distance of selected parking valueOf("DISTANCE", D) :- selected(ParkingID), walkingDistance((ParkingID,D)). %projection: cost of selected parking valueOf("COST", C):- selected(ParkingID),parkingCost(ParkingID, C). %weak constraints :~ valueOf("DISTANCE", AV). [AV@2] %optimization statement :~ valueOf("COST", AV). [AV@1] %optimization statement #show selected/1. #show valueOf/2.
30/10/2017
http://streamreasoning.org/events/sr4ld2015
18
http://streamreasoning.org/events/sr4ld2015
19
http://streamreasoning.org/events/sr4ld2015
Stefano Germano, Thu-Le Pham, Alessandra Mileo: Web Stream Reasoning in Practice: On the Expressivity vs. Scalability Tradeoff. RR 2015: 105-112
http://streamreasoning.org/events/sr4ld2015
21
http://streamreasoning.org/events/sr4ld2015
Thu-Le Pham, Alessandra Mileo, Muhammad Intizar Ali: Towards Scalable Non- Monotonic Stream Reasoning via Input Dependency Analysis. ICDE 2017: 1553-1558 22
http://streamreasoning.org/events/sr4ld2015
23
23
(r1) very_slow_speed(X) :- average_speed(X,Y), Y < 20. (r2) many_cars(X) :- car_number(X,Y), Y > 40. (r3) traffic_jam(X) :- very_slow_speed(X), many_cars(X), not traffic_light(X). ....
Rules Dependency Graph Extended
very_slow_speed average_speed car_number many_cars traffic_light traffic_jam
http://streamreasoning.org/events/sr4ld2015
24
very_slow_speed(X) :- average_speed(X,Y), Y < 20. many_cars(X) :- car_number(X,Y), Y > 40. traffic_jam(X) :- very_slow_speed(X), many_cars(X), not traffic_light(X). car_fire(X) :- car_in_smoke(C,high), car_speed(C,0), car_location(C,X). .......
Rules Extended Dependency Graph Input Dependency graph Duplication
http://streamreasoning.org/events/sr4ld2015
25
Thu-Le Pham, Muhammad Intizar Ali, Alessandra Mileo: Enhancing the Scalability of Expressive Stream Reasoning via input-driven parallelisation. Submitted to the Semantic Web Journal
http://streamreasoning.org/events/sr4ld2015
26
http://streamreasoning.org/events/sr4ld2015
relevant events entailed events Non-monotonic Stream Reasoning solution sets
39
http://streamreasoning.org/events/streamapp2017