/** * Deletes the concept as an Thing */ @Override public void delete() { //Remove links to relationships and return them Set<Relationship> relationships = castingsInstance().map(casting -> { Relationship relationship = casting.getRelationship(); Role role = casting.getRole(); relationship.unassign(role, this); return relationship; }).collect(toSet()); vertex().tx().txCache().removedInstance(type().id()); deleteNode(); relationships.forEach(relation -> { if(relation.type().isImplicit()){//For now implicit relationships die relation.delete(); } else { RelationshipImpl rel = (RelationshipImpl) relation; rel.cleanUp(); } }); }