Hi jena-users,
I have an RDF model, and I want to infer new triples from a chain of Jena
Custom Rules Reasoners.
I'm currently doing the following:
// def. of the reasoners goes here..
private static Reasoner firstReasoner =
RuleReasonerFactory.createRulesReasoner("first_service.rules");
private static Reasoner secondReasoner =
RuleReasonerFactory.createRulesReasoner("second_service.rules");
private static Reasoner thirdReasoner =
RuleReasonerFactory.createRulesReasoner("third_service.rules");
...
public Model createMapping(Model model) {
// first, use the incoming RDF deva model
Model infmodel = ModelFactory.createInfModel(firstReasoner, model);
// all subsequent calls just take the previously created infmodel and reason
over it
infmodel = ModelFactory.createInfModel(secondReasoner, infmodel);
infmodel = ModelFactory.createInfModel(thirdReasoner, infmodel);
...
return infmodel;
}
To get the best performance:
Should I call infmodel.prepare() before the call to the next reasoner?
Is there an efficient way to strip the infmodel from the reasoner (I.e. get
a simple Model again) so that the next inference is faster? (I think I'm
getting way too many rules fired..)
Thanks!,
Xabriel J. Collazo-Mojica <http://cs.fiu.edu/~xcoll001/>
CS <http://www.cis.fiu.edu/> PhD Student @ FIU <http://www.fiu.edu>