[Pellet-users] How to optimize inference speed
Alejandro Rodríguez González
jalo.javier at gmail.com
Sun Jan 27 11:14:06 UTC 2008
Hi,
I want to optimize the speed of the inferences make over my ontology,
but i don't know if it's possible.
I have an ontology:
http://www.jalojavier.es/humandisease.owl
<http://www.jalojavier.es/humandisease.owl>
And now, i'm makin my firsts tests, trying to obtain the infered
classes of some tests that i make.
Concretely, for example, i want to obtain the classes infered by the
instance "PR_SYMS_A_B_C" that must infere "DIS_X_Class".
The inference works ok, but the problem is that is too slow (This
inference takes 107 seconds). If i make more tests with more
instances, it takes "relative" less time (the inference of 4 instances
takes 188 seconds).
In the code below, i make only the inference of PR_SYMS_A_B_C instance.
private void createModelToLoadData() {
PelletOptions.USE_UNIQUE_NAME_ASSUMPTION = true;
model =
ModelFactory.createOntologyModel(PelletReasonerFactory.THE_SPEC);
model.read(fileOnt.toURI().toString());
}
private void testInference() {
Individual i1 = model.getIndividual(getOntologyURI() +
"#PR_SYMS_A_B_C"); //PR_SYMS_A_B_C
inferenceInstance(i1);
}
private void inferenceInstance(Individual i) {
StmtIterator sti = model.listStatements(i, null, (RDFNode) null);
int c = 1;
for (; sti.hasNext(); ) {
Statement stmt = (Statement)sti.next();
Resource rx = stmt.getResource();
System.out.println("Res [" + c + "]: " + rx);
c++;
}
}
Is there any problem with the code and is this reason to take so many
time? Or is a problem of my ontology? Too many data in my ontology?
Thanks!
More information about the Pellet-users
mailing list