Export triplets generated by reasoning

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

Export triplets generated by reasoning

carlos
Hi,

I'm Carlos, I would like to know how can I extract the new triplets that the reasoner (pellet or Hermit) has infered.

Regards

Reply | Threaded
Open this post in threaded view
|

Re: Export triplets generated by reasoning

Jiba
Administrator
Hi,

You can put the new triples in a new ontology as follows:

onto_inferrence = get_ontology("http://test.org/onto_inference.owl") # Put the IRI you want here

with onto_inferrence:
     sync_reasoner()


Then you can save this ontology to save the inferred triples.

Jiba
Dan
Reply | Threaded
Open this post in threaded view
|

Re: Export triplets generated by reasoning

Dan
Hi Jiba,

I had a question based on your answer here. I am trying to access inferred facts on individuals (primarily inferred class membership based on object properties). After syncing the reasoned, I use
onto.get_instances_of(onto.Class)
but the return value is an empty list. This inference works on Protege running the same Hermit reasoner.

I wonder if it has something to do with the (NB: only changes on entities loaded in Python are shown, other changes are done but not listed) warning I get when I run the program.
Or if it has to do with configuring the reasoner.

Is there a quick solution to my problem?
Reply | Threaded
Open this post in threaded view
|

Re: Export triplets generated by reasoning

Jiba
Administrator
Hi,

The "NB: only changes on entities loaded in Python are shown, other changes are done but not listed" warning just relates to the list of change displayed on the standard output, not to the change performed in the quadstore.

To verify that everything went well, could you obtain one of these individuals (e.g. using its IRI) and check whether the new class is present in individual.is_a ?

Jiba