cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

How to Convert a relationship to a node

My Employer wants to see the relationship between two nodes as a node connecting the previous nodes. How do I do that?

1 ACCEPTED SOLUTION

A match & merge approach should work:

MATCH (a)-[r:existingRelType]->(b)
MERGE (a)-[:newInboundRelType]-(:newRelNode)->[:newOutboundRelType]->(b)

Whether or not newInboundRelType needs to match newOutboundRelType or be different would depend on your data model.

View solution in original post

2 REPLIES 2

A match & merge approach should work:

MATCH (a)-[r:existingRelType]->(b)
MERGE (a)-[:newInboundRelType]-(:newRelNode)->[:newOutboundRelType]->(b)

Whether or not newInboundRelType needs to match newOutboundRelType or be different would depend on your data model.

Thank You So much!!
Solved