Currently, I have a graph which I wanted to add multiple new same types of relationships. However, what I've gotten was the query created unnecessary relationships.
For example:
This is the initial graph
I wanted to add a new relationship BELONG_TO which link from Request node to Item Node. Notice that the relationship type name BELONG_TO has already existed which link Category node to Request node in the graph.
After execute the query below, This is what I got.
MATCH (i:Item), (r:Request)
MERGE (r)-[:BELONG_TO]->(i);
As you can see the query creates extra unnecessary BELONG_TO relationships (from Category to Item and from Request to Request). What I wanted is to only create a BELONG_TO relationship which link Request Node to Item Node.
What I wanted:
Is there any solution for this? - The version of neo4j I'm using is 3.5.14 - Each node and relationship does not have any properties in it.
EDIT: Correction made on relationship name as type not label.
MATCH (i:Item) ,(r:Request) RETURN labels(i),labels(r) LIMIT 100
– TheTeacherItem
andRequest
. – Kyle_397