Last active
March 18, 2019 06:33
-
-
Save pducrot/d8cc544438631c3a8d3bb74106f9038a to your computer and use it in GitHub Desktop.
People network
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
src,tgt | |
A,B | |
A,C | |
B,C | |
C,D |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
== Domain | |
== Setup | |
//hide | |
//setup | |
[source,cypher] | |
---- | |
CREATE CONSTRAINT ON (n:Person) ASSERT n.Name IS UNIQUE; | |
LOAD CSV WITH HEADERS FROM 'https://gist.githubusercontent.com/pducrot/d8cc544438631c3a8d3bb74106f9038a/raw/b681ffd513d13f1bebd6122a23ffca691b984fc9/knows.edges' as line FIELDTERMINATOR ',' MERGE (s:Person {Name: line.src}) MERGE (t:Person {Name: line.tgt}) CREATE (s)-[:KNOWS]-> (t) RETURN count(*); | |
---- | |
//setup | |
[source,cypher] | |
---- | |
MATCH path = (:Person {Name: "A"}) -[:KNOWS*]-> (:Person) | |
RETURN path | |
---- | |
//graph_result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Name | |
A | |
B | |
C | |
D | |
E | |
F |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment