Load the Graph: Constraints, LOAD CSV, MERGE

8 min
Audience
developers and data engineers who need to feed a graph from flat files
Duration
25 to 30 min
Module
6/7
Target skill
understand and re-read an idempotent LOAD CSV + MERGE loading script, and verify the result with counts

In One Picture

Loading a graph is like filling an address book from eight printed lists. If you blindly copy each line (CREATE), the second time you come across "Montréal" you create a second Montréal card, and after three passes your address book is unusable. The right method: before writing, you check whether the card exists (MERGE); and so that this lookup does not take forever on each line, you keep an alphabetical index (the uniqueness constraint, which creates the index). That is exactly the order of the kit: 01-contraintes.cypher first, 02-charger.cypher next, and you can rerun the second as many times as you want without duplicates.

Preview — the rest of the lesson is for enrolled readers.

Already enrolled with a code?

Your access is tied to your account, not to this link. Sign in with the same email you used in class: your course is waiting, no need to enter the code again.

Sign inNo account yet? Create one
This lesson is part of the “Neo4j and Cypher: Think in Graphs” module

The first modules of the course are open to everyone. For the rest you have three options: buy this course once and for all, subscribe, or enter the code handed out in class.

Are you a student on this course?

The code is tied to your account: sign in or create an account and it will be applied automatically when you come back.

No account yet? Create one