With SDN Neo4j, is it possible to create a node only if the node with a matching field does not exist? So for instance, I have a an existing node lets say labelled "Road" with value "N4". Now I need to create a new node with a relationship to this node lets say "drives on". So I do this just fine. However the second time around I need to check if a Node with label "Road" already exists with value "N4". If it does then make the new node point to the existing one not create a new Road node with value N4?
I am trying to do the equivalent using SDN I think:
MATCH (root { name: 'root' })
CREATE UNIQUE (root)-[:X]-(leaf { name:'D' })
RETURN leaf
No node connected with the root node has the name D, and so a new node is created to match the pattern.
Can this be done using SDN domain modelling at the point of insert somehow?
thanks