it looks for all nodes that have a property called "fingerprint" with a value called "DEADF00D" that does not have a property called "dirty".. If there are no nodes that match that criteria then it takes all nodes and edges with a property of "dirty" and a value of "1" and drops the dirty property from it.
I had to implement something akin to optimistic locking which means when i add a bunch of nodes and edges to the graph at first they get added one at a time with a property set called "dirty" and a value that is some sort of UUID for all the nodes/edges in the transaction.
Then I write a step that validates it and either drops the dirty property if the transaction is successful or if the transaction fails then all nodes/edges that are dirty are dropped entierly and the transaction can be reattempted.