I'm noob in Jena and reading this page,more specifically in Figure 5(iii) -"direct inferred relationship" I found exactly what I need. Basically, my OntModel needs to respect the following rule: "Can't be allowed direct statements which can be inferred". But unfortunately I don't know how to materialize this ideas in Jena.
My example code is:
String baseUri="http://entidades.owl";
OntModel base = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM);
OntClass studant = base.createClass(baseUri +"#Student");
OntClass person = base.createClass(baseUri +"#Person");
OntClass ser = base.createClass(baseUri +"#ThingLive");
Property isA = base.createTransitiveProperty(baseUri+"#IsA", true);
nome.addDomain(person);
base.add(new StatementImpl(studant, isA, person));
base.add(new StatementImpl(person, isA, ser));
base.createIndividual(baseUri+"#JonhDoe",studant);
base.createIndividual(baseUri+"#JonhDoe",person);
base.createIndividual(baseUri+"#JonhDoe",ser);
base.write(System.out);
OntModel model = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM_MICRO_RULE_INF,base);
model.write(System.out);
Well,
I try to build a "isA" property as a "transitiveProperty" but the reasoner does not recognize it. How can I fix it ?
If I change: base.add(new StatementImpl(studant, isA, person)); base.add(new StatementImpl(person, isA, ser));
to:
person.addSubClass(student); ser.addSubClass(person);
The reasoner was able to inferrer perfectly, but unfortunatly OntModel "base" and OntModel "model" show me the same RDF. I think that "model" should show me a minimal RDF graph reflected.
What can I do to see this changes in the RDF structure ?
Thank you so much guys!!!!!