Reputation: 439
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.
Upvotes: 0
Views: 707
Reputation: 1
I think you click the node, it will tell you what labels has on the node. The node which has Category also have the label Request.
Upvotes: 0
Reputation: 66947
Category
label also happens to have the Request
label, and the node in your visualization with the Request
label also happens to have the Item
label. That would explain the behavior you see. If that is not intended, you should REMOVE all extraneous labels.Upvotes: 2