Class BasicTBoxReasonerDriver
- java.lang.Object
-
- edu.cornell.mannlib.vitro.webapp.tboxreasoner.impl.BasicTBoxReasonerDriver
-
- All Implemented Interfaces:
TBoxReasonerDriver
public class BasicTBoxReasonerDriver extends Object implements TBoxReasonerDriver
The basic implementation of the TBoxReasonerDriver. It gets help from a listener, an executor, and a reasoner. Create a listener that listens for changes to the TBox, but filters them according to a ReasonerConfiguration object. The listener accumulates the changes it likes, until it detects an ending EditEvent. Then it passes the change set back to the driver. Each time a change set is received, a task is created and given to the executor to run. The executor is single-threaded, so the change sets are processed in sequence. Processing involves the following steps: 1. Telling the reasoner about the changes, so it can update its own internal ontology model. 2. Telling the reasoner to re-inference its model. A status is returned. 3. Asking the reasoner for the inferences from its model. As with the initial changes, these inferences are filtered according to the ReasonerConfiguration. 4. Synchronizing the applications TBox inferences model with the inferences obtained from the reasoner. ---------------------- Possible optimization: if change sets come in quickly enough that the third set is received while the first is still being processed, it would be reasonable to merge the second and third sets into one.
-
-
Constructor Summary
Constructors Constructor Description BasicTBoxReasonerDriver(org.apache.jena.ontology.OntModel assertionsModel, org.apache.jena.rdf.model.Model inferencesModel, org.apache.jena.ontology.OntModel fullModel, TBoxReasoner reasoner, ReasonerConfiguration reasonerConfiguration)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TBoxReasonerStatusgetStatus()voidrunSynchronizer(TBoxChanges changeSet)voidshutdown()Shut down the thread that runs the reasoning tasks.
-
-
-
Constructor Detail
-
BasicTBoxReasonerDriver
public BasicTBoxReasonerDriver(org.apache.jena.ontology.OntModel assertionsModel, org.apache.jena.rdf.model.Model inferencesModel, org.apache.jena.ontology.OntModel fullModel, TBoxReasoner reasoner, ReasonerConfiguration reasonerConfiguration)
-
-
Method Detail
-
getStatus
public TBoxReasonerStatus getStatus()
- Specified by:
getStatusin interfaceTBoxReasonerDriver
-
runSynchronizer
public void runSynchronizer(TBoxChanges changeSet)
- Specified by:
runSynchronizerin interfaceTBoxReasonerDriver
-
shutdown
public void shutdown()
Shut down the thread that runs the reasoning tasks. Don't wait longer than 1 minute.
-
-