<!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>Combined Complexity of Answering Tree-like Queries in OWL 2 QL</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Meghyn Bienvenu</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Stanislav Kikot</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Vladimir Podolskii</string-name>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Institute for Information Transmission Problems &amp; MIPT</institution>
          ,
          <addr-line>Moscow</addr-line>
          ,
          <country country="RU">Russia</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>LRI - CNRS &amp; Universite ́ Paris Sud</institution>
          ,
          <addr-line>Orsay</addr-line>
          ,
          <country country="FR">France</country>
        </aff>
        <aff id="aff2">
          <label>2</label>
          <institution>Steklov Mathematical Institute &amp; Higher School of Economics</institution>
          ,
          <addr-line>Moscow</addr-line>
          ,
          <country country="RU">Russia</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Introduction The OWL 2 QL ontology language [11], based upon the description logic DL-LiteR, is considered particularly well suited for applications involving large amounts of data. While the data complexity of querying OWL 2 QL knowledge bases is well understood, far less is known about combined complexity of conjunctive query (CQ) answering for restricted classes of conjunctive queries. By contrast, the combined complexity of CQ answering in the relational setting has been thoroughly investigated. In relational databases, it is well known that CQ answering is NP-complete in the general case. A seminal result by Yannakakis established the tractability of answering tree-shaped (aka acyclic) CQs [14], and this result was later extended to wider classes of queries, most notably to bounded treewidth CQs [5]. Gottlob et al. [6] pinpointed the precise complexity of answering tree-shaped and bounded treewidth CQs, showing both problems to be complete for the class LOGCFL of all languages logspace-reducible to context-free languages [13]. In the presence of arbitrary OWL 2 QL ontologies, the NP upper bound for arbitrary CQs continues to hold [4], but answering tree-shaped queries becomes NP-hard [8]. Interestingly, the latter problem was recently proven tractable in [3] for DL-Litecore (a slightly less expressive logic than OWL 2 QL), raising the hope that other restrictions might also yield tractability. This extended abstract summarizes our investigation [2] into the combined complexity of conjunctive query answering in OWL 2 QL for tree-shaped queries, their restriction to linear and bounded leaf queries and their generalization to bounded treewidth queries. Our complexity analysis reveals that all query-ontology combinations that have not already been shown NP-hard are in fact tractable. Specifically, in the case of bounded depth ontologies, we prove membership in LOGCFL for bounded treewidth queries (generalizing the result in [6]) and membership in NL for bounded leaf queries. We also show LOGCFL-completeness for linear and bounded leaf queries in the presence of arbitrary OWL 2 QL ontologies. This last result is the most interesting technically, as the upper and lower bounds rely on two different characterizations of the class LOGCFL. Preliminaries We assume the reader familiar is OWL 2 QL (or DL-LiteR) knowledge bases (KBs), composed of a TBox T and ABox A built from countably infinite, mutually disjoint sets NC, NR, and NI of concept names, role names, and individual names. Roles R and basic concepts B are defined in a standard way, cf. [4]. We use NR to refer to the set of all roles. We recall that every consistent OWL 2 QL KB (T ; A) possesses a canonical model CT ;A with the property that T ; A j= q(a) iff CT ;A j= q(a) for every CQ q and tuple a inds(A). Thus, CQ answering in OWL 2 QL corresponds to deciding the existence of a homomorphism of the query into the canonical model. Informally,</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>
        CT ;A is obtained from A by repeatedly applying the axioms in T , introducing fresh
elements as needed to serve as witnesses for the existential quantifiers. According to the
standard construction (cf. [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ]), the domain CT ;A of CT ;A consists of inds(A) and all
words of the form aR1R2 : : : Rn 1Rn (n 1) with a 2 NC and Ri 2 NR. Intuitively,
the element aR1R2 : : : Rn 1Rn is obtained by applying an axiom with right-hand side
9Rn to the element aR1R2 : : : Rn 1 2 CT ;A . A TBox T is of depth ! if there is an
ABox A such that the domain of CT ;A is infinite; T is of depth d, 0 d &lt; !, if d is the
greatest number such that some CT ;A contains an element of the form aR1 : : : Rd.
Contributions In what follows, we briefly formulate our combined complexity results
and provide some intuitions about the proof techniques. See [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] for details.
Theorem 1. CQ answering is in LOGCFL for bounded treewidth queries and bounded
depth ontologies.
      </p>
      <p>
        Proof sketch. We exploit the fact that CQ answering over a KB (T ; A) corresponds
to evaluating the query over the canonical model CT ;A viewed as a database. If T
has depth k (with k a fixed constant), then CT ;A can be computed by a
deterministic logspace Turing machine (TM) with access to an NL oracle. Indeed, the depth
bound k implies the finiteness of CT ;A and that all domain elements can be described
using logarithmically many bits. To complete the argument, we use the fact that
answering bounded treewidth queries over databases is in LOGCFL [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] and that the class
LOGCFL is closed under LLOGCFL (and hence LNL) reductions [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ].
For lack of space, we have not specified how to check whether a variable (resp. pair
of variables) can be mapped to an element (resp. pair of elements), but this can be
done in NL using a small number of entailment checks. Also note that the bound on
the number of leaves yields the bound on size of Frontier, and the bound on the TBox
depth guarantees that we only need logarithmically many bits per pair in Frontier.
Theorem 3. CQ answering is LOGCFL-complete for bounded leaf queries and
arbitrary ontologies. The lower bound holds already for linear queries.
      </p>
      <p>Theorem 2. CQ answering is NL-complete for bounded leaf queries and bounded
depth ontologies.</p>
      <p>Proof sketch. The lower bound is an immediate consequence of the NL-hardness of
answering atomic queries in OWL 2 QL. To prove the upper bound, we apply a
straightforward non-deterministic procedure for deciding (T ; A) j= q :
1. Fix a directed tree T compatible with q. Let v0 be the root variable.
2. Guess u0 2 CT ;A . Return no if v0 cannot be mapped to u0.
3. Initialize Frontier to f(v0; u0)g.
4. While Frontier 6= ;
(a) Remove (v1; u1) from Frontier.
(b) For every child v2 of v1
i. Guess an element u2 from CT ;A .
ii. Return no if (v1; v2) cannot be mapped to (u1; u2).</p>
      <p>
        iii. Add (v2; u2) to Frontier.
5. Return yes.
tu
tu
Proof sketch. Concerning the upper bound, it is easy to adapt the previous algorithm
to handle arbitrary TBoxes: we simply replace CT ;A by faw 2 CT ;A j jwj
2jT j + jqjg. The modified algorithm gives the correct answers, but it does not have the
required complexity, because it might need more than logarithmically many bits to store
guessed elements aw. To show LOGCFL membership, we further modify the
procedure so that it can be implemented by a non-deterministic polytime logspace-bounded
Turing machine augmented with a stack (such TMs are known to capture LOGCFL
computation [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ]). The stack is used to store the word part w of a domain element aw.
The modification is not at all obvious since we need to store several words at a time
while the specified machine has only a single stack; the trick is to employ a careful
‘synchronization’ of traversals of different branches of the query.
      </p>
      <p>
        The lower bound is by reduction from the problem of deciding whether an input of
length l is accepted by the lth circuit of a logspace-uniform family of SAC1 circuits
(proven LOGCFL-hard in [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ]). This problem was used in [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] to show
LOGCFLhardness of evaluating tree-shaped CQs over databases. We follow a broadly similar
approach, but with one crucial difference: the power of OWL 2 QL TBoxes allows us to
‘unravel’ the circuit into a tree and to use linear queries instead of tree-shaped ones. tu
Discussion If we compare the new and existing results for OWL 2 QL with those from
relational databases, we observe that adding an OWL 2 QL TBox of bounded depth
does not change the combined complexity for query answering, while for TBoxes of
unbounded depth, the complexity class shifts one ‘step’ higher: from NL to LOGCFL for
bounded leaf queries and from LOGCFL to NP for tree-shaped and bounded treewidth
CQs. It is also interesting to compare the combined complexity landscape (below right)
with the succinctness landscape for query rewriting (below left) from [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ].
:[]
4
:][
8
c
P
      </p>
      <p>N
-cL .3</p>
      <p>m
FLCGO :hT;
arb
NL=poly NP=poly: no polysize PE or NDL</p>
      <p>
        [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ]
E
P
A
H
S
Y
R
E
U
Q
[
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]
poly
PE,
FO
and
NDL
[
        <xref ref-type="bibr" rid="ref9">9</xref>
        ]
      </p>
      <p>SAC1: no poly PE but poly NDL</p>
      <p>
        [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]
NL=poly: no poly PE but poly NDL
[
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]
][
8
y
l
o
p
=
P
N
arb
n
itw..
h
eed.
r
T
2
trees
s`
e
v
a
l .
e
f .
reo.
b
u1
m
N
      </p>
    </sec>
    <sec id="sec-2">
      <title>NP-complete</title>
      <p>
        : DBs : [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]
      </p>
    </sec>
    <sec id="sec-3">
      <title>LOGCFL-complete</title>
      <p>
        : [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] : Thm. 1
      </p>
    </sec>
    <sec id="sec-4">
      <title>NL-complete</title>
      <p>
        : [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] / DBs : Thm. 2
1
2
3
      </p>
      <p>: : :
ONTOLOGY DEPTH
d
arb
1
2
3</p>
      <p>
        : : :
ONTOLOGY DEPTH
d
Observe that for our newly identified tractable classes, polynomial-size non-recursive
datalog (NDL) rewritings are guaranteed to exist, whereas this is not the case for the
positive existential (PE) rewritings more typically considered. In future work, we plan to
marry these positive succinctness and complexity results by developing concrete
NDLrewriting algorithms for OWL 2 QL for which both the rewriting and evaluation phases
run in polynomial time (as was done in [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] for DL-Litecore).
      </p>
      <p>Acknowledgments. Partial support was provided by ANR grant 12-JS02-007-01,
Russian Foundation for Basic Research and the programme “Leading Scientific Schools”.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <given-names>M.</given-names>
            <surname>Bienvenu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Kikot</surname>
          </string-name>
          , and
          <string-name>
            <given-names>V. V.</given-names>
            <surname>Podolskii</surname>
          </string-name>
          .
          <article-title>Succinctness of query rewriting in OWL 2 QL: the case of tree-like queries</article-title>
          .
          <source>In Informal Proceedings of the 27th International Workshop on Description Logics</source>
          , Vienna, Austria,
          <source>July 17-20</source>
          ,
          <year>2014</year>
          ., pages
          <fpage>45</fpage>
          -
          <lpage>57</lpage>
          ,
          <year>2014</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <given-names>M.</given-names>
            <surname>Bienvenu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Kikot</surname>
          </string-name>
          , and
          <string-name>
            <given-names>V. V.</given-names>
            <surname>Podolskii</surname>
          </string-name>
          .
          <article-title>Tree-like queries in OWL 2 QL: Succinctness and complexity results</article-title>
          .
          <source>In Proc. of the 30th Annual ACM/IEEE Symposium on Logic in Computer Science (LICS</source>
          <year>2015</year>
          ). IEEE,
          <year>2015</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <given-names>M.</given-names>
            <surname>Bienvenu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Ortiz</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Simkus</surname>
          </string-name>
          , and
          <string-name>
            <given-names>G.</given-names>
            <surname>Xiao</surname>
          </string-name>
          .
          <article-title>Tractable queries for lightweight description logics</article-title>
          .
          <source>In Proc. of the 23rd Int. Joint Conf. on Artificial Intelligence (IJCAI</source>
          <year>2013</year>
          ). AAAI Press,
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <given-names>D.</given-names>
            <surname>Calvanese</surname>
          </string-name>
          , G. De Giacomo,
          <string-name>
            <given-names>D.</given-names>
            <surname>Lembo</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Lenzerini</surname>
          </string-name>
          , and
          <string-name>
            <given-names>R.</given-names>
            <surname>Rosati</surname>
          </string-name>
          .
          <article-title>Tractable reasoning and efficient query answering in description logics: The DL-Lite family</article-title>
          .
          <source>J. of Automated Reasoning</source>
          ,
          <volume>39</volume>
          (
          <issue>3</issue>
          ):
          <fpage>385</fpage>
          -
          <lpage>429</lpage>
          ,
          <year>2007</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <given-names>C.</given-names>
            <surname>Chekuri</surname>
          </string-name>
          and
          <string-name>
            <given-names>A.</given-names>
            <surname>Rajaraman</surname>
          </string-name>
          .
          <article-title>Conjunctive query containment revisited</article-title>
          .
          <source>Theoretical Computer Science</source>
          ,
          <volume>239</volume>
          (
          <issue>2</issue>
          ):
          <fpage>211</fpage>
          -
          <lpage>229</lpage>
          ,
          <year>2000</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <given-names>G.</given-names>
            <surname>Gottlob</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N.</given-names>
            <surname>Leone</surname>
          </string-name>
          , and
          <string-name>
            <given-names>F.</given-names>
            <surname>Scarcello</surname>
          </string-name>
          .
          <article-title>Computing LOGCFL certificates</article-title>
          .
          <source>In ICALP-99</source>
          , pages
          <fpage>361</fpage>
          -
          <lpage>371</lpage>
          ,
          <year>1999</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <given-names>G.</given-names>
            <surname>Gottlob</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N.</given-names>
            <surname>Leone</surname>
          </string-name>
          , and
          <string-name>
            <given-names>F.</given-names>
            <surname>Scarcello</surname>
          </string-name>
          .
          <article-title>The complexity of acyclic conjunctive queries</article-title>
          .
          <source>J. ACM</source>
          ,
          <volume>48</volume>
          (
          <issue>3</issue>
          ):
          <fpage>431</fpage>
          -
          <lpage>498</lpage>
          ,
          <year>2001</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <given-names>S.</given-names>
            <surname>Kikot</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Kontchakov</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V. V.</given-names>
            <surname>Podolskii</surname>
          </string-name>
          , and
          <string-name>
            <given-names>M.</given-names>
            <surname>Zakharyaschev</surname>
          </string-name>
          .
          <article-title>Exponential lower bounds and separation for query rewriting</article-title>
          .
          <source>In Proc. of the 39th Int. Colloquium on Automata, Languages, and Programming (ICALP</source>
          <year>2012</year>
          ),
          <string-name>
            <surname>Part</surname>
            <given-names>II</given-names>
          </string-name>
          , volume
          <volume>7392</volume>
          <source>of LNCS</source>
          , pages
          <fpage>263</fpage>
          -
          <lpage>274</lpage>
          . Springer,
          <year>2012</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <given-names>S.</given-names>
            <surname>Kikot</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Kontchakov</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V. V.</given-names>
            <surname>Podolskii</surname>
          </string-name>
          , and
          <string-name>
            <given-names>M.</given-names>
            <surname>Zakharyaschev</surname>
          </string-name>
          .
          <article-title>On the succinctness of query rewriting over OWL 2 QL ontologies with shallow chases</article-title>
          .
          <source>In Proc. of the 29th Annual ACM/IEEE Symposium on Logic in Computer Science (LICS</source>
          <year>2014</year>
          ). ACM Press,
          <year>2014</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <given-names>R.</given-names>
            <surname>Kontchakov</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Lutz</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Toman</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Wolter</surname>
          </string-name>
          , and
          <string-name>
            <given-names>M.</given-names>
            <surname>Zakharyaschev</surname>
          </string-name>
          .
          <article-title>The combined approach to query answering in DL-Lite</article-title>
          .
          <source>In Proc. of the 10th Int. Conf. on the Principles of Knowledge Representation and Reasoning (KR</source>
          <year>2010</year>
          ). AAAI Press,
          <year>2010</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <given-names>B.</given-names>
            <surname>Motik</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B. Cuenca</given-names>
            <surname>Grau</surname>
          </string-name>
          ,
          <string-name>
            <given-names>I.</given-names>
            <surname>Horrocks</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Z.</given-names>
            <surname>Wu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Fokoue</surname>
          </string-name>
          , and
          <string-name>
            <given-names>C.</given-names>
            <surname>Lutz</surname>
          </string-name>
          .
          <article-title>OWL 2 Web Ontology Language profiles</article-title>
          .
          <source>W3C Recommendation</source>
          ,
          <issue>11</issue>
          <year>December 2012</year>
          . Available at http://www.w3.org/TR/owl2-profiles/.
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <given-names>I. H.</given-names>
            <surname>Sudborough</surname>
          </string-name>
          .
          <article-title>On the tape complexity of deterministic context-free languages</article-title>
          .
          <source>Journal of the ACM</source>
          ,
          <volume>25</volume>
          (
          <issue>3</issue>
          ):
          <fpage>405</fpage>
          -
          <lpage>414</lpage>
          ,
          <year>1978</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <string-name>
            <given-names>H.</given-names>
            <surname>Venkateswaran</surname>
          </string-name>
          .
          <article-title>Properties that characterize LOGCFL</article-title>
          .
          <source>J. Computer and System Sciences</source>
          ,
          <volume>43</volume>
          (
          <issue>2</issue>
          ):
          <fpage>380</fpage>
          -
          <lpage>404</lpage>
          ,
          <year>1991</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          14.
          <string-name>
            <given-names>M.</given-names>
            <surname>Yannakakis</surname>
          </string-name>
          .
          <article-title>Algorithms for acyclic database schemes</article-title>
          .
          <source>In Proc. of the 7th Int. Conf. on Very Large Data Bases (VLDB'81)</source>
          , pages
          <fpage>82</fpage>
          -
          <lpage>94</lpage>
          . IEEE Computer Society,
          <year>1981</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>