<!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>Modelling Structured Domains Using Description Graphs and Logic Programming?</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Despoina Magka</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Boris Motik</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Ian Horrocks</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Department of Computer Science, University of Oxford</institution>
          <addr-line>Wolfson Building, Parks Road, OX1 3QD</addr-line>
          ,
          <country country="UK">UK</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>OWL 21 is commonly used to represent objects with complex structure, such as complex assemblies in engineering applications [5], human anatomy [13], or the structure of chemical molecules [7]. In order to ground our discussion, we next present a concrete application of the latter kind; however, the problems and the solution that we identify apply to numerous similar scenarios. The European Bioinformatics Institute (EBI) has developed the ChEBI2 ontologya public dictionary of molecular entities used to enhance interoperability of applications supporting tasks such as drug discovery. In order to automate the classification of molecular entities, ChEBI descriptions were translated into OWL and then classified using automated reasoning. However, this approach was hindered by the fundamental inability of OWL to precisely represent the structure of complex molecular entities, as the tree-model property of OWL prevents one from describing non-tree-like relationships using schema axioms. For example, OWL axioms can state that butane molecules have four carbon atoms, but they cannot state that the four atoms in a cyclobutane molecule are arranged in a ring. Please note that this applies to schema descriptions only: the structure of a particular cyclobutane molecule can be represented using class and property assertions, but the general definition of all cyclobutane molecules-a problem that terminologies such as ChEBI aim to solve-cannot be fully described in OWL. As we show in Section 3, an ontology may therefore fail to entail certain desired consequences. A common solution to this problem is to extend OWL 2 with a rule-based formalism such as SWRL;3 however, this either results in undecidability [9] or requires restrictions in the shape of the rules [8], which typically prevent the rules from axiomatising the required structures. An alternative approach suggests a combination of OWL 2, rules, and description graphs (DGs) [12]-a graphical notation for describing non-tree-like structures. Decidability of reasoning is ensured via a property separation condition and by requiring DGs to be acyclic. Intuitively, the latter means that DGs can describe structures of arbitrary shape, but bounded in size, while the former limits the interaction between the OWL and DG parts, thus preventing multiple DG structures from merging into one structure of (potentially) unbounded size. As reported in [7], DGs solved ? Work supported by EU FP7 SEALS and EPSRC projects ConDOR, ExODA, and LogMap. 1 http://www.w3.org/TR/owl2-overview/ 2 http://www.ebi.ac.uk/chebi/ 3 http://www.w3.org/Submission/SWRL/</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>only some of the problems related to the representation of structured objects, and our
subsequent discussions with EBI researchers revealed the following drawbacks.</p>
      <p>
        First, the DG approach does not allow one to define structures based on the absence
of certain characteristics. For example, an inorganic molecule is commonly described
as ‘a molecule not containing a carbon atom’, which can then be used to classify water
as an inorganic molecule. Designing an axiomatisation that produces the desired
entailment is very cumbersome with the DG approach: apart from stating that ‘each water
molecule consists of one oxygen and two hydrogen atoms’, one must additionally state
that ‘these three atoms are the only atoms in a water molecule’ and that ‘neither
hydrogen nor oxygen atoms are carbon atoms’. Second, the separation conditions governing
the interaction of the OWL 2 and DG components makes the combined language rather
difficult to use, as no role can be used in both components. Third, the acyclicity
condition from [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ] is rather cumbersome: a modeller must add a number of negative class
assertions to DGs so as to make any ontology with cyclic implications between DGs
unsatisfiable. This solution fails to cleanly separate the semantic consequences of an
ontology from the acyclicity check.
      </p>
      <p>In response to this critique, in this paper we present a radically different approach
to modelling complex objects via a novel formalism that we call Description Graph
Logic Programs (DGLP). At the syntactic level, our approach combines DGs, rules, and
OWL 2 RL axioms.4 In order to overcome the first problem, we give semantics to our
formalism via a translation into logic programs interpreted under stable model
semantics. As we show in Section 4, the resulting formalism can capture conditions based on
the absence of information. Moreover, we address the second problem by ensuring
decidability without the need for complex property separation conditions. To address the
third problem, in Section 5 we discuss existing syntactic acyclicity conditions and argue
that they unnecessarily rule out some very simple and intuitively reasonable ontologies.
As a remedy, we present a novel semantic acyclicity condition. Roughly speaking, a
precedence relation describing allowed implications between DGs is specified by the
modeller; a cyclic ontology that is not compatible with this precedence relation entails
a special propositional symbol. A cyclic ontology can still entail useful consequences,
but termination of reasoning can no longer be guaranteed. In Section 6 we consider
the problem of reasoning with negation-free ontologies and ontologies with stratified
negation. We show that the standard bottom-up evaluation of logic programs can
decide the relevant reasoning problems for semantically acyclic ontologies, and that it can
also decide whether an ontology is semantically acyclic. In Section 7 we briefly discuss
a preliminary evaluation of our formalism which indicates that reasoning with DGLP
ontologies is practically feasible. Proofs of the technical results can be found online.5
2</p>
    </sec>
    <sec id="sec-2">
      <title>Preliminaries</title>
      <p>We assume the reader to be familiar with OWL and description logics; for brevity, we
write OWL axioms using the DL notation. Let = ( C ; F ; P ) be a first-order logic
signature, where C , F , and P are countably infinite sets of constant, function, and
4 http://www.w3.org/TR/owl-profiles/
5 http://www.cs.ox.ac.uk/isg/people/despoina.magka/pubs/reports/DGLPTechnicalReport.pdf
predicate symbols, respectively, and where P contains the 0-ary predicate ?. The
arity of a predicate A is given by ar (A). A vector t1; : : : ; tn of first-order terms is often
abbreviated as ~t. An atom is a first-order formula of the form A(~t), where A 2 P and
~t is a vector of the terms t1; : : : ; tar(A). A rule r is an implication of the form
B1 ^ : : : ^ Bn ^ not Bn+1 ^ : : : ^ not Bm ! H1 ^ : : : ^ H`
(1)
where H1; : : : ; H` are atoms, B1; : : : ; Bm are atoms different from ?, m 0, and
` &gt; 0. Let head (r) = fHig1 i `, body +(r) = fBig1 i n, body (r) = fBign&lt;i m,
and body (r) = body +(r) [ body (r). A rule r is safe if every variable that occurs
in head (r) [ body (r) also occurs in body +(r). If body (r) = ; and r is safe, then
r is a fact. We denote with head P (r), body P+(r), body P (r), and body P (r) the set of
predicates that occur in head (r), body +(r), body (r), and body (r), respectively. A rule
r is function-free if no function symbols occur in r. A logic program P is a set of rules.
A logic program P is negation-free if, for each rule r 2 P , we have body (r) = ;.</p>
      <p>Given a logic program P , HU (P ) (Herbrand Universe) is the set of all terms that
can be formed using constants and functions from P (w.l.o.g. we assume that P contains
at least one constant). If no variables occur in an atom (rule), then the atom (rule)
is ground. Given a logic program P , the set HB (P ) is the set of all ground atoms
constructed using the terms in HU (P ) and the predicates in P . The grounding of a rule
r w.r.t. a set of terms T is the set of rules obtained by substituting the variables of r by
the terms of T in all possible ways. Given a logic program P , the program ground (P )
is obtained from P by replacing each rule r 2 P with its grounding w.r.t. HU (P ).</p>
      <p>Let I HB (P ) be a set of ground atoms. Then, I satisfies a ground rule r if
body +(r) I and body (r) \ I = ; imply head (r) I. Furthermore, I is a model
of a (not necessarily ground) program P , written I j= P , if ? 62 I and I satisfies each
rule r 2 ground (P ). Given a negation-free program P , set I is a minimal model of P
if I j= P and no I0 ( I exists such that I0 j= P . The Gelfond-Lifschitz reduct P I of a
logic program P w.r.t. I is obtained from ground (P ) by removing each rule r such that
body (r) \ I 6= ;, and removing all atoms not Bi in all the remaining rules. A set I is
a stable model of P if I is a minimal model of P I . Given a fact A, we write P j= A if
A 2 I for each stable model I of P ; otherwise, we write P 6j= A.</p>
      <p>A substitution is a partial mapping of variables to ground terms. The result of
applying a substitution to a term, atom, or a set of atoms M is written as M and is defined
as usual. Let P be a logic program in which no predicate occurring in the head of a rule
in P also occurs negated in the body of a (possibly different) rule in P . Operator TP ,
applicable to a set of facts X, is defined as follows:</p>
      <p>TP (X) = X [ fh j h 2 head (r); r 2 P; maps the variables of r to</p>
      <p>HU (P [ X) such that body +(r) X and body (r) \ X = ;g
Let TP0 = ;, let TPi = TP (TPi 1) for i 1, and let TP1 = Si1=1 TPi . Such P has at
most one stable model, and TP1 is the stable model of P if and only if ? 62 TP1.
3</p>
    </sec>
    <sec id="sec-3">
      <title>Motivating Application</title>
      <p>We next motivate our work using examples from the chemical Semantic Web
application mentioned in the introduction. The goal of this application is to automatically
classify chemical entities based on descriptions of their properties and structure. The
inability of OWL to describe cyclic structures with sufficient precision causes problems
when modelling chemical compounds, as molecules are highly cyclic. For example,
the cyclobutane molecule contains four carbon atoms connected in a ring, as shown in
Figure 1(a). One might try to represent this structure using the following OWL axiom:</p>
      <p>Cyclobutane v Molecule u = 4 hasAtom:[Carbon u (= 2 bond:Carbon)]
This axiom is satisfied in first-order interpretations I and I0 shown in Figures 1(b)
and 1(c), respectively; however, only interpretation I correctly reflects the structure of
cyclobutane. Furthermore, interpretation I0 cannot be ruled out by adding axioms due
to the tree-model property of OWL, according to which each satisfiable TBox has at
least one tree-shaped interpretation. This can prevent the entailment of certain desired
consequences. For example, one cannot define the class of molecules containing
fourmembered rings that will be correctly identified as a superclass of cyclobutane.</p>
      <p>
        The formalism from [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ] addresses this problem by augmenting an OWL ontology
with a set of rules and a set of description graphs (DGs), where each DG describes a
complex object by means of a directed labeled graph. To avoid misunderstandings, we
refer to the formalism from [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ] as DGDL (Description Graph Description Logics), and
to the formalism presented in this paper as DGLP (Description Graph Logic Programs).
Thus, cyclobutane can be described using the DG shown in Figure 2(a). The first-order
semantics of DGDL ontologies ensures that all models of an ontology correctly
represent the DG structure; for example, interpretation I0 from Figure 1(c) does not satisfy
the DG in Figure 2(a). Nevertheless, the interpretation I00 shown in Figure 1(d) also
satisfies the definition of cyclobutane under the semantics of DGDL ontologies. We next
show how the presence of models with excess information can restrict entailments.
      </p>
      <p>One might describe the class of hydrocarbon molecules (i.e., molecules consisting
exclusively of hydrogens and carbons) using axiom (2). One would expect the definition
of cyclobutane (as given in a DGDL ontology) and (2) to imply subsumption (3).</p>
      <sec id="sec-3-1">
        <title>Molecule u 8hasAtom:(Carbon t Hydrogen) v Hydrocarbon</title>
      </sec>
      <sec id="sec-3-2">
        <title>Cyclobutane v Hydrocarbon</title>
        <p>(2)
(3)
This, however, is not the case, since interpretation I00 does not satisfy axiom (3). One
might preclude the existence of extra atoms by adding cardinality restrictions requiring
each cyclobutane to have exactly four atoms. Even so, axiom (3) would not be entailed
because of a model similar to I, but where one carbon atom is also an oxygen atom.
One could eliminate such models by introducing disjointness axioms for all chemical
elements. Such gradual circumscription of models, however, is not an adequate solution,
as one can always think of additional information that needs to be ruled out.</p>
        <p>
          In order to address such problems, we present a novel expressive formalism that
we call Description Graph Logic Programs (DGLP). DGLP ontologies are similar to
DGDL ontologies in that they extend OWL ontologies with DGs and rules. In our case,
however, the ontology is restricted to OWL 2 RL so that the ontology can be translated
into rules [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]. We give semantics to our formalism by translating DGLP ontologies
into logic programs with function symbols. As is common in logic programming, the
hasAtom
bond
        </p>
        <p>C</p>
        <p>C</p>
        <p>C C
(a) Chemical structure of cyclobutane</p>
        <p>Molecule; Cyclobutane
Carbon</p>
        <p>Carbon</p>
        <p>Carbon
CarbonCarbon</p>
        <p>Carbon Carbon</p>
        <p>Carbon
CarbonCarbon</p>
        <p>CarbonCarbon
(c) Interpretation I0</p>
        <p>Molecule;</p>
        <p>Cyclobutane
Carbon
Carbon
(b) Interpretation I</p>
        <p>Carbon</p>
        <p>Carbon</p>
        <p>Molecule; Cyclobutane
Carbon
Carbon
(d) Interpretation I00</p>
        <p>Carbon
Carbon</p>
        <p>Oxygen
translation is interpreted under stable models. Consequently, interpretations such as I00
are not stable models of the DG in Figure 2(a), and hence subsumption (3) is entailed.</p>
        <p>
          Logic programs with function symbols can axiomatise infinite non-tree-like
structures, so reasoning with DGLP ontologies is trivially undecidable [
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]. Our goal,
however, is not to model arbitrarily large structures, but to describe complex objects up to a
certain level of granularity. For example, acetic acid has a carboxyl part, and carboxyl
has a hydroxyl part, but hydroxyl does not have an acetic acid part (see Fig. 3(a)). In
Section 5 we exploit this intuition and present a new acyclicity condition that ensures
decidability and allows for the modelling of naturally-arising molecular structures, such
as acetic acid, that would be ruled out by existing syntactic acyclicity conditions [
          <xref ref-type="bibr" rid="ref11 ref4">4, 11</xref>
          ].
4
        </p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>Description Graph Logic Programs</title>
      <p>We now present the DGLP formalism in detail; we first define description graphs.
Definition 1 (Description Graph). A description graph G = (V; E; ; A; m) is a
directed labeled graph where
– V = f1; : : : ; ng is a nonempty set of vertices,
– E V V is a set of edges,
– assigns a set of unary predicates (v) P to each vertex v 2 V and a set of
binary predicates (v1; v2) P to each edge (v1; v2) 2 E,</p>
      <p>Gcb :</p>
      <p>Bond
Cyclobutane</p>
      <p>1
Carbon 2</p>
      <sec id="sec-4-1">
        <title>3 Carbon</title>
      </sec>
      <sec id="sec-4-2">
        <title>Carbon 5 4 Carbon</title>
        <p>(a) Cyclobutane DG</p>
        <p>Cyclobutane(a) Molecule(a)
Gcb(a; f1Gcb (a); f2Gcb (a); f3Gcb (a); f4Gcb (a))
HasAtom(a; fiGcb (a)) for each i 2 f1; 2; 3; 4g
Carbon(fiGcb (a)) for each i 2 f1; 2; 3; 4g
Bond(fiGcb (a); fiG+c1b(a)) for each i 2 f1; 2; 3g
Bond(f4Gcb (a); f1Gcb (a))
MolWith4MemberedRing(a)
Hydrocarbon(a)</p>
        <p>(b) The stable model of LP(O)</p>
        <p>A description graph (DG) abstracts the structure of a complex object by means of
a directed labeled graph. For example, Figure 2 illustrates a DG that represents the
structure of a cyclobutane molecule. The start predicate of the graph (Cyclobutane in
this case) corresponds to the name of the object that the graph describes. The mode
determines whether a graph should be interpreted as an ‘only if’, ‘if’, or ‘if and only
if’ statement. More precisely, ) means that each instance of the DG’s start predicate
implies the existence of a corresponding instantiation of the entire graph structure; (
means that an instantiation of a suitable graph structure is ‘recognised’ as an instance
of the corresponding DG; and , means both of the above. Next we define graph
orderings, which will play an important role in ensuring the decidability of DGLP.
Definition 2 (Graph Ordering). A graph ordering on a set of description graphs DG
is a transitive and irreflexive relation DG DG .</p>
        <p>Intuitively, a graph ordering specifies which DGs can imply the existence of
instances of other DGs. For example, let GAA be a graph that represents acetic acid, and
let Gcxl be a graph that represents the carboxyl group (Fig. 3); then, one might define
such that GAA Gcxl, so that an acetic acid instance may imply the existence of a
carboxyl group instance, but not vice versa. We are now ready to define DGLP ontologies.
Definition 3 (DGLP Ontology). A DGLP ontology O = hDG ; ; R; F i is a
quadruple where DG is a finite set of description graphs, is a graph ordering on DG , R is
a finite set of function-free and safe rules, and F is a finite set of function-free facts.</p>
        <p>
          For the sake of simplicity, we do not explicitly include an OWL 2 RL TBox into the
definition of DGLP ontologies: OWL 2 RL axioms can be translated into rules as shown
in [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ] and included in R, and datatypes can be handled as in [
          <xref ref-type="bibr" rid="ref10">10</xref>
          ]. Similarly, we could
think of F as an OWL 2 ABox, as ABox assertions correspond directly to facts [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]. An
example of a DGLP ontology is hfGAA; Gcxlg; f(GAA; Gcxl)g; ;; fAceticAcid(a)gi.
        </p>
        <p>We next define the semantics of DGLP via a translation into logic programs. Since
R and F are already sets of rules and serves only to check acyclicity, we only need
to specify how to translate DGs into rules.</p>
        <p>Definition 4 (Start, Layout, and Recognition Rule). Let G = (V; E; A; ; m) be a
description graph and let f1G; : : : ; fjGV j 1 be fresh distinct function symbols uniquely
associated with G. The start rule sG, the layout rule `G, and the recognition rule rG of
G are defined as follows (G is also used as a predicate of arity jV j):</p>
        <p>A(x) ! G(x; f1G(x); : : : ; fjGV j 1(x))
G(x1; : : : ; xjV j) !</p>
        <p>^
i2V;B2 (i)
^</p>
        <p>B(xi) ^</p>
        <p>B(xi) ^
^</p>
        <p>^
hi;ji2E;R2 (i;j)</p>
        <p>R(xi; xj )</p>
        <p>R(xi; xj ) ! G(x1; : : : ; xjV j)
i2V;B2 (i);B6=A</p>
        <p>hi;ji2E;R2 (i;j)</p>
        <p>The start and layout rules of a description graph serve to unfold the graph’s
structure, whereas the recognition rule identifies instances of the start predicate. The function
terms f1G(x); : : : ; fjGV j 1(x) correspond to existential restrictions whose existentially
quantified variables have been skolemised.</p>
        <p>Example 1. The start rule and layout rule that correspond to the DG of cyclobutane
from Figure 2 (assuming mode ) as specified in Definition 5) are the following.</p>
        <p>Cyclobutane(x)! Gcb(x; f1Gcb (x); f2Gcb (x); f3Gcb (x); f4Gcb (x))
Gcb(x1; x2; x3; x4; x5) ! Cyclobutane(x1) ^
^ Bond(xi; xi+1) ^ Bond(x5; x2) ^
^ HasAtom(x1; xi) ^
2 i 5
2 i 4</p>
        <p>^ Carbon(xi)
2 i 5
(sG)
(`G)
(rG)
(sGcb )
(`Gcb )</p>
        <p>Next, we define Axioms(DG ), which is a logic program that encodes a set of DGs.
Definition 5 (Axioms(DG )). For a description graph G = (V; E; ; A; m), the
program Axioms(G) is the set of rules that contains the start rule sG and the layout rule
`G if m 2 f); ,g, and the recognition rule rG if m 2 f(; ,g. For a set of
description graphs DG = fGig1 i n, let Axioms(DG ) = SGi2DG Axioms(Gi).</p>
        <p>For each DGLP ontology O = hDG ; ; R; F i, we denote with LP(O) the program
Axioms(DG )[R[F . We check whether D subsumes C as in standard OWL reasoning:
we assert C(a) for a a fresh individual, and we check whether D(a) is entailed.
Definition 6 (Subsumption). Let O be a DGLP ontology, let C and D be unary
predicates occurring in O, and let a be a fresh constant not occurring in O. Then, D
subsumes C w.r.t. O, written O j= C v D, if LP(O) [ fC(a)g j= D(a) holds.
Example 2. We now show how a DGLP ontology can be used to obtain the inferences
described in Section 3. Rule (r1) encodes the class of four-membered ring molecules
and rules (r2) and (r3) represent the class of hydrocarbons.</p>
        <p>Molecule(x) ^ ^ HasAtom(x; yi) ^
1 i 4</p>
        <p>^
1 i 3</p>
        <p>Bond(yi; yi+1) ^ Bond(y4; y1)
^
1 i&lt;j 4</p>
        <p>not yi = yj ! MolWith4MemberedRing(x)</p>
        <sec id="sec-4-2-1">
          <title>Molecule(x) ^ HasAtom(x; y) ^ notCarbon(y) ^ notHydrogen(y) ! NHC(x) (r2)</title>
        </sec>
        <sec id="sec-4-2-2">
          <title>Molecule(x) ^ not NHC(x) ! HydroCarbon(x)</title>
        </sec>
        <sec id="sec-4-2-3">
          <title>Cyclobutane(x) ! Molecule(x)</title>
          <p>The use of the equality predicate = in the body of r1 does not require an
extension to our syntax: if = occurs only in the body and not in the head of the rules,
then negation of equality can be implemented using a built-in predicate. We also state
that cyclobutane is a molecule using (r4) that corresponds to the OWL 2 RL axiom
Cyclobutane v Molecule. Let DG = fGcbg, let = ;, let R = frigi4=1, let F =
fCyclobutane(a)g, and let O = hDG ; ; R; F i. Figure 2(b) shows the only stable
model of LP(O) by inspection of which we see that LP(O) j= Hydrocarbon(a) and
LP(O) j= MolWith4MemberedRing(a), as expected.
(r1)
(r3)
(r4)
5</p>
        </sec>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>Semantic Acyclicity</title>
      <p>
        Reasoning about logic programs with function symbols is undecidable in general [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ].
This problem is similar to reasoning about datalog programs with existentially
quantified rule heads (known as tuple-generating dependencies or tgds) [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. For such
programs, conditions such as weak acyclicity [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] or super-weak acyclicity [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ] ensure the
termination of bottom-up reasoning algorithms: these conditions examine the syntactic
structure of the rules and check whether values created by a rule’s head can be
propagated so as to eventually satisfy the premise of the same rule. Such conditions can
also be applied to DGLP ontologies; however, they may overestimate the propagation
of values introduced by existential quantification and thus rule out unproblematical
programs that generate only finite structures. As shown in Example 4, this is the case for
programs that naturally arise from DGLP representations of molecular structures.
      </p>
      <p>To mitigate this problem, we propose a new semantic acyclicity condition. The idea
is to detect repetitive construction of DG instances by checking the entailment of a
special propositional symbol Cycle. In particular, the graph ordering of a DGLP ontology
O is used to extend LP(O) with rules that derive Cycle whenever an instance of a DG
G1 implies existence of an instance of a DG G2 but G1 6 G2.</p>
      <p>Definition 7 (Check(O)). Let Gi = (Vi; Ei; i; Ai; mi), i 2 f1; 2g be two description
graphs. We define ChkPair(G1; G2) and ChkSelf(Gi) as follows:</p>
      <p>ChkPair(G1; G2) = fG1(x1; : : : ; xjV1j) ^ A2(xk) ! Cycle j 1
k
ChkSelf(Gi) = fGi(x1; : : : ; xjVij) ^ Ai(xk) ! Cycle j 1 &lt; k
jV1jg
jVijg
(4)
(5)
Let DG = fGig1 i n be a set of description graphs and let
DG . We define Check(DG ; ) as follows:
be a graph ordering on
Check(DG ; ) =
Example 3. Figure 3(a) shows the structure of acetic acid molecules and the parts they
consist of. In this example, however, we focus on the description graphs for acetic acid
(GAA) and carboxyl (Gcxl), which are shown in Figures 3(b) and 3(c), respectively. Since
an instance of acetic acid implies the existence of an instance of a carboxyl, but not
vice versa, we define our ordering as GAA Gcxl. Thus, for DG = fGAA; Gcxlg and
= f(GAA; Gcxl)g, set Check(DG ; ) contains the following rules:</p>
      <sec id="sec-5-1">
        <title>Gcxl(x1; x2; x3) ^ AceticAcid(xi) ! Cycle</title>
      </sec>
      <sec id="sec-5-2">
        <title>GAA(x1; x2; x3) ^ AceticAcid(xi) ! Cycle Gcxl(x1; x2; x3) ^ Carboxyl(xi) ! Cycle</title>
        <p>for 1
for 2
for 2
i
i
i
3
3
3
Definition 8. A DGLP ontology O is said to be semantically acyclic if and only if
LP(O) [ Check(O) 6j= Cycle.</p>
        <p>Example 4. Let DG = fGAA; Gcxlg with mAA = mcxl = , , let = f(GAA; Gcxl)g,
let F = fAceticAcid(a)g, and let O = hDG ; ; ;; F i. The logic program LP(O)
contains F and the following rules (HP abbreviates HasPart):</p>
      </sec>
      <sec id="sec-5-3">
        <title>AceticAcid(x) ! GAA(x; f1(x); f2(x))</title>
      </sec>
      <sec id="sec-5-4">
        <title>GAA(x; y; z) ! AceticAcid(x) ^ Methyl(y) ^ Carboxyl(z) ^ HP(x; y) ^ HP(x; z)</title>
        <p>Methyl(y) ^ Carboxyl(z) ^ HP(x; y) ^ HP(x; z) ! GAA(x; y; z)</p>
      </sec>
      <sec id="sec-5-5">
        <title>Carboxyl(x) ! Gcxl(x; g1(x); g2(x))</title>
      </sec>
      <sec id="sec-5-6">
        <title>Gcxl(x; y; z) ! Carboxyl(x) ^ Carbonyl(y) ^ Hydroxyl(z) ^ HP(x; y) ^ HP(x; z)</title>
      </sec>
      <sec id="sec-5-7">
        <title>Carbonyl(y) ^ Hydroxyl(z) ^ HP(x; y) ^ HP(x; z) ! Gcxl(x; y; z)</title>
        <p>
          Let also Check(O) = Check(DG ; ) as defined in Example 3. We can easily
compute the stable model of P = LP(O) [ Check(O) using the TP operator and check
that Cycle is not in the (only) stable model of P ; so P 6j= Cycle and O is
semantically acyclic. However, P is neither weakly [
          <xref ref-type="bibr" rid="ref4">4</xref>
          ] nor super-weakly acyclic [
          <xref ref-type="bibr" rid="ref11">11</xref>
          ]. This, we
believe, justifies the importance of semantic acyclicity for our applications.
        </p>
      </sec>
    </sec>
    <sec id="sec-6">
      <title>Reasoning with DGLP Ontologies</title>
      <p>Initially, we consider the problem of reasoning with a negation-free DGLP ontology
O = hDG ; ; R; F i. Intuitively, one can apply the TP operator to P = LP(O) [
Check(O) and compute TP1 ; : : : ; TPi and so on. By Theorem 5, for some i we will
either reach a fixpoint or derive Cycle. In the former case, we have the stable model of
O (if ? 62 TPi ), which we can use to decide the relevant reasoning problems; in the
latter case, we know that O is not acyclic.</p>
      <p>Theorem 5. Let O = hDG ; ; R; F i be a DGLP ontology with R negation-free, and
let P = LP(O) [ Check(O). Then, Cycle 2 TPi or TPi+1 = TPi for some i 1.</p>
      <p>Checking the semantic acyclicity of O is thus decidable. If the stable model of
LP(O) [ Check(O) is infinite, then Cycle is derived; note that the inverse does not hold
as semantic acyclicity is a sufficient but not necessary termination condition.</p>
      <p>Next, we consider the case of DGLP ontologies with stratified negation-as-failure.
We start by recapitulating several definitions. For each program P , a stratification of P
is a mapping : P ! N such that for each rule r 2 P we have (i) if B 2 body P+(r),
then (r0) (r) for each r0 2 P with B 2 head P (r0) and (ii) if B 2 body P (r), then
(r0) &lt; (r) for each r0 2 P with B 2 head P (r0). A logic program P is stratifiable if
there exists a stratification of P . Moreover, a partition P1; : : : ; Pn of P is a stratification
partition of P w.r.t. if, for each r 2 P , we have r 2 P (r). The sets P1; : : : ; Pn are
called the strata of P . Let UP10 = TP11 , U Pij = TPi j (UP1j 1 ) for 1 j n and i 1
and UP1j = TP1j (UP1j 1 ). The stable model of P is given by UP1n . Next we introduce the
notion of a DG-stratification, which ensures that the cycle detection rules are assigned
to the strata containing the relevant start rules of DGs.</p>
      <p>Definition 9 (DG-stratification). Let O = hDG ; ; R; F i be a DGLP ontology, let
P = LP(O) [ Check(O) and let P1; : : : ; Pn be a stratification partition of P w.r.t.
some stratification of P . Then, is a DG-stratification if
– for each G1; G2 2 DG such that G1 6= G2, G1 6</p>
      <p>have ChkPair(G1; G2) Pi, and
– for each G 2 DG such that sG 2 Pi, we have ChkSelf(G)</p>
      <p>Pi.</p>
      <p>G2, and fsG1 ; sG2 g</p>
      <p>Pi, we</p>
      <p>The following result shows that, as long as LP(O) is stratified, one can always
assign the cycle checking rules in Check(O) to the appropriate strata and thus obtain a
DG-stratification of LP(O) [ Check(O).</p>
      <p>Lemma 1. Let O = hDG ; ; R; F i be a DGLP ontology. If is a stratification of
LP(O), then can be extended to a DG-stratification 0 of LP(O) [ Check(O).</p>
      <p>The following theorem implies that, given a stratifiable DGLP ontology, we can
decide whether the ontology is semantically acyclic, and if so, we can compute its
stable model and thus solve all relevant reasoning problems; please note that we show
the decidability of semantic acyclicity only for ontologies with stratified negation.
Theorem 6. Let O be a DGLP ontology and P = LP(O) [ Check(O). If P1; : : : ; Pn
is a stratification partition of P w.r.t. a DG-stratification of P , then, for each j with
1 j n, there exists i 1 such that Cycle 2 U Pij , or U Pi+j1 = U Pij and U Pij is finite.
In order to test the applicability of our approach in practice, we developed a
prototypical implementation based on the XSB system.6 Using data extracted from ChEBI, we
built a number of DGLP ontologies with stratified NAF and we checked each ontology
for acyclicity and for entailed subsumptions: all ontologies were found acyclic and all
molecules were classified as expected; additionally, testing subsumptions for an
ontology representing 70 molecules did not require more than a few minutes on a standard
desktop computer. Given the prototypical nature of our application, we consider the
results as evidence of the practical feasibility of our approach.</p>
      <p>
        In this paper we have laid the theoretical foundations of a novel, expressive, and
OWL 2 RL-compatible ontology language that is well suited to modelling objects with
complex structure. In the future, we plan to modify our approach in order to avoid the
explicit definition of graph ordering by the modeller; furthermore, we shall investigate
whether semantic acyclicity can be combined with other conditions (such as those
defined in [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]) in order to obtain a more general acyclicity check. Finally, we will optimise
our prototype in order to obtain a fully-scalable chemical classification system.
6 http://xsb.sourceforge.net/
      </p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Baget</surname>
            ,
            <given-names>J.F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Leclère</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mugnier</surname>
            ,
            <given-names>M.L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Salvat</surname>
          </string-name>
          , E.:
          <article-title>On rules with existential variables: walking the decidability line</article-title>
          .
          <source>Artif. Intell</source>
          .
          <volume>175</volume>
          (
          <issue>9-10</issue>
          ),
          <fpage>1620</fpage>
          -
          <lpage>1654</lpage>
          (
          <year>2011</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Beeri</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Vardi</surname>
          </string-name>
          , M.Y.:
          <article-title>The implication problem for data dependencies</article-title>
          .
          <source>In: Proc. ICALP</source>
          . pp.
          <fpage>73</fpage>
          -
          <lpage>85</lpage>
          (
          <year>1981</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Cali</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gottlob</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lukasiewicz</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Marnette</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pieris</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          : Datalog+/
          <article-title>-: A family of logical knowledge representation and query languages for new applications</article-title>
          . In: LICS (
          <year>2010</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Fagin</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kolaitis</surname>
            ,
            <given-names>P.G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Miller</surname>
            ,
            <given-names>R.J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Popa</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          :
          <article-title>Data exchange: semantics and query answering</article-title>
          .
          <source>In: ICDT</source>
          . pp.
          <fpage>207</fpage>
          -
          <lpage>224</lpage>
          (
          <year>2003</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Graves</surname>
          </string-name>
          , H.:
          <article-title>Representing product designs using a description graph extension to OWL 2</article-title>
          .
          <source>In: Proc. of the 5th OWLED Workshop</source>
          (
          <year>2009</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Grosof</surname>
            ,
            <given-names>B.N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Horrocks</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Volz</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Decker</surname>
            ,
            <given-names>S.:</given-names>
          </string-name>
          <article-title>Description logic programs: combining logic programs with description logic</article-title>
          .
          <source>In: WWW</source>
          (
          <year>2003</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Hastings</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Dumontier</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hull</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Horridge</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Steinbeck</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Sattler</surname>
            ,
            <given-names>U.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Stevens</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hörne</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Britz</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          :
          <article-title>Representing chemicals using OWL, description graphs and rules</article-title>
          .
          <source>In: OWLED</source>
          (
          <year>2010</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Krötzsch</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rudolph</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hitzler</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          :
          <article-title>ELP: tractable rules for OWL 2</article-title>
          .
          <source>In: Proc. of the 7th Int. Semantic Web Conference (ISWC</source>
          <year>2008</year>
          ). pp.
          <fpage>649</fpage>
          -
          <lpage>664</lpage>
          (
          <year>2008</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Levy</surname>
            ,
            <given-names>A.Y.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rousset</surname>
            ,
            <given-names>M.C.</given-names>
          </string-name>
          :
          <article-title>Combining horn rules and description logics in CARIN</article-title>
          .
          <source>Artificial Intelligence</source>
          <volume>104</volume>
          (
          <issue>1-2</issue>
          ),
          <fpage>165</fpage>
          -
          <lpage>209</lpage>
          (
          <year>1998</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Lutz</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Areces</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Horrocks</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Sattler</surname>
            ,
            <given-names>U.</given-names>
          </string-name>
          :
          <article-title>Keys, nominals, and concrete domains</article-title>
          .
          <source>J. of Artificial Intelligence Research</source>
          <volume>23</volume>
          ,
          <fpage>667</fpage>
          -
          <lpage>726</lpage>
          (
          <year>2004</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Marnette</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          :
          <article-title>Generalized schema-mappings: from termination to tractability</article-title>
          . In: PODS (
          <year>2009</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>Motik</surname>
            ,
            <given-names>B.</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>
          ,
          <string-name>
            <surname>Sattler</surname>
            ,
            <given-names>U.</given-names>
          </string-name>
          :
          <article-title>Representing ontologies using description logics, description graphs, and rsules</article-title>
          .
          <source>Artif. Int</source>
          .
          <volume>173</volume>
          ,
          <fpage>1275</fpage>
          -
          <lpage>1309</lpage>
          (
          <year>2009</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <string-name>
            <surname>Rector</surname>
            ,
            <given-names>A.L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Nowlan</surname>
            ,
            <given-names>W.A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Glowinski</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>Goals for concept representation in the GALEN project</article-title>
          .
          <source>In: SCAMC '93</source>
          . pp.
          <fpage>414</fpage>
          -
          <lpage>418</lpage>
          (
          <year>1993</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>