[Pellet-users] getDeductionModel and updates by Jena OntModel prepare() : some questions
Evren Sirin
evren at clarkparsia.com
Thu Jul 10 13:12:04 UTC 2008
Yes, the deductionsGraph is set to null in the prepare function. I'm not
sure what the problem you are seeing is but I would advise strongly not
to use getDeductionsModel function whose behavior was changed in Pellet
1.5.1 to return null. This is because the Jena javadoc describes this
function as:
> getDeductionsModel
>
> Model getDeductionsModel()
>
> Returns a derivations model. The rule reasoners typically create a
> graph containing those triples added to the base graph due to rule
> firings. In some applications it can useful to be able to access those
> deductions directly, without seeing the raw data which triggered them.
> In particular, this allows the forward rules to be used as if they
> were rewrite transformation rules.
>
> Returns:
> the deductions model, if relevant for this class of inference
> engine or null if not.
>
According to this description getDeductionsModel is not relevant for
Pellet (which is obviously not a rule reasoner) and should have never
been implemented. For this reason, the behavior in Pellet 1.5.1 has been
changed to return null for this function with a temporary configuration
option that gives the 1.4 behavior. This configuration option will be
removed in a future release so getDeductionsModel will always return
null. If you continue using this function your code will break when you
upgrade (which I strongly suggest because there have been many bug fixes
since 1.4).
If what you want is to get the inferences Pellet computes then you can do
Model inferences = ModelFactory.createDefaultModel();
inferences.add( ontModel );
inferences.remove( ontModel.getRawModel() );
Cheers,
Evren
On 7/9/08 9:22 AM, Paolo Bussotti wrote:
> Hello everybody.
> I'm working with Pellet (1.4) through a Jena Pellet-backed OntModel,
> and I update the Knowledgebase by modifying the OntModel
> and successively calling prepare() on it.
> I've seen that this corresponds to calling prepare() on the
> PelletInfGraph that, if I'm not wrong, should set its deductionsGraph
> variable
> to null, if some changes have happened (in this version, if the kb
> have been reloaded).
> It all works fine, but when I try to get the deductionModel, calling
> OntModel.getDeductionsModel, then, even after changes, the system
> continues to give me back the same model. And this even if, after a
> change, I've invoked prepare, therefore setting the variable
> deductionsGraph to null: it looks like the variable deductionsGraph is
> never set to null, and returns always the same model.
> Another question please: is it correct that the deduction model does
> not modify the OntModel.BaseModel as iy happens instead with rule
> reasoner ?
> I thank you all in advance.
> Best Regards
> Paolo Bussotti
> ------------------------------------------------------------------------
>
> _______________________________________________
> 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