I have the following simple Cypher script:
LOAD CSV WITH HEADERS FROM "file:///test.csv" AS row FIELDTERMINATOR ';'
merge (n:Subject {code: row.NodeA})
merge (m:Object {code: row.NodeB})
merge (r:Relation {code: row.Relation})
MERGE (n)-[:TO]->(r)
merge (r)-[:TO]->(m)
with the following test.csv:
ID
NodeA
Relation
NodeB
1
AM 4.0
includes
Systemic leadership
2
AM 4.0
is based on
Agile Mindset
My assuption is that the Cypher script should generate unique Nodes n, so only one Node n with Code = NodeA ={AM 4.0} should be generated.
But this is not the case. Also the usage of CONSTRAINT for Code doen't help.
What goes wrong?
Thank you very much for your help!!