[Pellet-users] reasoner refresh and ontology changes
Evren Sirin
evren at clarkparsia.com
Fri Jul 18 17:16:07 UTC 2008
On 7/16/08 8:21 PM, Daniel M. Herzig wrote:
>> On Thu, 2008-06-26 at 11:47 +0200, robocop wrote:
>>
>>
>>> / I want to know if Pellet (with OWLAPI) "knows" the changes made onto the
>>>
>> />/ ontology, i.e. if I create a class complement of a class description,
>> />/ and I add this new class to the ontology, then the reasoner
>> />/ automatically can do inference on that new class or I have to
>> />/ refresh/reload the ontology loaded by the reasoner?
>> /
>> Pellet (as an owlapi OWLReasoner) will "know" about the changes only if
>> it is added to the OWLOntologyManager as an OntologyChangeListener,
>> otherwise a call to refresh is necessary.
>>
>> The IncrementalConsistencyExample example in the distribution has code
>> that demonstrates adding the reasoner as a change listener.
>>
>
> How can I call such a refresh?
> I don't want to add the reasoner as a listener,
> since I perform many changes and don't want to trigger the classification after each step,
> just once after all changes are complete.
>
When Pellet is added as a change listener it will no reclassify after
each modification. It will simply mark the state of the reasoner as
changed and next time you ask a query it will do the reasoning steps
necessary to answer that query (which may or may not involve
classification).
> All refresh() methods I found are private.
>
The function for manual refresh is
org.mindswap.pellet.owlapi.Reasoner.refresh()
which is not part of the generic OWLAPI reasoner interface but available
from Pellet implementation.
> Just calling reasoner.classify() is not enough, because the reasoner doesn't take the changes into account sometimes.
>
> I instantiate the reasoner like this in an Protege4/owlapi environment:
>
> OWLReasonerManager reasonmanager = owlmodelmanager.getOWLReasonerManager();
> OWLReasoner reasoner = reasonmanager.getCurrentReasoner();
> ...
> //Ontology manipulations
> ...
> reasoner.classify();
>
Either create a Pellet reasoner directly (instantiate a new
org.mindswap.pellet.owlapi.Reasoner) or cast the OWLReasoner instance
you have to that class and call refresh() function. But as I explained
above attaching the reasoner as a listener would not cause any more
reasoning overhead and would be a better option.
Cheers,
Evren
> Thank you!
> Daniel
>
> _______________________________________________
> Pellet-users mailing list
> Pellet-users at lists.owldl.com
> http://lists.owldl.com/mailman/listinfo/pellet-users
> _______________________________________________
>
> Sponsored by Clark & Parsia, LLC http://clarkparsia.com/
>
More information about the Pellet-users
mailing list