Skip to content

Handling Ontology Change Events

maphih edited this page Sep 5, 2025 · 1 revision

Through the Protégé interface OWLOntologyChangeListener, classes can receive events that are triggered when the active ontology is edited in Protégé. Various classes related to non-entailment explanations need to listen for these events:

  1. The java file of the class NonEntailmentVocabularySelectionUI contains a private class listening for these events to ensure that the currently displayed Vocabulary UI elements contain exactly those classes, object properties and individuals that are defined in the active ontology. Furthermore, the view will reset the displayed result component to an empty panel unless it received an ExplanationEvent of the type IGNORE_ONTOLOGY_CHANGE (see below).
  2. The java file of the class NonEntailmentViewComponent contains a private class listening for these events to ensure that the currently displayed Missing Entailment UI elements contain exactly those classes, object properties and individuals that are defined in the active ontology.
  3. The java file AbductionSolverResultManager contains a private class listening for these events to ensure that the displayed result component will be reset correctly if the active ontology is edited.

The non-entailment explanation services using abduction have the functionality to explain why a produced result leads to the missing entailment being entailed. This is done by utilizing the Explanation Window of Protégé. The computed result for the missing entailment is added to the active ontology and then the explanation window is displayed, just as if the user had clicked on the ?-button next to an axiom in the entities tab. The added axioms are removed when the window is closed again. Both adding and removing the axioms leads to OWLOntologyChange-events being created. In order for the view to be able to ignore these particular events, the abduction solvers trigger an ExplanationEvent of the type IGNORE_ONTOLOGY_CHANGE right before changing the ontology. The view then listens for this event and will ignore the next ontology change. In case an OWLOntologyChange-event is registered without an ExplanationEvent of type IGNORE_ONTOLOGY_CHANGE occurring, the view will reset the displayed result to an empty panel.

Clone this wiki locally