<!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>Merging Ontologies via Kernel Contraction</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Raphael Cóbe</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Fillipe Resina</string-name>
          <email>fmresina@ime.usp.br</email>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Renata Wassermann</string-name>
          <email>renata@ime.usp.br</email>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Institute of Mathematics and Statistics - University of São Paulo (USP) São Paulo - SP -</institution>
          <country country="BR">Brazil</country>
        </aff>
      </contrib-group>
      <fpage>94</fpage>
      <lpage>105</lpage>
      <abstract>
        <p>Ontologies have been largely used to represent terminological knowledge, specially with the advent of the Semantic Web. As knowledge is not static, it is crucial to learn how to deal with ontology dynamics, which includes Ontology Merging and Debugging. Basically, we want to deal with the inconsistencies and incoherences that may occur when a knowledge base receives a new information or when two or more ontologies are merged. Our purpose in this work is to show some ways to extend and use the BContractor framework, originally proposed for Belief Revision, to implement operations in ontologies.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>interface for operations over belief bases. Simple due to an easily implementable
interface. Powerful because it is extensible and easily adapted.” The main contribution of this
work is to show how we extended the BContractor framework in order for it to work with
Description Logics and use it to solve the problem of Belief Revision that emerges from
Ontology Merging.</p>
      <p>Section 2 brings theoretical background about Belief Revision and Merging.
Section 3 introduces the problem of Ontology Merging and the strategies to solve it. Section 4
presents BContractor and the adaptations we developed to extend the framework in order
to make it possible to be used with Description Logics and OWL. It includes the
application in Merging and the integration with the framework. Section 5 shows a small usage
example in Ontology Merging.</p>
    </sec>
    <sec id="sec-2">
      <title>2. Belief Revision and Merging</title>
      <p>In this section, we briefly present the needed background in Belief Revision and
Merging.</p>
      <p>
        Belief Revision deals with the problem of belief dynamics. In this paper, we are
interested in the application of this theory in ontology dynamics, i.e., in
accommodating new information in a consistent way and also in removing some information from a
knowledge base. Most of the studies in this sub-field of knowledge representation are
based on the AGM paradigm, whose name derives from the initials of the authors of
the seminal paper [
        <xref ref-type="bibr" rid="ref1">Alchourrón et al. 1985</xref>
        ]. This paradigm is a theory about how highly
idealized rational agents should revise their beliefs when receiving new information.
      </p>
      <p>The epistemic state of an agent can be represented in different ways. In the AGM
paradigm the beliefs of an agent are represented by a belief set, i.e., a logically closed
set of sentences. So, if K is a belief set, K = Cn(K), where Cn is a supraclassical
consequence operator1. In addition, from that paradigm we have three main operations
regarding a belief set K and a sentence : expansion (+), contraction (-) and revision(*).
We use expansion when we want to simply add a new information to the set (K + ).
Contraction is used when we want to remove some information (K ) and revision when
we want to consistently add a new information to the agent’s epistemic state (K ).</p>
      <p>
        In terms of representation, instead of belief sets we are going to represent the
epistemic state of the agent by means of belief bases [
        <xref ref-type="bibr" rid="ref8">Hansson 1991</xref>
        ], which are sets
not necessarily closed under logical consequence. Among the advantages of using this
approach, we can cite that working with belief bases is more practical from the
computational point of view, considering that belief sets are usually infinite. Moreover, in belief
bases we distinguish explicit knowledge from inferred knowledge, exactly because of the
absence of logical closure.
      </p>
      <p>
        In belief base operations, we also work with expansion, contraction and revision.
Expansion in bases is defined as B + = B [ f g. In his paper [
        <xref ref-type="bibr" rid="ref13">Levi 1977</xref>
        ], Isaac
Levi proposed a process for obtaining the result of a revision by means of a sequence of a
contraction and an expansion. Such process became known as the Levi identity and works
1If L is a logic closed under the logic connectives (^; _; :; !), a consequence operator Cn satisfies
supraclassicality if, for any A 2 2L, if can be derived from A by classical truth-functional logic, then
2 Cn(A)
as follows: considering * as a revision function, we formally have B = (B : ) + .
Therefore, we are going to present here only one operation, contraction. For further details
about the relation between contraction and revision, see [
        <xref ref-type="bibr" rid="ref5">Gärdenfors 1988</xref>
        ].
      </p>
      <p>
        In the AGM paradigm, contraction operations are restricted by the so-called
rationality postulates. The main constructions found in the literature come equipped with
representation theorems. In this paper, we are going to focus on the constructions and
their implementation. For details on the postulates and representation results, please refer
to [
        <xref ref-type="bibr" rid="ref9">Hansson 1999</xref>
        ]. For now, it is enough to know that we want to construct operations
that, given a belief base B and a formula , return a new belief base B0 contained in B,
that does not imply and that keep as much information as possible.
      </p>
      <p>
        In the following, we present two classical constructions for contraction, partial
meet contraction [
        <xref ref-type="bibr" rid="ref1">Alchourrón et al. 1985</xref>
        ] and kernel contraction [
        <xref ref-type="bibr" rid="ref9">Hansson 1999</xref>
        ].
      </p>
    </sec>
    <sec id="sec-3">
      <title>2.1. Partial Meet Contraction</title>
      <p>
        A Partial Meet contraction [
        <xref ref-type="bibr" rid="ref1">Alchourrón et al. 1985</xref>
        ] of a base B by consists
in finding the maximal subsets of B that do not imply and take the intersection of a
selection of them. For this operation, we need to define the concept of a remainder set
(B? ):
Definition 1 (Remainder Set) [
        <xref ref-type="bibr" rid="ref1">Alchourrón et al. 1985</xref>
        ] Let B be a belief base and a
sentence. A set B0 is an element of the remainder B? if and only if it is a maximal
subset of B that does not imply :
      </p>
      <sec id="sec-3-1">
        <title>B’ is a subset of B (B0</title>
        <p>2= Cn(B0)
If B0 B00
B, then B00 `
B)</p>
        <sec id="sec-3-1-1">
          <title>An important definition is of a selection function:</title>
          <p>
            Definition 2 (Selection Function) [
            <xref ref-type="bibr" rid="ref1">Alchourrón et al. 1985</xref>
            ] Let L be a language and B a
belief base of this language. For any sentence , a selection function for B is a function
such that, for any sentence 2 L:
if B? 6= ;, then (B? ) 6= ; and (B? )
          </p>
        </sec>
      </sec>
      <sec id="sec-3-2">
        <title>BContractor: Preliminary Report</title>
        <p>if B? = ;, (B? ) = fKg
B?</p>
      </sec>
      <sec id="sec-3-3">
        <title>Ontology Merging using</title>
        <p>of B?</p>
        <p>
          Informally speaking, we have the result of the contraction choosing some elements
and taking their intersection. Formally:
Definition 3 (Partial Meet Contraction) [
          <xref ref-type="bibr" rid="ref1">Alchourrón et al. 1985</xref>
          ] Let B be a belief base,
an arbitrary sentence and a selection function. The Partial Meet contraction function
is defined as B = T (B? ).
        </p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>2.2. Kernel Contraction</title>
      <p>This construction uses a different approach to solve the problem. Here, the
construction consists in finding the minimal subsets of B that imply and, then, remove at
least one element from each of these subsets. The set of these minimal subsets is called
the kernel of B by , represented as B ?? .</p>
      <sec id="sec-4-1">
        <title>Definition 4 (Kernel Set) [Hansson 1999] Let B be a belief base and a sentence. A set</title>
        <p>B0 is an element of the kernel B ?? if and only if it is a minimal subset of B that implies
:</p>
      </sec>
      <sec id="sec-4-2">
        <title>B’ is a subset of B (B0</title>
        <p>2 Cn(B0)
If B00 B0</p>
        <p>B, then B00 0</p>
        <p>B)</p>
        <p>
          An incision function selects at least one element of each kernel to be removed:
Definition 5 (Incision Function) [
          <xref ref-type="bibr" rid="ref9">Hansson 1999</xref>
          ] Let B be a belief base. For any sentence
, an incision function for B is a function such that:
        </p>
        <p>(B ?? ) S(B ?? ) and
if ; =6 X 2 B ?? then X \
(B ??</p>
        <p>) 6= ;</p>
        <p>A kernel contraction is then defined as removing from the belief base those
elements from the kernels selected by the incision function:</p>
      </sec>
      <sec id="sec-4-3">
        <title>Definition 6 [Hansson 1999] Let B be a belief base,</title>
        <p>tence. The Kernel contraction function is defined as B
an incision function and
= Bn (B ?? )
a
sen</p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>2.3. Belief Merging and Conflict Resolution</title>
      <p>
        A close related area to Belief Revision is the area of Belief Merging, where instead
of adding a single piece of information to a belief base, two (or more) belief bases are
combined. In an operation of revision, the incoming information has higher priority over
the existing belief base, while in Merging, usually the two belief bases being merged have
equal priority. So the areas of Belief Revision and Merging walk hand-in-hand, sharing a
large amount of activities to be carried out during the operators executions. For a review
on Belief Merging, please refer to [
        <xref ref-type="bibr" rid="ref12">Konieczny and Pérez 2011</xref>
        ].
      </p>
      <p>A Merging operator can also be obtained by first joining the two belief bases
involved and then solving the conflicts that arise in case the bases are inconsistent. With a
slight adaptation, the concepts of remainders and kernels can be used to construct Merging
operators. In this paper, we will consider a construction that is based on finding the
minimal inconsistent subsets of the joined bases (kernels) and removing at least one element
of each.</p>
    </sec>
    <sec id="sec-6">
      <title>3. Ontology Merging</title>
      <p>
        When presenting our quick overview of belief revision, we did not
specify the logical language used. In fact, the original paper on the AGM paradigm
[
        <xref ref-type="bibr" rid="ref1">Alchourrón et al. 1985</xref>
        ] does not require a particular logic. Nevertheless, several
assumptions are made on the underlying logic, such as supraclassicality, which prevents
the paradigm from being directly applicable to several useful logics, such as Description
Logics [
        <xref ref-type="bibr" rid="ref2">Baader et al. 2003</xref>
        ].
      </p>
      <p>Ontologies describe individuals, classes, attributes of these classes and
relationships between them. The OWL language2, a W3C recommendation since 2004 for
representing ontologies, is based on Description Logics - DL. DLs are subsets of First Order
Logic, have a well defined semantics and are usually decidable.</p>
      <p>As we can see, if we intend to work with knowledge representation, we should
consider these languages for describing ontologies. Nonetheless, in many applications it
is not enough to represent knowledge; we should also be able to change it and deal with
its dynamics.</p>
      <p>
        There have been several proposals to apply belief revision for ontologies in OWL
and DL, such as [
        <xref ref-type="bibr" rid="ref11">Kalyanpur 2006</xref>
        ,
        <xref ref-type="bibr" rid="ref20">Ribeiro 2013</xref>
        ]. In this paper, we turn to the problem
of applying merging operators to combine ontologies and providing an implementation
based on BContractor.
      </p>
      <p>
        As mentioned in the Introduction, the integration of multiple knowledge sources
will, eventually, result in conflicting knowledge being joined together in a single base.
This kind of problem may compromise the integrity and reliability of a knowledge base.
When dealing with the integration of ontologies, it is important to distinguish
inconsistency from incoherence. An ontological knowledge base is usually divided in two parts:
the ABox, containing assertional knowledge about individuals, and the TBox, containing
terminological knowledge about concepts and properties. An ontology is considered
inconsistent if and only if there is no interpretation that could satisfy all the axioms of the
base [
        <xref ref-type="bibr" rid="ref6">Haase et al. 2005</xref>
        ]. This kind of problem typically arises with assertional
knowledge, i.e., the ABox. A knowledge base is considered incoherent if and only if there is a
concept C such that, for all possible models for the knowledge base, C has an empty
interpretation [
        <xref ref-type="bibr" rid="ref18">Qi and Pan 2007</xref>
        ]. This kind of problem typically arises with terminological
knowledge, i.e., the TBox.
      </p>
      <p>
        Several activities play important roles during the process of inconsistency solving.
In [
        <xref ref-type="bibr" rid="ref4">Cobe and Wassermann 2012</xref>
        ] the authors group the most common activities developed
during the resolution of a conflict into the following phases:
      </p>
    </sec>
    <sec id="sec-7">
      <title>3.1. Kernel Building</title>
      <p>
        The goal of this phase is to build minimal, conflict keeping sub-ontologies, which
is closely related to the idea of kernel, i.e., S is a kernel of the
inconsistent/incoherent ontology O iff: S is a subset of O, S is inconsistent/incoherent and there is no
proper subset of S that is inconsistent/incoherent. We used the same designation as
[
        <xref ref-type="bibr" rid="ref11">Kalyanpur 2006</xref>
        ,
        <xref ref-type="bibr" rid="ref23">Wassermann 1999</xref>
        ]. The concept of kernel is similar to the Minimal
Incoherence Preserving Sub-Ontologies (MIPS) and Minimally Unsatisfiability Preserving
Sub-TBoxes (MUPS) [
        <xref ref-type="bibr" rid="ref21">Schlobach 2005</xref>
        ,
        <xref ref-type="bibr" rid="ref6">Haase et al. 2005</xref>
        ]. In a typical ontology merging
scenario, the user might have to examine each kernel at a time, probably using different
strategies to deal with each inconsistency/incoherence.
      </p>
    </sec>
    <sec id="sec-8">
      <title>3.2. Stratification</title>
      <p>
        During this phase, the axioms in the chosen kernel are ordered according to some
principle - the number of axioms that share concepts and individuals, for instance. We
chose to use the same denomination presented in [
        <xref ref-type="bibr" rid="ref18">Qi and Pan 2007</xref>
        ,
        <xref ref-type="bibr" rid="ref16">Meyer et al. 2005</xref>
        ].
The goal of this phase is similar to the one of the incision functions presented earlier,
which also rank axioms according to some criteria. The main difference is that
stratification defines strategies to order axioms possibly from one single kernel and incision
functions take as input all possible kernels, thus, we can think of incision functions as
being composed by stratification strategies - responsible for ordering axioms - and a
selection function - which removes the least preferred axiom from every stratified kernel.
      </p>
      <p>
        The stratification phase can be carried out manually by domain experts
[
        <xref ref-type="bibr" rid="ref7">Haase and Volker 2008</xref>
        ,
        <xref ref-type="bibr" rid="ref19">Ribeiro and Wassermann 2008</xref>
        ], or by automatic means. Now,
we are going to enumerate a couple of the most common approaches for stratification.
      </p>
      <p>
        Specific Axiom Prioritization has been proposed by
        <xref ref-type="bibr" rid="ref18">Qi et al. in [Qi and Pan 2007</xref>
        ]
and its main idea, taken from [
        <xref ref-type="bibr" rid="ref3">Benferhat 2003</xref>
        ], aims to preserve the axioms that describe
more general concepts, or more formally: an axiom 1 = C1 v D1 is more specific than
the axiom 2 = C2 v D2 if and only if C1 v C2 and C2 6v C1.
      </p>
      <p>
        <xref ref-type="bibr" rid="ref11">Kalyanpur, in [Kalyanpur 2006</xref>
        ] also proposed a few algorithms for axiom
ranking:
      </p>
      <p>Order by frequency: which orders by the number of kernels in which the axiom
appears;
Order by semantic relevance: which orders by the number or entailments that are
lost or added if the axiom is removed; and
Order by syntactic relevance: which orders the number of axioms that share the
concepts with the axiom being ranked.</p>
      <p>All of these strategies are also good candidates for composing incision functions.
We implemented some of these approaches using the BContractor framework (see Section
4 below).</p>
    </sec>
    <sec id="sec-9">
      <title>3.3. Axiom Weakening</title>
      <p>The activities in this phase try to solve the inconsistencies (not incoherences) by
modifying the axioms, weakening their restriction power. This phase is not shared with
Belief Revision. When we allow the operator to weaken the formula in order to keep
consistency we can no longer guarantee that the formula will be in the resulting knowledge
base. This phase is still very useful in cases when the user wants to maintain most of
the information in a knowledge base and he/she does not care if the information in the
knowledge base is slightly different from before the merging. The goal here is to avoid
discarding whole axioms. In what follows, we list some of the main strategies found in
the literature.</p>
      <p>
        The first strategy we would like to point is the exception adding, described in
[
        <xref ref-type="bibr" rid="ref17">Qi et al. 2006</xref>
        ]. The idea consists in transforming inconsistent kernels of the form K =
fC v D, C(a) u :D(a)g into K0 = f(C u :fag) v D, C(a) u :D(a)g.
      </p>
      <p>
        In [
        <xref ref-type="bibr" rid="ref4">Cobe and Wassermann 2012</xref>
        ], the authors proposed a new way of weakening
cardinality restrictions. The idea is to iteratively change the value of n in the nP axiom,
where n is a number and P a property. They designed a weakening operator that takes all
possible minimally inconsistent sets and tries to fix the largest number of inconsistencies
by changing the n value. The algorithm proposed needs to check all kernel set because if
the inconsistency is fixed in one specific kernel it may be the case that when the ontology
is put together, the inconsistency will appear again.
      </p>
      <p>The authors showed that, in this case, an approach closer to believe revision may
be better suiting, where an incision function, used to choose which axioms would be
weakened - instead of removed -, is composed by a single stratification strategy and is
able to select the axioms involved in the conflict which may be more than one axiom from
each kernel.</p>
    </sec>
    <sec id="sec-10">
      <title>3.4. Axiom Removal</title>
      <p>
        This phase aims to remove the axiom with the lowest priority (or trustability) in
the kernel in which the user is working to solve the conflict. This approach is used in most
of the works on ontology debugging [
        <xref ref-type="bibr" rid="ref22">Schlobach et al. 2007</xref>
        ,
        <xref ref-type="bibr" rid="ref21">Schlobach 2005</xref>
        ] and Belief
Revision in DL [
        <xref ref-type="bibr" rid="ref20">Ribeiro 2013</xref>
        ].
      </p>
    </sec>
    <sec id="sec-11">
      <title>4. BContractor-DL</title>
      <p>
        After some decades of research and study in Belief Revision, we have many results
available in the literature, including comparisons between the different possible operators.
Nevertheless, there is still a gap when we consider software tools to work with these
operators or computational resources analysis. There are some implementations of Belief
Revision operators available. As examples, we can cite BReLS [
        <xref ref-type="bibr" rid="ref14">Liberatore 1999</xref>
        ] and
Saten [
        <xref ref-type="bibr" rid="ref24">Williams and Sims 2000</xref>
        ]. However, they focus on a specific logic or construction.
      </p>
      <p>
        Considering this scenario, the BContractor [
        <xref ref-type="bibr" rid="ref15">Lundberg et al. 2012</xref>
        ] was recently
released with the purpose of being a more flexible framework for implementing and
testing Belief Change operators. One of its main purposes is the possibility of extending it
to implement and test operators for different kinds of logic, although so far it has been
tested only for Propositional Logic, considering that most work on Belief Revision theory
is based on that logic. Still, much effort is being applied to adapt such theory to other
logics. Following this purpose, we describe in this section the extensions that we have
made to the BContractor in order for it to support DL knowledge bases.
      </p>
      <p>
        This implementation is restricted to the SROIQ DL [
        <xref ref-type="bibr" rid="ref10">Horrocks et al. 2006</xref>
        ] due
to the fact that this DL family is the one that underpins OWL2, which is the language
supported by most of the reasoners, including HermiT3, the one we used. For more expressive
DLs, one should use a language more expressive than OWL2 and another reasoner to
support it.
      </p>
      <p>
        The first inclusion was a new component that was needed to calculate kernels from
inconsistent knowledge bases. We needed to do that because we are dealing with DL, and
as presented in [
        <xref ref-type="bibr" rid="ref20">Ribeiro 2013</xref>
        ], in several DLs the negation of an axiom is not defined.
So, in order to avoid the usage of negation, instead of revision we rely on the operation
of semi-revision presented in [
        <xref ref-type="bibr" rid="ref9">Hansson 1999</xref>
        ] and also used in [
        <xref ref-type="bibr" rid="ref20">Ribeiro 2013</xref>
        ]. The idea
is to insert in the knowledge base and then contract it by the inconsistency.
      </p>
      <p>The new component defined was a new version of the BContractor
KernelOperator, the KernelConflictOperator, which is able to compute kernels from
inconsistent/incoherent knowledge bases. The main difference between the two is that in
KernelConflictOperator we are able to compute kernels from a knowledge base instead of a knowledge
base plus an axiom. These two components only define interfaces and in order to use
them, one need to give concrete implementations. We implemented a concrete version of
the KernelConflictOperator in the BlackBoxKernelOperator, so now it is also able to use
the eval operation on a knowledge base, instead of a pair.</p>
      <p>
        After that, we have built the ground for the definition of Revision operators. We
developed the InternalKernelRevisionWithoutNegation component, which uses an
incision function and a KernelConflictOperator. Then it builds a new knowledge base from
the execution of the incision function in the kernels built by the KernelConflictOperator.
We use an Internal Revision technique [
        <xref ref-type="bibr" rid="ref20">Ribeiro 2013</xref>
        ] in which first we open room for
the new piece of knowledge, and then we really add it. The operator behaves as follows:
first it calculates the kernels for the knowledge base union , then it executes the incision
function. After that it removes the result of the incision function from the knowledge base
and finally it adds to the knowledge base.
      </p>
      <p>The usage of the BContractor made it really easy to code a new revision operator
as shown in Listing 1.</p>
      <p>Listing 1. InternalKernelRevisionWithoutNegation Revision Operator
1 I S e t &lt;S&gt; r e v i s e ( I S e t &lt;S&gt; b a s e , S a l p h a ) {
2 r e t u r n b a s e . minus ( i n c i s i o n ( k e r n e l ( b a s e . u n i o n ( a l p h a ) ) ) ) . u n i o n ( a l p h a ) ;
3 }</p>
      <p>In Listing 1 the kernel operation uses the BlackBoxKernelOperator to build the
kernel set from the union of the knowledge base with alpha, then the incision function
takes place and calculates a cutting set - a set that contains at least one element of each
kernel in the kernel set. After that we can be sure that we removed at least a single element
from each kernel breaking their minimality principle, thus restoring their consistency. The
result of the incision function is removed from the base with the minus operation and only
after “making room for alpha” is that we include it with the union operation.</p>
      <p>
        In addition to that, we have developed two incision functions. The first function
prioritizes removing the elements that appear in the largest number of kernels. This
function was described by
        <xref ref-type="bibr" rid="ref11">Kalyanpur in [Kalyanpur 2006</xref>
        ] and is very useful when we try to
keep as much information as possible. So we do not remove a separate axiom from each
kernel. In this way we do not remove more axioms than we need to, e.g., consider the
following kernel set: K = ffC v D,C(a) u :D(a)g; fC v D,C(b) u :D(b)gg. By
applying this incision function the resulting cutting set would be: K0 = fC v Dg. The
implemented component is called MostFrequentFirstIncisionFunction.
      </p>
      <p>
        We have also developed the operator proposed by
        <xref ref-type="bibr" rid="ref18">Qi et al in [Qi and Pan 2007</xref>
        ],
MostSpecificFirstIncisionFunction, that keeps the most general axioms in the knowledge
base, e.g., consider the following kernel set: K = ffC v :D, C v F , F v Dgg. By
applying this incision function the resulting cutting set would be K0 = fC v :Dg4.
      </p>
      <p>The usage of these operators is simple, the user has to pass them to the Revision
Operator being used and call the revise operation. In order to use incision functions in
a stand-alone way, the user needs to instantiate them and pass the kernel set to their eval
functions.</p>
      <p>As this paper presents an ongoing work the study of the properties of the incision
functions developed will be done in the future.</p>
      <p>For the Belief Merging case, we developed a new type of operator, the
MergeOperator, which has a single operation, merge, that receives two knowledge bases and
produces a new one as output.</p>
      <p>4Another possible cutting set would be K00 = fC v F g. The BContractor-DL chooses only one of the
possibilities - the first one.</p>
      <p>We have implemented the new idea of StratificationOperator which aims to order
the kernels according to some specific criteria and also the WeakenOperator that builds
weaker versions of the kernels in order to restore their consistency. We then developed
two stratification operators, the FrequencyStratificationOperator and the
GeneralityStratificationOperator that use the same ideas from the revision incision functions:
MostFrequentFirstIncisionFunction and MostSpecificFirstIncisionFunction respectively.</p>
      <p>
        We have also defined a weakening operator named
NumberedRestrictionWeakenOperator that uses the idea described in Section 3.3. When the authors presented this
approach in [
        <xref ref-type="bibr" rid="ref4">Cobe and Wassermann 2012</xref>
        ] they showed that in order to use this wakening
strategy we needed a incision function that selects maybe more than one single element
from each kernel in the kernel set, e.g., suppose we have the following inconsistent
ontology: O = fC v 1P , a2 6= a3, a2 6= a4, a3 6= a4 C(a1), P (a1; a3), P (a1; a2),P (a1; a4)g.
Calculating its kernel set we obtain K = ffC v 1,C(a1), a2 6= a3, P (a1; a2),
P (a1; a3)g, fC v 1,C(a1), a2 6= a4, P (a1; a2), P (a1; a4)g, fC v 1,C(a1), a3 6= a4,
P (a1; a3), P (a1; a4)gg. A Numbered Restriction Incision function would return the
following cutting set K0 = ffC v 1, P (a1; a3), P (a1; a2), P (a1; a4)g. For this matter we
developed the NumberedRestrictionIncisionFunction.
      </p>
      <p>So, with all these, we have built the ground for the definition of the first merging
operator using BContractor, which is defined as the build of a new base from the
weakening of the stratified base built from the kernels of the union of the two bases being merged.
Using the design ideas from the BContractor, the code for doing so is still human-readable
and easy to redefine:</p>
      <p>Listing 2. Merge Operator
1 I S e t &lt;S&gt; merge ( I S e t &lt;S&gt; base1 , I S e t &lt;S&gt; b a s e 2 ) {
2 K e r n e l &lt;S&gt; k e r n e l S e t = k e r n e l ( b a s e 1 . u n i o n ( b a s e 2 ) ) ;
3 S t r a t a &lt;S&gt; s t r a t i f i e d K e r n e l S e t = s t r a t i f y ( k e r n e l S e t ) ;
4 I S e t &lt;S&gt; c u t t i n g S e t T o W e a k e n = w e a k e n I n c i s i o n ( s t r a t i f i e d K e r n e l S e t ) ;
5 I S e t &lt;S&gt; w e a k e n e d S e t = weaken ( c u t t i n g S e t T o W e a k e n ) ;
6 i f ( r e a s o n e r . i s C o n s i s t e n t ( b a s e 1 . u n i o n ( b a s e 2 ) . minus (
7 c u t t i n g S e t T o W e a k e n ) . u n i o n ( w e a k e n e d S e t ) ) ) {
8 r e t u r n b a s e 1 . u n i o n ( b a s e 2 ) . minus ( c u t t i n g S e t T o W e a k e n ) .
9 u n i o n ( w e a k e n e d S e t ) ;
10 }
11 e l s e {
12 r e t u r n b a s e 1 . u n i o n ( b a s e 2 ) . minus ( i n c i s i o n ( s t r a t i f i e d K e r n e l s ) ) ;
13 }
14 }</p>
      <p>
        The code listed first builds the kernelSet of the union of the two bases (line 2), after
that, as explained in [
        <xref ref-type="bibr" rid="ref4">Cobe and Wassermann 2012</xref>
        ] we need to use a Most Frequent First
[
        <xref ref-type="bibr" rid="ref11">Kalyanpur 2006</xref>
        ] strategy to stratify the base. This causes the nP axioms to appear
first in the kernel inside the kernel set. This step is important so the
NumberedRestrictionIncisionFunction knows that all kernels contain the same nP axiom and that that is
the axiom to be weakened. After that we use the NumberedRestrictionIncisionFunction
to select the elements from the kernel set that are going to be weakened. Although only
one axiom will be weakened by the WeakenOperator, the
NumberedRestrictionIncisionFunction includes the property assertions that will be used to calculate the new n value,
that will be the amount of property assertions.
      </p>
      <sec id="sec-11-1">
        <title>The NumberedRestrictionWeakenOperator is called by the weaken function,</title>
        <p>building a weakened version of the axioms selected by the
NumberedRestrictionIncisionFunction. After that the MergeOperator verifies if the consistency was restored. If that
is the case, then it removes the elements selected by the
NumberedRestrictionIncisionFunction from the base and add their weakened version built by the
NumberedRestrictionWeakenOperator.</p>
        <p>In the worst case scenario, if that does not restore consistency, the MergeOperator
calculates another cutting set, using a second incision function and removes those axioms
from the base, restoring the consistency. The second incision function is needed because
it probably will select less elements than the one used for axiom weakening.</p>
      </sec>
    </sec>
    <sec id="sec-12">
      <title>5. Usage Example</title>
      <p>In this section we are going to describe a small example that aims to show how
the user could interact with the framework and how it can be used to restore
consistency/coherence in ontologies being merged. The example is very restrict due to lack of
space.</p>
      <p>Suppose that we have the following ontologies O1 and O2 composed by the
axioms5:</p>
      <p>O1 :
2 = F v
1 = E v F ,</p>
      <p>1P ,
3 = E(a1),
4 = a2 6= a3,
5 = a2 6= a4,
6 = a3 6= a4,</p>
      <p>O2 :
7 = a2 6= a3,
8 = a2 6= a4,
9 = a3 6= a4,
10 = P (a1; a2),
11 = P (a1; a3),
12 = P (a1; a4)</p>
      <p>The resulting ontology from the union of O1 and O2, O = f 1, 2, 3, 7, 8,
9, 10, 11 12g, is inconsistent, due to the fact that the individual a1 relates to more
than 1 other individual by means of the P property, while the axiom 2 explicitly says the
opposite.</p>
      <p>We define the following approach of solving inconsistency after joining the
ontologies: we will define a new MergeOperator that uses a BlackBoxKernelOperator, a</p>
      <sec id="sec-12-1">
        <title>FrequencyStratificationOperator for stratification, a NumberedRestrictionIncisionFunc</title>
        <p>tion for selecting axioms to be weakened and a NumberedRestrictionWeakenOperator as
a weakening operator.</p>
        <p>The kernel building operator produces the following kernels, K1 = f 1, 2, 7,
3, 10, 11g, K2 = f 1, 2, 8, 3, 10, 12g and K3 = f 1, 2, 9, 3, 11, 12g.</p>
        <p>When the FrequencyStratificationOperator is executed on the kernels obtained
previously, it results in the following stratified kernels K10 = f 1, 2, 3, 10, 11, 7g,
K20 = f 1, 2, 3, 10, 12, 8g and K30 = f 1, 2, 3, 11, 12, 9g. The calculated
frequency for axioms was 3 for 1, 2, 3, 2 for 10, 11, 12 and 1 for 7, 8, 9.</p>
        <sec id="sec-12-1-1">
          <title>5Note that axioms 4, 5, 6 are the same as 7, 8, 9.</title>
          <p>The NumberedRestrictionIncisionFunction then calculates the cutting set CS =
f 1, 10, 11, and 12g that can be used to feed the NumberedRestrictionWeakenOperator.
The weakening operator execution results in the modification of the axiom 2 into the
axiom 02 = F v 3P that is used to update the union of the O1 and O2 ontologies. Just
to give an idea of the syntax, the output of the weakening process is at follows:
ClassAssertion(&lt;#E&gt; &lt;#a1&gt;)
SubClassOf(&lt;#F&gt; ObjectMaxCardinality(3 &lt;#P&gt; owl:Thing))
SubClassOf(&lt;#E&gt; &lt;#F&gt;)
DifferentIndividuals(&lt;#a2&gt; &lt;#a3&gt; )
DifferentIndividuals(&lt;#a3&gt; &lt;#a4&gt; )
DifferentIndividuals(&lt;#a2&gt; &lt;#a4&gt; )
ObjectPropertyAssertion(&lt;#P&gt; &lt;#a1&gt; &lt;#a4&gt;)
ObjectPropertyAssertion(&lt;#P&gt; &lt;#a1&gt; &lt;#a3&gt;)
ObjectPropertyAssertion(&lt;#P&gt; &lt;#a1&gt; &lt;#a2&gt;)</p>
        </sec>
      </sec>
    </sec>
    <sec id="sec-13">
      <title>6. Conclusion</title>
      <p>In this paper we showed an extension of the BContractor framework in order to:
(a) apply it to Description Logics and (b) implement Merging operators. The extension
shows that BContractor is indeed independent of the underlying logics and that it is easily
extensible to implement different Belief Change operators, as promised on its release. It
permits re-usability of code and more modularized and organized software applications.</p>
      <p>
        The code for the extension of BContractor is freely available at http://www.
ime.usp.br/~rmcobe/OntologyMerging/. We have also integrated the
extension with the Protégé6 revision plugin first described in [
        <xref ref-type="bibr" rid="ref19">Ribeiro and Wassermann 2008</xref>
        ]
and available at https://code.google.com/p/review-and-contract/.
      </p>
      <p>Future work includes the implementation of the Ontology Merging operators as
parts of the Protégé plug-in and empirically testing the different merging strategies on
benchmark ontologies. We also plan to study the formal properties of the incision
functions implemented and described in Section 4.</p>
      <p>Acknowledgments The first and the second authors are supported by the São Paulo
Research Foundation (FAPESP), grant numbers 2008/10498-8 and 2011/04477-0,
respectively. The third author is partially supported by CNPq, grant number 304043/2010-9.
This research is part of FAPESP project OnAIR 2010/19111-9.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          <string-name>
            <surname>Alchourrón</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gardenfors</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Makinson</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          (
          <year>1985</year>
          ).
          <article-title>On the logic of theory change</article-title>
          .
          <source>Journal of Symbolic Logic</source>
          ,
          <volume>50</volume>
          (
          <issue>02</issue>
          ):
          <fpage>510</fpage>
          -
          <lpage>530</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          <string-name>
            <surname>Baader</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Calvanese</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>McGuinness</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Nardi</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Patel-Schneider</surname>
          </string-name>
          , P., editors (
          <year>2003</year>
          ).
          <article-title>The Description Logic Handbook</article-title>
          . Cambridge University Press.
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          <string-name>
            <surname>Benferhat</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          (
          <year>2003</year>
          ).
          <article-title>A stratification-based approach for handling conflicts in access control</article-title>
          .
          <source>In SACMAT'03</source>
          , pages
          <fpage>189</fpage>
          -
          <lpage>195</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          <string-name>
            <surname>Cobe</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          and
          <string-name>
            <surname>Wassermann</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          (
          <year>2012</year>
          ).
          <article-title>Ontology merging and conflict resolution</article-title>
          . In Workshop on Belief Change,
          <article-title>Non-monotonic Reasoning and Conflict Resolution (BNC). 6Protégé is a free and open-source ontology editor, serving as a framework for knowledge bases</article-title>
          . It was developed by Stanford University, also receiving collaboration from the University of Manchester.
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          <string-name>
            <surname>Gärdenfors</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          (
          <year>1988</year>
          ).
          <article-title>Knowledge in Flux - Modeling the Dynamics of Epstemic States</article-title>
          . MIT Press.
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          <string-name>
            <surname>Haase</surname>
          </string-name>
          , P.,
          <string-name>
            <surname>van Harmelen</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Huang</surname>
            ,
            <given-names>Z.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Stuckenschmidt</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Sure</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          (
          <year>2005</year>
          ).
          <article-title>A framework for handling inconsistency in changing ontologies</article-title>
          .
          <source>In ISWC' 05</source>
          , pages
          <fpage>353</fpage>
          -
          <lpage>367</lpage>
          . Springer.
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          <string-name>
            <surname>Haase</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          and
          <string-name>
            <surname>Volker</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          (
          <year>2008</year>
          ).
          <article-title>Ontology learning and reasoning - dealing with uncertainty and inconsistency</article-title>
          .
          <source>In Uncertainty Reasoning for the Semantic Web I,</source>
          volume
          <volume>5327</volume>
          <source>of LNCS</source>
          , pages
          <fpage>366</fpage>
          -
          <lpage>384</lpage>
          . Springer.
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          <string-name>
            <surname>Hansson</surname>
            ,
            <given-names>S. O.</given-names>
          </string-name>
          (
          <year>1991</year>
          ).
          <article-title>Belief Base Dynamics</article-title>
          .
          <source>PhD thesis</source>
          , Uppsala University, Suécia.
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          <string-name>
            <surname>Hansson</surname>
            ,
            <given-names>S. O.</given-names>
          </string-name>
          (
          <year>1999</year>
          ).
          <article-title>A Textbook of Belief Dynamics</article-title>
          . Kluwer Academic Publishers, Norwell, MA, USA.
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          <string-name>
            <surname>Horrocks</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kutz</surname>
            ,
            <given-names>O.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Sattler</surname>
            ,
            <given-names>U.</given-names>
          </string-name>
          (
          <year>2006</year>
          ).
          <article-title>The even more irresistible sroiq</article-title>
          .
          <source>In KR</source>
          , pages
          <fpage>57</fpage>
          -
          <lpage>67</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          <string-name>
            <surname>Kalyanpur</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          (
          <year>2006</year>
          ).
          <article-title>Debugging and repair of owl ontologies</article-title>
          .
          <source>PhD thesis</source>
          , University of Maryland, College Park, MD, USA.
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          <string-name>
            <surname>Konieczny</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          and
          <string-name>
            <surname>Pérez</surname>
            ,
            <given-names>R. P.</given-names>
          </string-name>
          (
          <year>2011</year>
          ).
          <article-title>Logic based merging</article-title>
          .
          <source>Journal of Philosophical Logic</source>
          ,
          <volume>40</volume>
          (
          <issue>2</issue>
          ):
          <fpage>239</fpage>
          -
          <lpage>270</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          <string-name>
            <surname>Levi</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          (
          <year>1977</year>
          ).
          <article-title>Subjunctives, dispositions and chances</article-title>
          .
          <source>Synthese</source>
          ,
          <volume>34</volume>
          (
          <issue>4</issue>
          ):
          <fpage>423</fpage>
          -
          <lpage>455</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          <string-name>
            <surname>Liberatore</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          (
          <year>1999</year>
          ).
          <article-title>BReLS: a system for revising, updating, and merging knowledge bases</article-title>
          .
          <source>In Proceedings of NRAC.</source>
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          <string-name>
            <surname>Lundberg</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ribeiro</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Wassermann</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          (
          <year>2012</year>
          ).
          <article-title>A framework for empirical evaluation of belief change operators</article-title>
          .
          <source>In SBIA 2012, LNAI 7589</source>
          , pages
          <fpage>12</fpage>
          -
          <lpage>21</lpage>
          . Springer.
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          <string-name>
            <surname>Meyer</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lee</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Booth</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          (
          <year>2005</year>
          ).
          <article-title>Knowledge integration for description logics</article-title>
          .
          <source>In AAAI'05</source>
          , pages
          <fpage>645</fpage>
          -
          <lpage>650</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          <string-name>
            <surname>Qi</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Liu</surname>
            ,
            <given-names>W.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Bell</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          (
          <year>2006</year>
          ).
          <article-title>A revision-based approach to handling inconsistency in description logics</article-title>
          .
          <source>Artif. Intell. Rev.</source>
          ,
          <volume>26</volume>
          :
          <fpage>115</fpage>
          -
          <lpage>128</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          <string-name>
            <surname>Qi</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          and
          <string-name>
            <surname>Pan</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          (
          <year>2007</year>
          ).
          <article-title>A stratification-based approach for inconsistency handling in description logics</article-title>
          .
          <source>In IWOD'07</source>
          ,
          <string-name>
            <surname>page</surname>
            <given-names>83</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Innsbruck</surname>
          </string-name>
          .
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          <string-name>
            <surname>Ribeiro</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          and
          <string-name>
            <surname>Wassermann</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          (
          <year>2008</year>
          ).
          <article-title>The ontology revisor plug-in for Protégé</article-title>
          .
          <source>In WONTO.</source>
        </mixed-citation>
      </ref>
      <ref id="ref20">
        <mixed-citation>
          <string-name>
            <surname>Ribeiro</surname>
            ,
            <given-names>M. M.</given-names>
          </string-name>
          (
          <year>2013</year>
          ).
          <article-title>Belief Revision in Non-Classical Logics, volume XI of Springerbriefs in Computer Science</article-title>
          . Springer.
        </mixed-citation>
      </ref>
      <ref id="ref21">
        <mixed-citation>
          <string-name>
            <surname>Schlobach</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          (
          <year>2005</year>
          ).
          <article-title>Debugging and semantic clarification by pinpointing</article-title>
          .
          <source>In The Semantic Web: Research and Applications</source>
          , LNCS, pages
          <fpage>27</fpage>
          -
          <lpage>44</lpage>
          . Springer.
        </mixed-citation>
      </ref>
      <ref id="ref22">
        <mixed-citation>
          <string-name>
            <surname>Schlobach</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Huang</surname>
            ,
            <given-names>Z.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Cornet</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          , and van Harmelen,
          <string-name>
            <surname>F.</surname>
          </string-name>
          (
          <year>2007</year>
          ).
          <article-title>Debugging incoherent terminologies</article-title>
          .
          <source>Journal of Automated Reasoning</source>
          ,
          <volume>39</volume>
          :
          <fpage>317</fpage>
          -
          <lpage>349</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref23">
        <mixed-citation>
          <string-name>
            <surname>Wassermann</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          (
          <year>1999</year>
          ).
          <article-title>Resource-Bounded Belief Revision</article-title>
          .
          <source>PhD thesis</source>
          , Universiteit van Amsterdam.
        </mixed-citation>
      </ref>
      <ref id="ref24">
        <mixed-citation>
          <string-name>
            <surname>Williams</surname>
            ,
            <given-names>M.-A.</given-names>
          </string-name>
          and
          <string-name>
            <surname>Sims</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          (
          <year>2000</year>
          ).
          <article-title>Saten: An object-oriented web-based revision and extraction engine</article-title>
          .
          <source>CoRR</source>
          , cs.
          <source>AI/0003059.</source>
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>