Re: How to do twice reasoning
Posted by
carlos on
URL: http://owlready.306.s1.nabble.com/How-to-do-twice-reasoning-tp1741p1743.html
Hi, I have solved my problem of using two consecutive times the reasoning. The problem is that sync_reasoner() places all inferred facts in a special ontology, ‘
http://inferrences/’. Therefore, if we try to use the reasoner with a new ontology, the special ontology used for keeping the inferred fact continues keeping the old facts, so the solution is removing all these ontology before applying again the reasoner. You can do it using the method destroy of the ontology:
onto = get_ontology("ontology_1.nt").load()
sync_reasoner_pellet()
onto_inferred = get_ontology("
http://inferrences/")
onto_inferred.save("./output/infered_triples_1.nt", format="ntriples")
onto_inferred.destroy()
onto2 = get_ontology("ontology_2.nt").load()
sync_reasoner_pellet()
onto_inferred = get_ontology("
http://inferrences/")
onto_inferred.save("./output/infered_2.nt", format="ntriples")