Re: owlready keep adding classes into the existing ontology while using load()
Posted by Jiba on
URL: http://owlready.306.s1.nabble.com/owlready-keep-adding-classes-into-the-existing-ontology-while-using-load-tp301p302.html
The implementation of clear() was missing in Owlready2's CallbackList, thus clear was not working as expected. I fixed it in the development version on BitBucket.
As a workaround, you can also use onto.imported_ontologies = []
I think there is also a problem in your example. "ontology =" is not a valid argument for instance creation, you probably mean "namespace =" :
ebbw_node = abc.Node("Node", namespace = onto)
Alternatively, you can also use the "with" syntax :
with onto:
ebbw_node = abc.Node("Node")