I want to copy existing relationships to a new node. All nodes exist already and I would like to copy all incoming relationships to a second node. Given a node D
and a graph like
A -[r]-> B <-[s]- C
I would like to create the following in a single Cypher query:
A -[r]-> B <-[s]- C
A -[r]-> D <-[s]- C
Only the relationships in the second line should be created, as all other nodes exist already. I have tried the following Cypher query (which is an Invalid query (Don't know how to extract parameters from this type: org.neo4j.kernel.impl.core.RelationshipProxy
)):
START targetNode = node(42)
MATCH sourceNode -[r]-> targetNode
CREATE sourceNode -[s:TYPE(r)]-> targetNode
RETURN s
sources-[r]->n2
in aRELATE
orCREATE UNIQUE
query – Fynn:KNOWS
). My question is aimed at creating the relationships with different types. – Fynn