Neo4j Creating relationship between nodes that already map to a relationship

238 Views Asked by At

Currently, I have a query in Neo4j that returns all the nodes in my graph that are pointed to by multiple nodes.

enter image description here

The query to return these nodes (in picture) looks like this:

MATCH (n)-[r:CLINICAL_SIGNIFICANCE]->()
WITH n, count(r) as rel_cnt
WHERE rel_cnt > 1
MATCH (c)-[r:PROTEIN_CHANGE]->(n)
return c, n

Is there a way to loop through the nodes labeled as c (blue nodes) and if they point to the same node labeled as n (yellow nodes), create a relationship between the nodes labeled as c (blue nodes)?

0

There are 0 best solutions below