org.mindswap.pellet.utils.Timers timers = new Timers();
timers.createTimer("classification");
timers.createTimer("approximation");
OWLReasonerFactory reasonerFactory = null;
switch (selectReasoner){
case 1: reasonerFactory = new PelletReasonerFactory(); break;
case 2: reasonerFactory = new FaCTPlusPlusReasonerFactory(); break;
default: reasonerFactory = new PelletReasonerFactory(); break;
}
/* Initialize manager used for loading the Abox */
OWLOntologyManager manager = null;
manager = OWLManager.createOWLOntologyManager();
/* Rewrite Tbox T -> T' based on the current vocabulary subset */
Timer timerApproximation = timers.startTimer( "approximation" );
ApproximationResult approximationResult = approximation.getNextTBox();
timerApproximation.stop();
if (approximationResult != null) {
System.out.println("Creating Tbox approximation "+runCounter);
OWLOntology abox = null;
OWLOntology approximatedTbox = null;
OWLReasoner reasoner = null;
int newIndividualsToAdd = 0;
/* get the approximated Tbox */
approximatedTbox = approximationResult.approximatedOntology();
if (approximationResult.isOriginal()){
/* Last run. Use original Abox to compute the baseline run */
aboxPhysicalURI = originalAboxURI;
}
/* Load Abox into the manager */
abox = manager.loadOntologyFromPhysicalURI(aboxPhysicalURI);
int aboxIndividualAxiomsCount = abox.getIndividualAxioms().size();
if (measureApproximationTime) {
/* update time with the time it takes to build the Tbox based on the current vocabulary set */
approximationTime = timerApproximation.getTotal();
}
//OWLOntology currentTBox2 = approximationResult.approximatedOntology();
/* Create a new physical URI based on the current run */
URI tboxPhysicalURI = createNewURI(tmpTboxPhysicalURI, runCounter);
if (saveApproximatedTbox){
/* Save approximated Tbox to disk - for debugging purposes only */
saveOntologyToFile(approximatedTbox, tboxPhysicalURI);
}
/* Create the reasoner */
reasoner = reasonerFactory.createReasoner(manager);
logger.info("Using reasoner: "+reasonerFactory.getReasonerName());
Set<OWLOntology> ontologiesToLoad = new HashSet<OWLOntology>();
ontologiesToLoad.add(abox);
ontologiesToLoad.add(approximatedTbox);