Anna Lu
unread,Jul 15, 2010, 5:00:48 AM7/15/10Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to jenabe...@googlegroups.com
I initiated the model with some data, then applied Jena rule on it but the rule doesn't work. Here is what I did:
@Autowired
private Model sourceModel;
runInference() {
initiate();
Resource configuration = sourceModel.createResource();
configuration.addProperty(ReasonerVocabulary.PROPruleMode, "hybrid");
configuration.addProperty(ReasonerVocabulary.PROPruleSet,".../test.rule");
Reasoner rea = GenericRuleReasonerFactory.theInstance().create(configuration);
InfModel infModel = ModelFactory.createInfModel(rea, sourceModel);
infModel.prepare();
Person person = new Person().load("person1");
System.out.println("death date:" + person.getDeathDate().toString());
System.out.println("birth date:" + person.getBirthDate().toString());
}
initiate () {
Person person = new Person("person1", "Dudley Moore"); //new Person(id, name)
Calendar deathCal = Calendar.getInstance();
deathCal.set(Calendar.YEAR, 2002);
deathCal.set(Calendar.MONTH, 2);
deathCal.set(Calendar.DATE, 27);
person.setDeathDate(deathCal.getTime());
person.save();
}
Jena rule:
(?person ont:DeathDate ?deathdate)
->
(?person ont:BirthDate ?deathdate)
The result is:
print out the death date but the birth date is null.
Is there something I did wrong with Jenabean or with Jena inference?