The ingraph project and incremental evaluation of Cypher queries Gábor Szárnyas, József Marton
Incremental Queries
Live railway model
Live railway model
Live railway model
Live railway model
Live railway model Proximity detection
Live railway model Proximity detection
Live railway model Proximity detection
Live railway model Proximity detection Trailing the switch
Live railway model
Live railway model
Live railway model 1 2 a b c d e div f g
Live railway model 1 2 ON ON STRAIGHT TOP a b c d e div f NEXT NEXT NEXT NEXT g
Proximity detection Proximity detection ≤ 𝟐 segments
Proximity detection Proximity detection t1 t2 ≤ 𝟐 segments ON ON seg1 seg2 NEXT: 1..2
Proximity detection Proximity detection t1 t2 ≤ 𝟐 segments ON ON seg1 seg2 NEXT: 1..2 MATCH (t1:Train)-[:ON]->(seg1:Segment) -[:NEXT*1..2]->(seg2:Segment) <-[:ON]-(t2:Train) RETURN t1, t2, seg1, seg2
Proximity detection Proximity detection t1 t2 ≤ 𝟐 segments ON ON seg1 seg2 NEXT: 1..2 MATCH (t1:Train)-[:ON]->(seg1:Segment) -[:NEXT*1..2]->(seg2:Segment) <-[:ON]-(t2:Train) RETURN t1, t2, seg1, seg2
Trailing the switch
Trailing the switch t ON STRAIGHT seg div
Trailing the switch t ON STRAIGHT seg div MATCH (t:Train)-[:ON]->(seg:Segment) <-[:STRAIGHT]-(sw:Switch) WHERE sw.position = 'diverging' RETURN t.number, sw
Trailing the switch t ON STRAIGHT seg div MATCH (t:Train)-[:ON]->(seg:Segment) <-[:STRAIGHT]-(sw:Switch) WHERE sw.position = 'diverging' RETURN t.number, sw
Trailing the switch t ON Evaluate STRAIGHT continuously seg div MATCH (t:Train)-[:ON]->(seg:Segment) <-[:STRAIGHT]-(sw:Switch) WHERE sw.position = 'diverging' RETURN t.number, sw
Incremental queries Register a set of standing queries Continuously evaluate queries on changes The Rete algorithm (1974) o Originally for rule-based expert systems o Indexes the graph and caches interim query results Ujhelyi, Z. et al. EMF-IncQuery: An integrated development environment for live model queries S cience of Computer Programming (SCP), 2015 http://www.sciencedirect.com/science/article/pii/S0167642314000082
Trailing the switch π t.number, sw σ sw.position = ′diverging′ ON STRAIGHT div ⋈ ON STRAIGHT
Trailing the switch π t.number, sw σ sw.position = ′diverging′ ON STRAIGHT div ⋈ ON STRAIGHT 1 2 ON ON STRAIGHT TOP a b c d e div f NEXT NEXT NEXT NEXT g
Trailing the switch π t.number, sw σ sw.position = ′diverging′ ON STRAIGHT div ⋈ ON STRAIGHT 1 2 ON ON STRAIGHT TOP a b c d e div f NEXT NEXT NEXT NEXT g
Trailing the switch π t.number, sw σ sw.position = ′diverging′ ON STRAIGHT div ⋈ ON STRAIGHT 1 1 2 2 ON ON ON ON STRAIGHT TOP a a b c d e e div f NEXT NEXT NEXT NEXT g
Trailing the switch π t.number, sw σ sw.position = ′diverging′ ON STRAIGHT div ⋈ ON ON ON 1 a 2 e STRAIGHT 1 1 2 2 ON ON ON ON STRAIGHT TOP a a b c d e e div f NEXT NEXT NEXT NEXT g
Trailing the switch π t.number, sw σ sw.position = ′diverging′ ON STRAIGHT div ⋈ ON ON ON 1 a 2 e STRAIGHT 1 2 ON ON STRAIGHT TOP a b c d e div f NEXT NEXT NEXT NEXT g
Trailing the switch π t.number, sw σ sw.position = ′diverging′ ON STRAIGHT div ⋈ ON ON ON 1 a 2 e STRAIGHT 1 2 ON ON STRAIGHT STRAIGHT TOP a b c d e e div div f NEXT NEXT NEXT NEXT g
Trailing the switch π t.number, sw σ sw.position = ′diverging′ ON STRAIGHT div ⋈ ON ON STRAIGHT ON 1 a 2 e STRAIGHT e div 1 2 ON ON STRAIGHT STRAIGHT TOP a b c d e e div div f NEXT NEXT NEXT NEXT g
Trailing the switch π t.number, sw σ sw.position = ′diverging′ ON STRAIGHT div ⋈ ON ON STRAIGHT ON 1 a 2 e STRAIGHT e div 1 2 ON ON STRAIGHT TOP a b c d e div f NEXT NEXT NEXT NEXT g
Trailing the switch π t.number, sw σ sw.position = ′diverging′ ON STRAIGHT div ⋈ ON ON ON STRAIGHT STRAIGHT ON 1 a 2 2 e e STRAIGHT e e div div 1 2 ON ON STRAIGHT TOP a b c d e div f NEXT NEXT NEXT NEXT g
Trailing the switch π t.number, sw σ sw.position = ′diverging′ ON STRAIGHT div ⋈ ON ON ON STRAIGHT STRAIGHT ON 1 a 2 2 e e STRAIGHT e e div div 1 2 2 ON ON ON STRAIGHT STRAIGHT TOP a b c d e e div div f NEXT NEXT NEXT NEXT g
Trailing the switch π t.number, sw σ sw.position = ′diverging′ ON STRAIGHT div ON STRAIGHT ⋈ 2 e div ON ON ON STRAIGHT STRAIGHT ON 1 a 2 2 e e STRAIGHT e e div div 1 2 2 ON ON ON STRAIGHT STRAIGHT TOP a b c d e e div div f NEXT NEXT NEXT NEXT g
Trailing the switch π t.number, sw σ sw.position = ′diverging′ ON STRAIGHT div ON ON STRAIGHT STRAIGHT ⋈ 2 e div 2 e div ON ON STRAIGHT ON 1 a 2 e STRAIGHT e div 1 2 ON ON STRAIGHT TOP a b c d e div f NEXT NEXT NEXT NEXT g
Trailing the switch π t.number, sw ON STRAIGHT σ sw.position = ′diverging′ 2 e div ON STRAIGHT div ON ON STRAIGHT STRAIGHT ⋈ 2 e div 2 e div ON ON STRAIGHT ON 1 a 2 e STRAIGHT e div 1 2 ON ON STRAIGHT TOP a b c d e div f NEXT NEXT NEXT NEXT g
Trailing the switch π t.number, sw ON STRAIGHT σ sw.position = ′diverging′ 2 e div ON STRAIGHT div ON STRAIGHT ⋈ 2 e div ON ON STRAIGHT ON 1 a 2 e STRAIGHT e div 1 2 2 ON ON STRAIGHT TOP a b c d e div div f NEXT NEXT NEXT NEXT g
Trailing the switch π t.number, sw div 2 ON STRAIGHT σ sw.position = ′diverging′ 2 e div ON STRAIGHT div ON STRAIGHT ⋈ 2 e div ON ON STRAIGHT ON 1 a 2 e STRAIGHT e div 1 2 2 ON ON STRAIGHT TOP a b c d e div div f NEXT NEXT NEXT NEXT g
Trailing the switch π t.number, sw div 2 ON STRAIGHT σ sw.position = ′diverging′ 2 e div ON STRAIGHT div ON STRAIGHT ⋈ 2 e div ON ON STRAIGHT ON 1 a 2 e STRAIGHT e div 1 2 2 ON ON STRAIGHT TOP a b c d e div div f NEXT NEXT NEXT NEXT g
Trailing the switch π t.number, sw div 2 ON STRAIGHT σ sw.position = ′diverging′ 2 e div ON STRAIGHT div ON STRAIGHT ⋈ 2 e div ON ON STRAIGHT ON 1 a 2 e STRAIGHT e div 1 2 ON ON STRAIGHT TOP a b c d e div div f NEXT NEXT NEXT NEXT g
Trailing the switch π t.number, sw div 2 ON STRAIGHT σ sw.position = ′diverging′ 2 e div ON STRAIGHT div ON STRAIGHT ⋈ 2 e div ON ON STRAIGHT ON 1 a 2 d STRAIGHT e div 1 2 ON ON STRAIGHT TOP a b c d e div div f NEXT NEXT NEXT NEXT g
Trailing the switch π t.number, sw div 2 ON STRAIGHT σ sw.position = ′diverging′ 2 e div ON STRAIGHT div ⋈ ON ON STRAIGHT ON 1 a 2 d STRAIGHT e div 1 2 ON ON STRAIGHT TOP a b c d e div div f NEXT NEXT NEXT NEXT g
Trailing the switch π t.number, sw div 2 σ sw.position = ′diverging′ ON STRAIGHT div ⋈ ON ON STRAIGHT ON 1 a 2 d STRAIGHT e div 1 2 ON ON STRAIGHT TOP a b c d e div div f NEXT NEXT NEXT NEXT g
Trailing the switch π t.number, sw σ sw.position = ′diverging′ ON STRAIGHT div ⋈ ON ON STRAIGHT ON 1 a 2 d STRAIGHT e div 1 2 ON ON STRAIGHT TOP a b c d e div div f NEXT NEXT NEXT NEXT g
ingraph PoC query engine for openCypher Based on the Rete algorithm Goals: o Provide incremental query evaluation o Cover standard openCypher constructs o Run in parallel & distributedly to allow scalability Szárnyas, G. et al. IncQuery-D: A distributed incremental model query framework in the cloud. MODELS, 2014, https://link.springer.com/chapter/10.1007/978-3-319-11653-2_40
Architecture & Building Blocks
openCypher query MATCH (t:Train)-[:ON]->(seg:Segment) <-[:STRAIGHT]-(sw:Switch) WHERE sw.position = 'diverging' RETURN t.number, sw
openCypher Query query syntax tree MATCH (t:Train)-[:ON]->(seg:Segment) <-[:STRAIGHT]-(sw:Switch) WHERE sw.position = 'diverging' RETURN t.number, sw
openCypher Query query syntax tree Query parser MATCH (t:Train)-[:ON]->(seg:Segment) <-[:STRAIGHT]-(sw:Switch) WHERE sw.position = 'diverging' RETURN t.number, sw
Relational openCypher Query Graph query syntax tree Algebra Query parser MATCH (t:Train)-[:ON]->(seg:Segment) <-[:STRAIGHT]-(sw:Switch) WHERE sw.position = 'diverging' RETURN t.number, sw
Relational openCypher Query Graph query syntax tree Algebra Relational Query algebra parser builder MATCH (t:Train)-[:ON]->(seg:Segment) <-[:STRAIGHT]-(sw:Switch) WHERE sw.position = 'diverging' RETURN t.number, sw
Recommend
More recommend