I think your last query should read:

USING PERIODIC COMMIT
LOAD CSV WITH HEADERS FROM 'file:\\C:\\Program
Files\\PostgreSQL\\9.2\\data\\registration.csv' AS row
MATCH (a:course{  id : row.course1fk})
MATCH (b:student{  id: row.studentfk})
CREATE (b)-[:registration {id: row.id, grade: row.grade}]->(a);

The property name for course and student is different than the one you used
when creating the nodes earlier on.

On 2 Nov 2016 2:18 pm, "Marwa Elabri" <[email protected]> wrote:

Hello,
I want to convert my relational database to Neo4j database
using LOAD CSV WITH HEADERS code
when I import entity classes it was good and all nodes are successfuly
created
but when I want to import relationship classes it couldn't create
relationships between nodes and it says no changes, no rows

My code is the following :

// create course nodes from course.csv
USING PERIODIC COMMIT LOAD
CSV WITH HEADERS FROM 'file:\\C:\\Program
Files\\PostgreSQL\\9.2\\data\\course.csv'
AS row
CREATE (:course { name : 'Course' + row.id, id: row.id, difficulty:
row.difficulty});

//create student nodes from student.csv
USING PERIODIC COMMIT LOAD
CSV WITH HEADERS FROM 'file:\\C:\\Program
Files\\PostgreSQL\\9.2\\data\\student.csv'
AS row
CREATE (:student { name : 'Student' + row.id, id: row.id, intelligence:
row.intelligence, ranking: row.ranking});

//create relationships "registration" between courses ans students from
regisraion.csv
USING PERIODIC COMMIT
LOAD CSV WITH HEADERS FROM 'file:\\C:\\Program
Files\\PostgreSQL\\9.2\\data\\registration.csv' AS row
MATCH (a:course{  course1fk : row.course1fk})
MATCH (b:student{  studentfk : row.studentfk})
CREATE (b)-[:registration {id: row.id, grade: row.grade}]->(a);

-- 
You received this message because you are subscribed to the Google Groups
"Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to [email protected].
For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to