Incremental Graph Queries for Cypher Gábor Szárnyas, József Marton Budapest University of Technology and Economics McGill University, Montréal Budapest University of Technology and Economics Department of Measurement and Information Systems Department of Telecommunications and Media Informatics
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 STRAIGHT seg div Evaluate continuously MATCH (t:Train)-[:ON]->(seg:Segment) <-[:STRAIGHT]-(sw:Switch) WHERE sw.position = 'diverging' RETURN t.number, sw
Incremental queries
Incremental queries Register a set of standing queries Continuously evaluate queries on changes
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
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
Batch vs. incremental queries Batch queries (pull / request-driven): 1. Client selects a query 2. Results are calculated Query results obtained on demand
Batch vs. incremental queries Batch queries Incremental queries (pull / request-driven): (push / event-driven): 1. Client selects a query 1. Client registers queries 2. Results are calculated 2. Graph is changed Query results 3. Results are maintained obtained on demand 4. Goto 2 Query results are always available
Incremental query engines CLIPS C structures NASA Drools POJO Red Hat VIATRA EMF BME / IncQuery Labs.
Incremental query engines CLIPS C structures NASA Drools POJO Red Hat VIATRA EMF BME / IncQuery Labs. INSTANS RDF Aalto University i3QL POJO TU Darmstadt IncQuery-D RDF BME
Incremental query engines CLIPS C structures NASA Drools POJO Red Hat VIATRA EMF BME / IncQuery Labs. INSTANS RDF Aalto University i3QL POJO TU Darmstadt IncQuery-D RDF BME No implementations for property graphs yet
ingraph An incremental, in-memory graph query engine
ingraph An incremental, in-memory graph query engine client ingraph
ingraph An incremental, in-memory graph query engine register queries client ingraph
ingraph An incremental, in-memory graph query engine register queries update graph client ingraph
Recommend
More recommend