<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Jakub Kloc</string-name>
          <email>kloc4@uniba.sk</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Martin Homola</string-name>
          <email>homola@fmph.uniba.sk</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Júlia Pukancová</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Comenius University in Bratislava</institution>
          ,
          <addr-line>Mlynská dolina, 842 41 Bratislava</addr-line>
          ,
          <country country="SK">Slovakia</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>DL Abduction API, first presented last year, has been upgraded substantially. The API is now more tightly integrated with OWL API on which it relies for the representation of the passed values. The new version features a reworked set of implementation interfaces that are now more fine-grained and enable the integrators to cover the features relevant to their system more easily and modularly. In addition to the API library per se, we also present a GUI interface which which currently integrates two DL abduction solvers (MHS-MXP and LETHE-Abduction) via the API.</p>
      </abstract>
      <kwd-group>
        <kwd>abduction</kwd>
        <kwd>description logics</kwd>
        <kwd>ontology</kwd>
        <kwd>software engineering</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>
        Abduction [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] is a non-standard reasoning task wherein, given a formal language, the input
consists of background knowledge and an observation that is not entailed from it. The task is
to find possible explanations, i.e. formulas that together with the background knowledge entail
the observation. Optionally, explanations may be limited to a set of formulas or symbols called
the abducibles.
      </p>
      <p>
        In description logics, the background knowledge is an ontology. One distinguishes between
TBox and ABox abduction, wherein the observations and the explanations are TBox and ABox
axioms, respectively, and possibly a mixed approach, dubbed KB abduction [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ].
      </p>
      <p>
        DL Abduction API [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ], inspired but the popular OWL API [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ], proposed a uniform interface for
Java applications to integrate abduction reasoning services. The API was originally implemented
in the MHS-MXP ABox abduction solver [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] but it ofered a more generic interface that allowed
for an application to pass the inputs to the abduction solvers (including the background ontology,
the observations, and the abducibles) and to pass a plethora of additional control switches.
Abduction is a hard task; therefore the API also ofers an asynchronous execution mode under
which the solver is run in the background and passes the explanations back to the integrating
applications as soon as they are discovered.
      </p>
      <p>In this report, we describe a new version of the API with three main improvements: (a) the
API is now more tightly bound with the OWL API requiring an OWL API representation of all
nEvelop-O
LGOBE
https://dai.fmph.uniba.sk/~homola/ (M. Homola); https://dai.fmph.uniba.sk/~pukancova/ (J. Pukancová)</p>
      <p>© 2023 Copyright for this paper by its authors. Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0).
monitor
manager</p>
      <p>&lt;&lt;Interface&gt;&gt;
java.lang.Runnable
AbductionMonitor
Percentage
abducible</p>
      <p>&lt;&lt;Interface&gt;&gt;
SymbolAbducibleContainer</p>
      <p>&lt;&lt;Interface&gt;&gt;
AxiomAbducibleContainer</p>
      <p>&lt;&lt;Interface&gt;&gt;
ThreadAbductionManager</p>
      <p>&lt;&lt;Interface&gt;&gt;</p>
      <p>MultiObservationAbductionManager
ExplanationWrapper</p>
      <p>&lt;&lt;Interface&gt;&gt;</p>
      <p>AbductionManager
&lt;&lt;Interface&gt;&gt;
AbducibleContainer</p>
      <p>&lt;&lt;Interface&gt;&gt;
ExplanationConfigurator
&lt;&lt;Interface&gt;&gt;
ConceptExplanationConfigurator</p>
      <p>&lt;&lt;Interface&gt;&gt;
ComplexConceptExplanationConfigurator</p>
      <p>
        &lt;&lt;Interface&gt;&gt;
RoleExplanationConfigurator
values passed as inputs and outputs; (b) it is now structured into a much finer set of interfaces,
allowing for a more modular implementation of the API into solvers, which easily disregards
irrelevant features; (c) it now also ofers a GUI application that has been currently integrated
with two DL abduction solvers MHS-MXP [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] and LETHE-Abduction [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ].
      </p>
    </sec>
    <sec id="sec-2">
      <title>2. Abduction API v2</title>
      <p>The main class of the API1 is the AbductionManager, which serves to set the input and run the
solving process. Abducibles can be set using interfaces extending the AbducibleContainer
interface, while those extending the ExplanationConfigurator interface can be used to
conifgure which types of assertions should be allowed in the explanations. The AbductionMonitor
class provides the base for an asynchronous mode, in which explanations are processed right
as they are found, as opposed to waiting for the whole abduction to finish. A simplified class
diagram of the API is shown in Figure 1. The API also contains the AbductionFactory interface
and a hierarchy of exception classes. Those were omitted from the diagram for visual clarity.</p>
      <p>The original interfaces contained a variety of methods that are not expected to be implemented
by each solver. For instance, the original AbducibleContainer interface declared methods
1The API is available at https://github.com/Comenius-Abduction-Team/DL-Abduction-API
to manage abducibles both as vocabulary symbols and as axioms, and those that configure
assertion types in explanations as well. A hypothetical solver which supports only symbol
abducibles still would have to inherit all of these methods, but calling most of them would result
in an exception being thrown.</p>
      <p>We divided the interfaces into multiple smaller ones, each containing a group of logically
related methods. This approach minimises the number of unsupported methods when working
with a specific implementation of the API, e.g. the aforementioned solver would only implement
the SymbolAbducibleContainer interface.</p>
      <p>The original API used generic types for its input and output. We replaced them with OWL
API types to ensure that every implemented solver can be worked with uniformly. We created a
convenience class, the ExplanationWrapper, representing a single explanation. It may contain
multiple OWL axioms and the explanation’s string representation.</p>
      <p>In the asynchronous mode, the solver runs in a standalone thread and sends
explanations to other threads to be processed there. The threads must be
synchronised using the AbductionMonitor instance provided by a manager implementing the
ThreadAbductionManager interface. When a new explanation is found by the solver, it is
stored in a set in the monitor. The solver thread notifies other threads waiting on the monitor
and falls asleep. When the explanations are obtained from the monitor, the solver thread should
be notified to continue running.</p>
      <p>Apart from explanations, the solver can now also send a percentual value and a status message
to the other thread, to inform the user about the abduction’s current progress. Additionally, the
monitor class provides more flexibility and control over the asynchronous mode, e.g., the time
given to another thread to process explanations can be bound by a limit to prevent deadlocking.</p>
      <p>The API’s factory interface was enhanced, allowing every type of object available in the API
to be initialised abstractly. The hierarchy of exception classes was tweaked as well. The main
change is a new class, NotSupportedException, which allows to distinguish exceptions that
are thrown because of unsupported functionality and not run-time errors.</p>
      <p>
        We developed two implementations of the API2 , one based on an ABox solver using a
combination of MHS and MXP algorithms (the MHS-MXP solver [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]), and the other on
LETHEAbduction [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ], which uses forgetting to solve KB abduction. In the following example, we
showcase how to solve a simple abduction problem and print the explanations:
owlOntology ontology = ...; //obtain the background knowledge
owlAxiom observation = ...; //obtain the observation
AbductionManager manager = new MhsMxpAbductionManager();
manager.setBackgroundKnowledge(ontology);
manager.setObservation(observation);
manager.solveAbduction();
manager.getExplanations().forEach(System.out::println);
      </p>
      <p>MhsMxpAbductionManager is an object of the API encapsulating the MHS-MXP solver and for
simplicity we just show the basic, synchronous execution mode (i.e., not the above-mentioned
2Available at https://github.com/Comenius-Abduction-Team/MHS-MXP-algorithm and https://github.com/
Comenius-Abduction-Team/LETHE-Abduction-API-implementation, respectively
asynchronous mode).
3. GUI
The two implementations of the API can be used via a JavaFX GUI application3 that we developed.
Its interface is shown in Figure 2. The background knowledge, the observation and the abducibles
are all entered in the GUI in the form of an OWL ontology, either in the RDF/XML or the
Manchester syntax. After the abduction finishes, the explanations are printed as strings into a
text area ”console”. The API’s asynchronous mode is used to show potential new explanations
right as they are found and to update a progress bar. Logs and other informative prints produced
by the solvers are shown in a separate console.</p>
    </sec>
    <sec id="sec-3">
      <title>4. Conclusions</title>
      <p>
        We have described DL Abduction API v2, an improved and more mature version of the original
API [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. It allows for more eficient and more modular integration with DL abduction solvers and
introduces a few additional features. Those include a GUI interface that is currently integrated
with two solvers and provides a more user-convenient way to work with them.
      </p>
    </sec>
    <sec id="sec-4">
      <title>Acknowledgments</title>
      <p>The authors are grateful to Patrick Koopmann for his valuable feedback on the API proposal.
This research was sponsored by the Slovak Republic under the grant APVV-19-0220 (ORBIS) and
3Source code available at https://github.com/Comenius-Abduction-Team/Abduction-App
by the EU under the H2020 grant no. 952215 (TAILOR). J. Kloc was supported by an extraordinary
scholarship awarded by Comenius University in Bratislava, Faculty of Mathematics, Physics
and Informatics and by a DL student grant.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>C. S.</given-names>
            <surname>Peirce</surname>
          </string-name>
          ,
          <article-title>Illustrations of the logic of science VI: Deduction, induction, and hypothesis</article-title>
          ,
          <source>Popular Science Monthly</source>
          <volume>13</volume>
          (
          <year>1878</year>
          )
          <fpage>470</fpage>
          -
          <lpage>482</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>C.</given-names>
            <surname>Elsenbroich</surname>
          </string-name>
          ,
          <string-name>
            <given-names>O.</given-names>
            <surname>Kutz</surname>
          </string-name>
          ,
          <string-name>
            <given-names>U.</given-names>
            <surname>Sattler</surname>
          </string-name>
          ,
          <article-title>A case for abductive reasoning over ontologies</article-title>
          ,
          <source>in: Proceedings of the OWLED*06 Workshop on OWL: Experiences and Directions</source>
          , Athens, GA, US, volume
          <volume>216</volume>
          <source>of CEUR-WS</source>
          ,
          <year>2006</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>Z.</given-names>
            <surname>Hlávková</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Homola</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Koopmann</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Pukancová</surname>
          </string-name>
          ,
          <article-title>An API for DL abduction solvers</article-title>
          ,
          <source>in: Proceedings of the 35th International Workshop on Description Logics (DL</source>
          <year>2022</year>
          ), Haifa, Israel, Aug 7-
          <issue>10</issue>
          ,
          <year>2022</year>
          , volume
          <volume>3263</volume>
          <source>of CEUR-WS</source>
          ,
          <year>2022</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>M.</given-names>
            <surname>Horridge</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Bechhofer</surname>
          </string-name>
          ,
          <article-title>The OWL API: A Java API for OWL ontologies</article-title>
          ,
          <source>Semantic Web</source>
          <volume>2</volume>
          (
          <year>2011</year>
          )
          <fpage>11</fpage>
          -
          <lpage>21</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>M.</given-names>
            <surname>Homola</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Pukancová</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Boborová</surname>
          </string-name>
          ,
          <string-name>
            <surname>I. Balintová</surname>
          </string-name>
          , Merge, explain, iterate
          <article-title>: A combination of MHS and MXP in an ABox abduction solver</article-title>
          ,
          <source>in: Logics in Artificial Intelligence - 18th European Conference, JELIA</source>
          <year>2023</year>
          , Dresden, Germany, Sep 20-
          <issue>22</issue>
          ,
          <year>2023</year>
          , Proceedings, volume
          <volume>14281</volume>
          <source>of LNCS</source>
          , Springer,
          <year>2023</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>P.</given-names>
            <surname>Koopmann</surname>
          </string-name>
          ,
          <string-name>
            <given-names>W.</given-names>
            <surname>Del-Pinto</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Tourret</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R. A.</given-names>
            <surname>Schmidt</surname>
          </string-name>
          ,
          <article-title>Signature-based abduction for expressive description logics</article-title>
          ,
          <source>in: Proceedings of the 17th International Conference on Principles of Knowledge Representation and Reasoning</source>
          , KR 2020, Rhodes, Greece,
          <year>2020</year>
          , pp.
          <fpage>592</fpage>
          -
          <lpage>602</lpage>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>