-
Notifications
You must be signed in to change notification settings - Fork 1
Abstract abduction solver
The plugin evee-protege-core contains the class AbstractAbductionSolver<T> that non-entailment services using abduction can extend. This is the central class for abduction solvers which handles and delegetas caching the results, displaying results in a uniform format and implementing the functionality of the UI elements that come in the displayed result component. The generic type specifies the kind of result that is computed by the internal abduction solver and is used for the caching mechanism. The abstract abduction solver uses the the Permitted Signature specified via the NonEntailmentVocabularySelectionUI (see [Non Entailment View](Non-Entailment-Explanation-Services/Non Entailment View)) as an internal Vocabulary.
The class AbstractAbductionSolver implements the following interfaces:
-
IOWLAbductionsolver(found inevee-data), which extends the interfaceINonEntailmentExplainerthat contains the necessary functions for computing an explanation. -
IAbductionSolverOntologyChangeEventListener(found inevee-protege-core), with which the abduction solver can receive information about changes to the active ontology from the class [AbductionSolverResultManager](Abduction-non-entailment-services/Result manager and result display). The abduction solver handles events of the typesONTOLOGY_EDITED_EXTERNALLY,ONTOLOGY_EDITED_INTERNALLY,ACTIVE_ONTOLOGY_CHANGEDandVIEW_COMPONENT_IGNORE_CHANGE. -
ISignatureModificationEventListenerandISignatureModificationEventGenerator(found inevee-protege-core), with which the abduction solver can forward information on signature changes to the Protégé view. Note that these interfaces don't send events of a specific type but rather events that contain a set ofOWLEntitiesthat should be added to the signature. -
IExplanationGenerationListener(found inevee-data), with which the abduction solver can receive information from the internal abduction computation mechanism. TheAbstractAbductionSolverhandles events of the typesCOMPUATION_COMPLETEandERROR.
The most important method for computing a non-entailment explanation is computeExplanation of the interface INonEntailmentExplanationService. In its base form, the method checks if the vocabulary and missing entailment have been changed since the last computation was requested and if a cached result can be re-used. The actual computation is handled by a separate thread which is created whenever a new explanation needs to be computed. An object of the class AbductionSolverThread is created for this. This new thread object implements the interface IExplanationGenerator in order to forward information from the internal abduction solver to the class AbstractAbductionSolver. The internal solver is handed to the thread object upon creation via the abstract method getInternalSolver of the AbstractAbductionSolver. Through this method, any abduction solver extending the abstract solver needs to provide an object implementing the interface IOWLAbductionSolver (of evee-data) that will be used to cmpute the actual result.
The internal abduction solver needs to provide its result in the form of a Stream. This stream is handed from the thread to the AbstractAbductionSolver once the computation is completed. The abstract solver iterates over the elements of the stream to create a list of hypotheses. This list contains as many elements as specified in the preferences tab Abduction (General) found in the Protégé Preferences via Explanations -> Missing Entailment -> Abduction (General). The list of results is handed to the [AbductionSolverResultManager](Abduction-non-entailment-services/Result manager and result display) which handles creating the result component that is to be displayed. Once the component was created, the abstract abduction solver will send an ExplanationEvent of the type COMPUTATION_COMPLETE to the view, which in turn will retrieve the result component. If the generated stream contains more elements than can be displayed, the user can click on the Generate Explanation button again to display additional results. This will cause a new list to be generated from the stream, which is again handed to the result manager in order for the result component to be updated accordingly.
Caching of results is done via an internal Map which uses an OWLOntology as a key and saves an AbductionCache<T> as value. An AbductionCache has an internal Map which uses an object of the class KeyTuple as a key and saves an object of class T as a result. The KeyTuple consists of a Set of OWLAxioms (representing the missing entailment) and a Collection of OWLEntities (representing the permitted signature). The cache can be reset by a class extending AbstractAbductionSolver via the protected method resetCache. The abstract abduction solver resets the cache whenever the ontology is edited.
The preferences window with which the user can change the number of new hypotheses to be displayed is created by the class AbductionGeneralPreferenesUI. This class provides a plugin which hooks into the extension point de.tu_dresden.inf.lat.evee.nonEntailment_preferences defined in evee-protege-core. As usual for preference UIs, the class extends the Protégé class OWLPreferencesPanel.