Skip to content

Instantly share code, notes, and snippets.

@neylsoncrepalde
Created August 31, 2022 03:10
Show Gist options
  • Save neylsoncrepalde/a1dea5bace7cb7665263a2a248b61397 to your computer and use it in GitHub Desktop.
Save neylsoncrepalde/a1dea5bace7cb7665263a2a248b61397 to your computer and use it in GitHub Desktop.
LOAD CSV WITH HEADERS FROM 'https://raw.githubusercontent.com/neylsoncrepalde/lazega_lawyers_csv/main/lawyers_attributes.csv'
AS row FIELDTERMINATOR ';'
WITH row WHERE row.id IS NOT NULL
MERGE (p:Person {name: row.id})
SET p.status = row.status
SET p.sex = row.sex
SET p.office = row.office
SET p.tenure = toInteger(row.tenure)
SET p.age = toInteger(row.age)
SET p.practice = row.practice
SET p.school = row.school;
LOAD CSV WITH HEADERS FROM 'https://raw.githubusercontent.com/neylsoncrepalde/lazega_lawyers_csv/main/lawyers_advices.csv'
AS row FIELDTERMINATOR ';'
WITH row WHERE row.sender IS NOT NULL
MATCH (v:Person {name: row.sender})
MATCH (p:Person {name: row.receiver})
MERGE (v)-[:ASK_ADVICE]->(p);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment