I have a Neo4J Graph and want to add a new Property on the Relationships based on the ID
of the Relationship, which is already set. The ID
is a Property and looks like this:
id:16_0beta1_1b500480_1221807483755_439038_8369
In a CSV-File I have stored 400 IDs
and a type
corresponding to the IDs
. Neo4J should load the CSV-File and look through all relationships. When a Relationship ID
matches an ID
from the CSV-File it should set
the new Property like this: set r.SysML=row.type
and create a new Property on the Relationship:
SysML:Block
For the nodes the following clause worked well:
LOAD CSV WITH HEADERS FROM "file:///SysML.csv" AS row
merge(n:name {id:row.sysID})
on match set n.SysML=row.type
For Relationship Property i tried:
LOAD CSV WITH HEADERS FROM "file:///SysML.csv" AS row
merge ()-[r:rel {id:row.sysID}]->()
on match set r.SysML=row.type
I couldn't solve it even with many variations of the relationship...
LOAD CSV WITH HEADERS FROM "file:///SysML.csv" AS row MATCH ()-[r:rel {id:row.sysID}]->() RETURN r LIMIT 10
– Rajendra Kadam