With cypher, I want to create a relationship between two nodes (nodeA and nodeC).
First I have to check if the relationship (nodeA :OWNS nodeC) exists or not. If there is no relationship I want to remove :OWNS relationship nodeA might have with other another node (eg. nodeA :OWNS nodeB) and create :OWNS between nodeA and nodeC.
Is there an efficient way for me to do this with Cypher?
Thank you.
edit: I've accepted an answer but a quicke.. If nodeA had more than one [:OWNS] relationship, by providing specific id for nodeB, it'll only remove the [:OWNS] from nodeB and swap it with nodeC, right?