2
votes

I tried add relation to neo4j and it doesn't work correctly... (this relations don't exist after executing script)...

my script (i run it in this way: Neo4jShell.bat -file gf.txt) :

 CREATE (j1 { lc :1, ln: 'ln1' }); 
 CREATE (j2 { lc :2, ln: 'ln2' }); 
 CREATE (j3 { lc :3, ln: 'ln3' }); 
 ...
 CREATE (p1 { pc : 1, pn : 'pn1'}); 
 CREATE (p1 { pc : 2, pn : 'pn2'}); 
 CREATE (p1 { pc : 3, pn : 'pn3'}); 
 ...
 CREATE (j1)-[:F]->(p1); 
 CREATE (j2)-[:F]->(p2); 
 CREATE (j3)-[:F]->(p3);

Are you seeing any mistakes in my big script ?

1

1 Answers

2
votes

Once you end your statement with a semicolon, you can't refer to the identifiers/nodes created in that statement anymore. It's not going to know what (j1) is, so it's going to create a new node (j1) with no properties.

Update: Either remove your semicolons, or you'll need to MATCH the nodes again.