Created an ontology test procedure: creates terms, nodes, edges and rags, and then deletes them all checking dependencies and references.
When deleting a node, the related edges are now automatically deleted.