Run the reasoner but no change in the ontology

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

Run the reasoner but no change in the ontology

Tengyu Li
Hello,

I have an ontology with some swrl rules defined in the protege. I used owlready2 to read this ontology and run the pellet/HermiT reasoner to do some reasonings. Finally, I saved the ontology as a rdf/xml file. The python console showed that the reasoner had added an assertion to my ontology, but actually I didn't see the addition in the rdf/xml file.

The python console output:
* Owlready * Adding relation IVRTSOntology.Power_Power openingDegree 10.0
* Owlready2 * Pellet took 1.285620927810669 seconds
* Owlready * (NB: only changes on entities loaded in Python are shown, other changes are done but not listed)

The rule I defined in the protege:
IVRTSOntology:LatestBehavior(?b) ^ IVRTSOntology:operatedObject(?b, ?o) -> IVRTSOntology:openingDegree(?o, 10)

Hope to get your reply! Thank you very much!
Reply | Threaded
Open this post in threaded view
|

Re: Run the reasoner but no change in the ontology

Jiba
Administrator
Hello,

By default, Owlready adds the inferred facts to a special ontology, http://inferrences/.

If you want to write them in another ontology (possibly directly the ontology you are reasoning on), you need to use a "with onto:..." block:

with onto: sync_reasoner()

where onto is the ontology in which you want to write the inferred fact.

Jiba
Reply | Threaded
Open this post in threaded view
|

Re: Run the reasoner but no change in the ontology

Tengyu Li
Dear Jiba,

Thank you very much! Now it works after adding "with onto:".

Best regards,
Tengyu