cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Regarding course import data into neo4j graph data

Hi,
In the course "importing data with neo4j" , there is a section to create movies database. In that section i cannot find the cypher command to load the person nodes though i see the cypher to create Movie node(label). I am unable to import the relationships unless person label data is imported as well. Could you please check and advise.

cypher for movie node
:auto USING PERIODIC COMMIT 500
LOAD CSV WITH HEADERS FROM
'https://data.neo4j.com/v4.0-intro-neo4j/movies1.csv' as row
MERGE (m:Movie {id: toInteger(row.movieId)})
ON CREATE SET
m.title = row.title,
m.avgVote = toFloat(row.avgVote),
m.releaseYear = toInteger(row.releaseYear),
m.genres = split(row.genres,":")

cypher for relationship Director
LOAD CSV WITH HEADERS FROM
'https://data.neo4j.com/v4.0-intro-neo4j/directors.csv' AS row
MATCH (movie:Movie {id: toInteger(row.movieId)})
MATCH (person:Person {id: toInteger(row.personId)})
MERGE (person)-[:DIRECTED]->(movie)
ON CREATE SET person:Director

Bu person node is empty hence above relationships not able to import.

Kindly check

Thanks
Deepak

4 REPLIES 4

Hello @deepakpahuja,

Welcome to the Community!

From what you are describing, you missed the step in the exercise (Exercise 16.3):

LOAD CSV WITH HEADERS
FROM 'http://data.neo4j.com/v4.0-intro-neo4j/actors.csv'
AS line
MERGE (actor:Person {name: line.name})
ON CREATE SET actor.born = toInteger(trim(line.birthYear)), actor.actorId = line.id
ON MATCH SET actor.actorId = line.id

Elaine

Hi Elaine

Thanks for coming back on this. I believe you are referring the exercises part, there the database to create is importcsv but the one i was asking is in the notes section and not the exercise,
Here the movies1.csv seems to be very big data set. I think the one i mentioned is only for understanding part and not to try in the lab .

Thanks
Deepak

Hello @deepakpahuja ,

The way these courses are presented is that you do not perform the Cypher code when you are reading the lesson, only when you enter the Browser Guide to do the hands-on exercises.

The code presented during the lesson was for instructional purposes only.

If you go to the Browser Guide and follow the instructions, you should be able to reset your graph so that you can perform the hands-on exercise from the beginning.

Elaine
Elaine

Thanks Elaine, i assumed the same.

I am satisfied and happy with the support & response.

Have a nice day.

Regards
Deepak