How to delete a relation?


#1

Hello everybody.

Let’s say I have this relation called download between an user and a movie entity. Is there a way to find the given relation between the given identifiers of the respective entities and then delete the relation?

Thanks,

Daniel


#2

Hi Daniel,

If you use our sample movie dataset as a starting point you can execute this query:

match $x isa person has name "Judy Greer"; $y isa movie has title "Jurassic World"; $z ($x, $y);

and you will see a couple of results. In these results $z is the var representing the relationship itself (a node in our graph). You can delete this node by using this command

match $x isa person has name "Judy Greer"; $y isa movie has title "Jurassic World"; $z ($x, $y); delete $z;
commit

and then just run the same query again to confirm that the relationship is gone.

Sheldon