Created
November 2, 2018 15:59
-
-
Save infinite-Joy/b1acf67b4e959d7efa06c5dc4286eba5 to your computer and use it in GitHub Desktop.
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
print('Create the edge list') | |
with driver.session() as session, open("graph/movies.edgelist", "w") as edges_file: | |
result = session.run("""\ | |
MATCH (m:MovieId)--(other) | |
RETURN id(m) AS source, id(other) AS target | |
""") | |
writer = csv.writer(edges_file, delimiter=" ") | |
for row in result: | |
writer.writerow([row["source"], row["target"]]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment