final Node subReference = obtainSubreferenceNode(alias);
Relationship instanceOf = state.getSingleRelationship(INSTANCE_OF_RELATIONSHIP_TYPE, Direction.OUTGOING);
instanceOf.delete();
if (log.isDebugEnabled())
log.debug("Removed link to subref node: " + subReference + " with alias: " + alias);
TraversalDescription traversal = Traversal.description().depthFirst().relationships(SUBCLASS_OF_RELATIONSHIP_TYPE, Direction.OUTGOING);
for (Node node : traversal.traverse(subReference).nodes()) {
Integer count = (Integer) node.getProperty(SUBREFERENCE_NODE_COUNTER_KEY);
Integer newCount = decrementAndGetCounter(node, SUBREFERENCE_NODE_COUNTER_KEY, 0);
if (log.isDebugEnabled()) log.debug("count on ref " + node + " was " + count + " new " + newCount);
}
}