Jesse Liu
Jesse Liu

Reputation: 1

Neo4J CSV LOAD relationships

All

I'm a very ne beginner with Neo4j.

Now I've data import problem.

I use java and python to import data from oracle to neo4j and found both are too slow(I have about 100 million rows of the table) So I consider Cypher Sentence: LOAD CSV

I export the csv file of Movie Graph of the community, as the image shown.

Now how can I use the LOAD CSV (export.csv) to build a graph data to restore the Movie Graph? I found little info on the Neo4J manual about import data.

Thanks!![enter image description here][1]

Yours, Jesse

Upvotes: 0

Views: 988

Answers (1)

FrobberOfBits
FrobberOfBits

Reputation: 18022

There's actually pretty good documentation on how to use LOAD CSV.

It's full of useful examples.

They even have an example that's directly tied to the movies CSV:

LOAD CSV WITH HEADERS FROM "http://neo4j.com/docs/2.1.7/csv/import/movies.csv" AS csvLine
MERGE (country:Country { name: csvLine.country })
CREATE (movie:Movie { id: toInt(csvLine.id), title: csvLine.title, year:toInt(csvLine.year)})
CREATE (movie)-[:MADE_IN]->(country)

Vaya con dios, mi amigo.

Upvotes: 1

Related Questions