<!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>
      <title-group>
        <article-title>Verifying Reasoner Correctness - A Justi cation Based Method</article-title>
      </title-group>
      <contrib-group>
        <aff id="aff0">
          <label>0</label>
          <institution>The University of Manchester Oxford Road</institution>
          ,
          <addr-line>Manchester, M13 9PL</addr-line>
          ,
          <country>UK ac.uk</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>DL reasoners are complex pieces of software that work on even more complex input which makes manual veri cation di cult. A single ontology can have hundreds or thousands of classes and thus its classi cation involve an unsurveyable number of subsumption tests. We propose a new method for debugging classi cation across multiple reasoners which employs justi cations generated from the set of entailments that reasoners disagree upon to determine the cause of the disagreement.</p>
      </abstract>
      <kwd-group>
        <kwd>OWL</kwd>
        <kwd>reasoning</kwd>
        <kwd>debugging</kwd>
        <kwd>justi cations</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1 Introduction</title>
      <p>One of the major advantages of description logic reasoning are the sound and
complete decision procedures for the known fragments that underpin OWL 2
and its various pro les. However, implementing these procedures can be very
di cult due to inter-related optimisations and language speci c limitations. It
is very likely that no implementation is actually correct for all legal inputs. We
have found that, in practice, reasoners do disagree on particular entailments
in the inferred class hierarchy. The complexity of the implementation makes a
formal veri cation of correctness, or even a generation of a non-arbitrary set of
automated unit tests, a near impossibility. Thus, it is di cult to resolve disputes.</p>
      <p>Majority voting (MV) is a resolution method used in reasoner competitions
[4]. When a disagreement occurs over the inferred class hierarchy, the verdict of
the majority of reasoners is taken as truth. In case of a tie, the correct reasoner
is selected at random. This method has the key problem that it is not inherently
sensitive to the truth of the matter.</p>
      <p>We present a novel semi-automated method to determine reasoner correctness
and narrow down potential causes of disagreement amongst a set of dissenting
reasoners in an e cient manner. We have evaluated our method using a corpus
of BioPortal ontologies.</p>
    </sec>
    <sec id="sec-2">
      <title>2 The Method</title>
      <p>Throughout, we denote R a description logic reasoner and E (O; R) the set of
atomic subsumptions found by R (the class hierarchy ). J is a justi cation for
O j= if J O, J j= and there is no J 0 J such that J 0 j= . We call a
tuple &lt; O; ; J ; Rjust; R &gt; a case, where Rjust is the reasoner that generated
the justi cation J for the entailment and R is the reasoner that veri ed it.
Aside from these notions we assume a basic familiarity with description logics,
OWL and reasoners (see [1]).</p>
      <p>The method: First, for a given ontology O, we ask reasoners R1; :::; Rm,
denoted R, to compute the E (O; Ri) for all Ri 2 R. From these, we compute the
set of disagreed upon entailments, denoted D, by taking the union of all inferred
class hierarchies and removing the intersection of them, S E (O; Ri)n T E (O; Ri).</p>
      <p>Fix some n 2 N, as the upper bound on the number of generated justi
cations. For each given entailment 2 D and every Ri 2 R, we generate a sequence
of up to n many justi cations J1; J2; :::Jn. Note that we attempt to generate
justi cations with all reasoners, including the ones for which 62 E (O; Ri).</p>
      <p>
        For each justi cation Ji for and each reasoner Ri 2 R1 we check whether
follows directly from the given justi cation (justi cation veri cation). We then
classify all cases according to one of four categories. (
        <xref ref-type="bibr" rid="ref1">1</xref>
        ) If Ri infers Ji j=
and also initially considered 2 E (O; Ri), then we classify this behaviour as
consistent yes. (
        <xref ref-type="bibr" rid="ref2">2</xref>
        ) If Ri infers Ji j= and did not compute as part of the
generated class hierarchy, then we consider Ri to have a simple bug. This could
happen because of a bug in the classi cation traversal algorithm or because of
faulty caching. (
        <xref ref-type="bibr" rid="ref3">3</xref>
        ) If Ri infers Ji 6j= and 62 E (O; Ri), then we class these
as consistent no. We assume that either Ri or the reasoner that generated the
justi cation contains a bug. These cannot be automatically decided and we pass
the justi cation to an expert. If the expert determines Ji to be a justi cation
for , than Ri is considered buggy, else the justi cation generating reasoner. (
        <xref ref-type="bibr" rid="ref4">4</xref>
        )
If Ri infers Ji 6j= and initially returned 2 E (O; Ri), then we consider this a
serious error and class this as possible bug, as we are uncertain where a problem
has occurred. Such cases also require expert review. In our experiment, this case
did not occur.
      </p>
    </sec>
    <sec id="sec-3">
      <title>3 Experimental Design</title>
      <p>Corpus, Reasoners and Machines: For the experiment the OWL API (v.
3.5.0) implementations [6] of four state of the art reasoners were used: FaCT++
1.6.3 [9], JFact 1.2.3, Pellet 2.3.1 [7] and HermiT 1.3.8 [3]. Aside from the fact
that these are popular, FaCT++ and JFact were also picked because of their
similarity, in an attempt to see if that similarity would produce any change to
the MV and the results from the method. Moreover, the number of reasoners
were set to 4 to provide enough variation between reasoners, but also to include
the possibility of inducing a draw of two teams between them. Our corpus is a
snapshot of 339 BioPortal ontologies (January 2015). All experiments are
performed on a desktop computer running 4 i5-3479 CPU at 3.20 GHz with a 64
bit Ubuntu 14.04.</p>
      <p>Identifying potential ontologies: From our corpus, we ltered out those
ontologies that were merely RDFS or AL and the ones that do not fall under
1 For reliability, we let reasoners verify their own justi cations.
OWL 2 DL. For the remaining 240, we computed the inferred class hierarchy
(1 hour timeout) for all four reasoners. We excluded a further 80 ontologies,
for which there was a timeout. The inferred hierarchies were normalised using
default techniques for dealing with owl:Nothing, owl:Thing, atomic
subsumptions and equivalent classes. For the 160 ontologies that remained, the reasoners
agreed in 155 cases and disagreed in 5.</p>
      <p>Identifying and classifying problem cases: For the remaining 5 ontologies,
we generate and verify justi cations according to the method described above.
We used the OWL Explanation Framework by Horridge [5]2 to generate
explanations for each 2 D. For performance reasons, we generate only one justi cation
per reasoner per entailment.</p>
      <p>
        Each explanation is stored in .owl format allowing us to reload them to check
them against the reasoners and if needed, perform direct evaluation. For direct
evaluation cases, we generate a human readable version of the justi cation.
Testing hypotheses and generating patches: We test four hypotheses that
emerged from initial observations we will describe in more depth later: (
        <xref ref-type="bibr" rid="ref1">1</xref>
        ) The
reasoner swallows asserted axioms, (
        <xref ref-type="bibr" rid="ref2">2</xref>
        ) the reasoner does not correctly
implement the data type map (
        <xref ref-type="bibr" rid="ref3">3</xref>
        ) interdependent justi cations can be reduced to
one or more root justi cations of an entailment that can be xed by asserting
the entailment and (
        <xref ref-type="bibr" rid="ref4">4</xref>
        ) we can use the intersection of explanations to generate
"patches\ that work around a large number of bugs and point to the erroneous
behaviour.
4
      </p>
    </sec>
    <sec id="sec-4">
      <title>Results</title>
      <p>The 5 ontologies in our in-depth experiment were the Biological Collections
Ontology (BCO), the Gene Regulation Ontology (GRO), the Sysmo Jerm Ontology
of Systems Biology for Micro Organism (JERM), the Clusters of Orthologous
Groups Cog Analysis Ontology (CAO) and the Cell Culture Ontology (CCONT).</p>
      <p>Across these 5 ontologies there was one instance of total disagreement in the
Class Hierarchy and 4 partial majorities. With respect to the total disagreement,
it was found that 3 out of the 4 reasoners veri ed a justi cation for an entailment
missing from their class hierarchy. HermiT, at least for our small set, did not
exhibit any buggy behaviour. Table 1 shows for each ontology and reasoner R
and ontology O:
{ Was the reasoner part of the majority (MAJ) according to the MV method?
{ Did total disagreement (tie on Class Hierarchy level) occur? (DIS)
{ If there was an unclear entailment in D (possible bug /consistent no) involving
R, was the reasoner generating the justi cation (TIE (J )) or verifying it
(TIE (R))?
{ Was there one or more case for R which implicated a bug (BUG)?
{ Does the verdict di er from simple majority voting (d 2MV)?
2 https://github.com/matthewhorridge/owlexplanation</p>
      <p>As we can see, BCO produced at least one unclear case. According to MV,
FaCT and HermiT's inferred hierarchy would be in the majority. However
Pellet produced unclear consistent no cases, which meant that we needed further
analysis to determine which entailment was correct. Expert review showed that
Pellet in fact failed to entail something correctly, as detailed in Section 4.1. In
the case of the CAO ontology (total disagreement), we could identify clear bug
cases for all reasoners except HermiT. A MV based technique would chose the
victor randomly, which disadvantages HermiT. Reasoning over the other three
ontologies each produced a majority that we could successfully provide further
con dence for. For each, any dissenting reasoner was found to have produced a
bug case and hence missed an entailment in its overall class hierarchy.
4.1</p>
      <p>
        Analysis of Errors and Method for Patching
Of the 5336 cases generated by our method, 3718 were classed as consistent
yes, 1590 were classed as bug and 28 as consistent no. A further diagnostic
investigation was carried out on the 1618 error cases. This diagnosis found four
di erent types of problem for the reasoners. These are, (
        <xref ref-type="bibr" rid="ref1">1</xref>
        ) removal of asserted
axioms from the ontology by FaCT++ and JFact, (
        <xref ref-type="bibr" rid="ref2">2</xref>
        ) a di culty for FaCT++
and JFact to resolve type information, (
        <xref ref-type="bibr" rid="ref3">3</xref>
        ) Pellet being unable to determine a
particular subsumption relation and (
        <xref ref-type="bibr" rid="ref4">4</xref>
        ) a case of Pellet \missing" a set of strong
structurally similar justi cations. For each case we used a di erent method to
provide a diagnosis of the problem or a minimal patch to the ontology that the
developer could then use to test against. This was a prudent measure, given the
large number of cases. These techniques are naturally dependent on the nature
of the errors produced. Ideally, we would like to provide developers a tuple of
ontology, entailment, justi cation and patch that illustrate the faulty behaviour.
Axiom swallowing: FaCT++, JFact In analysis of those cases classed as
bug, it was discovered that 116 of the justi cations were of cardinality 1. Flagging
for entailments being contained in the ontology showed that the subsumption
axioms were directly asserted in the ontologies. All such cases were instances
of FaCT++ or JFact verifying a justi cation for an entailment missing in it's
inferred class hierarchy. Speci cally 100 of these cases were produced by FaCT,
16 by JFact. All JFact cases were \replicated" by FaCT++. These 116 cases are
28 particular axioms being missed by FaCT++ and JFact, with JFact missing
7.
      </p>
      <p>This suggests a pre-processing bug on the part of FaCT++ and JFact. Of
the bug cases, 1440 cases (approximately 90 %) rely upon these 28 axioms. This
suggests that the vast majority of our bug cases are down to this error.</p>
      <p>Further support for this hypothesis comes from analysis of the overall cases.
400 out of the total 5336 cases had justi cations of size 1. 4640 require these
400 cases to hold in the sample overall. This suggests that most of work was
generated by FaCT++ and JFact failing to entail the result.</p>
      <p>Data Type errors: FaCT++, JFact From the consistent no cases, we found
two justi cations produced by FaCT and JFact that asserted a particular class
was unsatis able. Direct examination showed that the class Decrease was
classi ed as unsatis able because of the speci cations of the data type.</p>
      <p>Decrease had for its data property polarity a speci ed datatype of rdf:PlainLiteral.
This was distinct from the speci ed range of the polarity datatype, which were
all xs:string. The actual possible value was correct, but the types di ered.
According to W3C speci cations on plain literals, such a substitution is allowed: rdf
plain literals should be interpreted as xs:strings [10]. Consequently, \negative"
cast as plainLiteral would be accepted as a string. This suggested that JFact and
FaCT++ had problems with particular data types. We veri ed this fact with a
pair of minimal test cases.</p>
      <p>Wrongly Missing Entailment: Pellet The 24 additional cases classed as
consistent no were all generated by Pellet asserting that a particular entailment
did not follow from a given justi cation. These cases could be collapsed into
8 unique justi cations (in-between reasoner redundancy). Interestingly, each of
these justi cations took on a similar structural form.</p>
      <p>All 8 justi cations were veri ed as correct for their entailment (expert
review). They had structural similarities and upon examination we discovered
them to have class names from each entailment also occurring in the axioms
of justi cations for all other entailments. Because of this interaction, we found
that inserting one of these missing entailments removed the disagreements and
forced Pellet to produce the same Class Hierarchy as the other reasoners. In this
case inserting IAO 109 v BF O 40 into the ontology allowed Pellet to infer the
correct Class Hierarchy and eliminate all problematic cases from the ontology.
This was as precise as we were able to point to the problematic area. Note that
this produces an O0 = O [ f g on which all reasoners agree, but where O0 is
not necessarily equivalent to O.</p>
      <p>Classi cation bugs: Pellet All bug cases generated by Pellet were found to
have justi cations of size 5 and to have entailments of the form A v CAO 323
(the RHS is a named class in the CAO). These similarities made us suspect that
the justi cations might be structurally similar and possibly share axioms.</p>
      <p>Checking the intersection of all the justi cations produced three shared
axioms, Inverse(CAO 52; CAO 59), CAO 55 v 9CAO 59:CAO 323, CAO 323
CAO 48 u 8CAO 52:CAO 171.</p>
      <p>We suspected that one of these axioms caused Pellet the di culty. We
singled out the problematic axiom with the following procedure: for a given set of
justi cations J1; :::Jn take S = Ti Ji. For each 2 S and for each reasoner
Rj infer the class hierarchy from O0 := O n . If no disagreements on the Class
Hierarchy occur then stop. We call the removal of a patch for the problem
case.</p>
      <p>The problematic axiom was singled out as CAO 55 v 9CAO 59:CAO 323.
This provided a minimal axiom that a developer can use to understand the
problematic reasoner behaviour. Note that as above, it might be that O0 6 O.
5</p>
    </sec>
    <sec id="sec-5">
      <title>Discussion</title>
      <p>One important consequence of our justi cation based method is its implications
for majority voting. In two of the cases we found reasons to suspect that the
majority (or lack of) might lead to wrong reasoners being classi ed as \correct".
Moreover, we could produce information to justify the choices picked through
our method and those cases where our method agreed with MV. The evidence
shows a clear di erence between the method stipulated and MV.</p>
      <p>A general shortcoming of this system is that it does not catch all errors
generated by the reasoners in particular those where the reasoners are all in
agreement (which is the majority of the time). A more arti cial problem is our
restriction to a single justi cation per reasoner entailment pair. This problem is
avoidable with greater computational resources.</p>
      <p>To our knowledge, there is little similar work. The JustBench benchmarking
methodology [2], veri es the justi cations being used as benchmarks by cross
checking them against all reasoners (this also emerges naturally when
benchmarking). Similar work for automated reasoners has been performed with
respect to queries [8]. The authors create test units (A-Boxes representations of
the query) to form a test base. For certain benchmark ontologies that are used
to assess reasoners, this provides a metric that evaluates the completeness of the
reasoners. Importantly they also stress the need for such methods to be invariant
or independent of the ontology being tested against.</p>
    </sec>
    <sec id="sec-6">
      <title>6 Conclusions and Future Work</title>
      <p>In this paper, we have presented a justi cation based method to reliably identify
bugs in the classi cation algorithm of OWL reasoners. Our method allows us
to narrow down possible sources of bugs, providing a starting point for reasoner
debugging. We have evaluated the method in a medium sized setting and showed
that it functions as desired. We are now currently evaluating the feasibility of
the method on a larger scale.</p>
      <p>In the future, we would like to provide the method as a web service.
Developers would be able to test their reasoners against a set of standard reasoners
and then obtain cases that pinpoint potential bugs consisting of justi cations,
missing entailments and ontology patches (that make the problem disappear).</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1. Edited by Baader F.,
          <string-name>
            <surname>Calavenese</surname>
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>McGuinness</surname>
            ,
            <given-names>D.L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Nardi</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Patel-Schneider</surname>
            ,
            <given-names>P.F.</given-names>
          </string-name>
          :
          <source>The Description Logic Handbook 2nd Edition</source>
          Cambridge University Press (
          <year>2007</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Bail</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Parsia</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          <string-name>
            <surname>Sattler</surname>
          </string-name>
          ,U.:
          <article-title>JustBench: A Framework for OWL Benchmarking</article-title>
          .
          <source>In: The Semantic Web ISWC</source>
          <year>2010</year>
          , pp.
          <volume>32</volume>
          {
          <fpage>47</fpage>
          . Springer (
          <year>2010</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Glimm</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Horrocks</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Motik</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Stoilos</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Wang</surname>
            ,
            <given-names>Z.</given-names>
          </string-name>
          :
          <article-title>HermiT: An OWL 2 Reasoner,</article-title>
          .
          <source>In: J. Autom. Reasoning</source>
          , Volume
          <volume>53</volume>
          , pp.
          <volume>245</volume>
          {
          <fpage>269</fpage>
          , (
          <year>2014</year>
          ). http://dx. doi.org/10.1007/s10817-014-9305-1.
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Gonsalves</surname>
            ,
            <given-names>R.S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bail</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Jimenez-Ruiz</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Matentzoglu</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Parsia</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Glimm</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kazakov</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          :
          <source>OWL Reasoner Evaluation (ORE) Workshop 2013 Results: Short Report. CEUR Workshop Proceedings</source>
          , ORE (
          <year>2013</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Horridge</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>Justi cation Based Explaination in Ontologies</article-title>
          . Thesis, University of Manchester (
          <year>2011</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Horridge</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bechhofer</surname>
            ,
            <given-names>S.:</given-names>
          </string-name>
          <article-title>The OWL API: A Java API for OWL ontologies</article-title>
          .
          <source>In: Semantic Web</source>
          , Volume
          <volume>2</volume>
          ,
          <string-name>
            <surname>Number</surname>
            <given-names>1</given-names>
          </string-name>
          , pp.
          <volume>11</volume>
          {
          <issue>21</issue>
          (
          <year>2011</year>
          ). http://dx.doi.org/10. 3233/SW-2011-0025
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Sirin</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Parsia</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Grau</surname>
            ,
            <given-names>B.C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kalyanpur</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          <string-name>
            <surname>Katz</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          :
          <article-title>Pellet: A practical OWLDL reasoner</article-title>
          . In: J.
          <string-name>
            <surname>Web</surname>
          </string-name>
          . Sem., Volume
          <volume>5</volume>
          ,
          <string-name>
            <surname>Number</surname>
            <given-names>2</given-names>
          </string-name>
          , pp.
          <volume>51</volume>
          {
          <fpage>53</fpage>
          , (
          <year>2007</year>
          ) http://dx. doi.org/10.1016/j.websem.
          <year>2007</year>
          .
          <volume>03</volume>
          .004,
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Stoilos</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Grau</surname>
            ,
            <given-names>B.C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Horrocks</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          :
          <article-title>How Incomplete is Your Semantic Reasoner? Systematic Analysis of the Completeness of Query Answering System</article-title>
          . In: AAAI (
          <year>2010</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Tsarkov</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          and
          <string-name>
            <surname>Horrocks</surname>
          </string-name>
          , I.:
          <article-title>FaCT++ Description Logic Reasoner</article-title>
          . In: IJCAR pp.
          <fpage>292</fpage>
          -
          <lpage>297</lpage>
          (
          <year>2006</year>
          ) http://dx.doi.org/10.1007/11814771_
          <fpage>26</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10. W3C Recommendations RDF Semantics, http://www.w3.org/TR/2004/ REC-rdf-mt-
          <volume>20040210</volume>
          /#DtypeRules
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>