How to delete a class

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to delete a class

cdemir
Hello Jiba,

I was wondering how one could delete a class in ontology.

with onto: # owlready2.Ontology
    new_concept = types.new_class(name="({0} ⊔ {1})".format(A.str, B.str), bases=(base,))
    new_concept.is_a.append(A.owl | B.owl) # where A.owl is a class in the ontology.


... some computation ...

how could one delete new_concept from ontology so that as onto is being saved, deleted classes will not be serialised.
onto.save('dummy.owl', rdf_format="rdfxml")

Cheers
Reply | Threaded
Open this post in threaded view
|

Re: How to delete a class

jritch33
Hi,

I'm not Jiba, just another fan of Owlready2, but I noticed your post and remembered reading about destroying entities in the owlready2 documentation.

https://pythonhosted.org/Owlready2/class.html#destroying-entities

Hopefully that method accomplishes your goal?

Best of luck!
Jordon