Skip to content

Instantly share code, notes, and snippets.

@bvdeenen
Last active June 12, 2017 13:20
Show Gist options
  • Save bvdeenen/b823ec5f3856ede964ef78d5a3b5df12 to your computer and use it in GitHub Desktop.
Save bvdeenen/b823ec5f3856ede964ef78d5a3b5df12 to your computer and use it in GitHub Desktop.
dependency chain in Neo4J Cypher
[source,cypher]
----
CREATE (DB1:Database {backbone: true, name:"postgres db 1"})
CREATE (Ingest1:Ingest {backbone: true, name: "ingest-1"})
CREATE (KV1:KV {name: "key-value store 1"})
CREATE (KV2:KV {name: "key-value store 2"})
CREATE (KV1)-[:requires]->(DB1)
CREATE (KV2)-[:requires]->(DB1)
CREATE (Topic1:Topic {name: "topic-1", partitions:100})
CREATE (Topic2:Topic {name: "topic-2", partitions:100})
CREATE (Topic3:Topic {name: "topic-3", partitions:100})
CREATE (Topic4:Topic {name: "topic-4", partitions:100})
CREATE (Topic5:Topic {name: "topic-5", partitions:100})
CREATE (Topic6:Topic {name: "topic-6", partitions:100})
CREATE (Topic7:Topic {name: "topic-7", partitions:100})
CREATE (Topic8:Topic {name: "topic-8", partitions:100})
CREATE (T2:Transformer {name: "T2"})
CREATE (T1:Transformer {name: "T1"})
CREATE (T3:Transformer {name: "T3"})
CREATE (T2)-[:produces]->(Topic3)
CREATE (T2)-[:produces]->(Topic4)
CREATE (T2)-[:produces]->(KV1)
CREATE (T2)-[:requires]->(Topic1)
CREATE (T2)-[:requires]->(Topic2)
CREATE (T1)-[:produces]->(Topic1)
CREATE (T1)-[:requires]->(Topic7)
CREATE (T3)-[:produces]->(Topic2)
CREATE (T3)-[:requires]->(Topic8)
CREATE (Ingest1)-[:produces]->(Topic7)
CREATE (Ingest1)-[:produces]->(Topic8)
----
//graph
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment