|
Hi All,
I'm trying something very simple :
1) Loading onto + loading SWRL rules + launching sync_reasoner_pellet()
2) catches some inferences
3) Trying to delete rules with this simple code :
# --- Destroy rules
for rule in my_onto.rules():
print("Delete rule %s"%(rule))
owl2.destroy_entity(rule)
Delete rule hasSameAge(?u11, ?u21), isBelow(?u11, ?u12), hasNotSameAge(?u12, ?u22), hasNamedAge(?u12, ?a1), hasNamedAge(?u22, ?a2), upperThan(?a1, ?a2), isComponentOf(?u11, ?b) -> RevealsUnconformitySince(?b, ?a1)
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
<ipython-input-19-aa4f1be105d8> in <module> 3 if debug ==True:
4 print("Delete rule %s"%(rule))
----> 5 owl2.destroy_entity(rule)
~/anaconda3/envs/XXXL/lib/python3.7/site-packages/owlready2/prop.py in destroy_entity(e, undoable)
909 except: pass
910
--> 911 e.namespace.world.graph.destroy_entity(e.storid, destroyer, relation_updater, undoer_objs, undoer_datas)
912
913 e.namespace.world._entities.pop(e.storid, None)
~/anaconda3/envs/XXX/lib/python3.7/site-packages/owlready2/triplelite.py in destroy_entity(self, storid, destroyer, relation_updater, undoer_objs, undoer_datas)
908 self.execute("DELETE FROM resources WHERE storid=?", (storid,))
909 if self._abbreviate_d:
--> 910 del self._abbreviate_d [self._unabbreviate_d[storid]]
911 del self._unabbreviate_d[storid]
912
KeyError: -297
===> Where am i wrong ? Any idea ?
Thank you.
|