Last active
October 6, 2020 05:06
-
-
Save vladbatushkov/5eeccf946c265af0175f7f81ca5933a3 to your computer and use it in GitHub Desktop.
Workshop_WorkingGroup_Session1
This file contains hidden or 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
//Enable multi statement query editor in Database Settings (!) | |
MATCH (n) DETACH DELETE n; | |
LOAD CSV WITH HEADERS FROM 'https://vbatushkov.bitbucket.io/log_of_calls.csv' AS line | |
MERGE (c1:City { name: line.from_city }) | |
MERGE (p1:Person { name: line.from_name, number: line.from_number, gender: line.from_gender }) | |
MERGE (p1)-[:FROM]->(c1) | |
MERGE (c2:City { name: line.to_city }) | |
MERGE (p2:Person { name: line.to_name, number: line.to_number, gender: line.to_gender }) | |
MERGE (p2)-[:FROM]->(c2) | |
CREATE (c:Call { from: datetime(line.from_dt), | |
to: datetime(line.to_dt), | |
duration: duration.between(datetime(line.from_dt), datetime(line.to_dt)).minutes }) | |
CREATE (p1)-[:OUT]->(c)<-[:IN]-(p2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment