Unable to delete data or object properties using destroy_entity

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

Unable to delete data or object properties using destroy_entity

sheetals
I am trying to manipulate an ontology using owlready2 version 0.34. While trying to delete an object or data property using destroy_entity(), the delattr function throws an AttributeError(even when the attribute exists). However, the deletion goes through successfully if a hasattr() check is added before the delattr call. Please help me with this.
Reply | Threaded
Open this post in threaded view
|

Re: Unable to delete data or object properties using destroy_entity

rami_dhouib
I think using the newest version is better.
Reply | Threaded
Open this post in threaded view
|

Re: Unable to delete data or object properties using destroy_entity

Jiba
Administrator
In reply to this post by sheetals
Can you send me an example of code?
where are you adding a hasattr() check ?
Reply | Threaded
Open this post in threaded view
|

Re: Unable to delete data or object properties using destroy_entity

sheetals
.
 I have added an addtional check in prop.py file inside the destroy_entity function.
The destroy_entity throws an error when I tried to delete an already existing data properties from a dataset(Eg : carcinogenesis dataset , data property : "charge") .
Reply | Threaded
Open this post in threaded view
|

Re: Unable to delete data or object properties using destroy_entity

Jiba
Administrator
Thank you, I've commited it in the development version of Owlready, on BitBucket.

Jiba