<!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>Enumerating Answers to Ontology-Mediated Queries: Partial Answers and E ciency (Extended Abstract)</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Carsten Lutz</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Marcin Przybylko</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Department of Computer Science, University of Bremen</institution>
          ,
          <country country="DE">Germany</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Ontology-mediated query evaluation has mostly been studied in the form of single-testing : given an ontology-mediated query (OMQ) Q(x) = (O; S; q), a database D over schema S, and a candidate answer a 2 adom(D)jxj, decide whether a 2 Q(D) [2, 4, 7, 8]. From a practical perspective, however, it is often not realistic to assume that a candidate answer is available. This leads us to study answer enumeration where only Q and D are given as an input, and the task is to produce all answers without repetitions, in an unspeci ed order. More precisely, an enumeration algorithm works in two phases. In the preprocessing phase, the algorithm uses Q and D to construct a data structure to be used later on, but no output. In the enumeration phase, it uses the precomputed structure to output all tuples from Q(D). Related to enumeration is all-testing which initially gets the same two inputs and has the same preprocessing phase, followed by a testing phase where the algorithm repeatedly receives candidate answers a 2 adom(D)jxj as additional inputs and returns `yes' or 'no' depending on whether a 2 Q(D). These modes of query evaluation have been extensively studied in database theory, see for example [3, 6, 9{13, 15]. A case of particular importance is enumeration in CD Lin, where the preprocessing takes time linear in the size of the database D and the delay between two answers is independent of D. Note that there is no restriction on how the running time of the preprocessing or how the delay depends on the OMQ Q. This corresponds to data complexity in singletesting where Q is xed and thus of constant size. An excellent recent survey of the work on answer enumeration in database theory is [5]. We consider enumeration and all-testing for two kinds of answers: the traditional certain answers, where a 2 Q(D) if and only if a is a tuple of constants from D such that a 2 q(I) for every model I of D and O, and a novel notion of partial answers that is able to take into account fresh constants introduced by existential quanti ers in O (`nulls'). We next de ne the latter. Fix a wildcard symbol ` ' that cannot occur as a constant in a database. A wildcard tuple for a database D takes the form (c1; : : : ; cn) 2 (adom(D)[f g)n where n 0 and adom(D) denotes the set of constants used in D. For wildcard tuples c = (c1; : : : ; cn) and c0 = (c01; : : : ; c0n), we write c c0 if c0i 2 fci; g for 1 i n. Moreover, c c0 if c c0 and c 6= c0. Intuitively, c c0 expresses that tuple</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>c carries more information than tuple c0. For example, (a; b) (a; ) ( ; ).
A partial answer to OMQ Q(x) = (O; S; q) on S-database D is a wildcard tuple
c for D of length jxj such that for every model I of D and O, there is a c0 2 q(I)
such that c0 c. Note that some positions in c0 may contain constants that
are not in adom(D), and that the corresponding positions in c must have the
wildcard. We say that a partial answer c to Q on S-database D is a least partial
answer if there is no partial answer c0 to Q on D with c0 c. We are then
interested in enumerating the set Q(D) of all least partial answers to Q on D.
Example 1. Consider the ontology O that contains the TGDs</p>
    </sec>
    <sec id="sec-2">
      <title>Researcher(x) ! 9y HasO ce(x; y)</title>
    </sec>
    <sec id="sec-3">
      <title>HasO ce(x; y) ! O ce(y)</title>
    </sec>
    <sec id="sec-4">
      <title>O ce(x) ! 9y InBuilding(x; y)</title>
      <p>the schema S that consists of all relation symbols in O, and the CQ
q(x1; x2; x3) = Researcher(x1) ^ HasO ce(x1; x2) ^ InBuilding(x2; x3)
giving rise to OMQ Q(x1; x2; x3) = (O; S; q). Further consider the database</p>
      <p>D = f Researcher(mary); Researcher(mike); HasO ce(mary; room1) g
Then Q(D) = ;, but Q(D) = f(mary; room1; ); (mike; ; )g.</p>
      <p>
        This abstract reports about the forthcoming article [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ] where we consider
guarded TGDs G and the description logic E LI as the ontology language and
conjunctive queries (CQs) as the query language. Recall that, up to syntactic
normalization, E LI is a fragment of G. Our main result is as follows where
complete answers mean the traditional certain answers.
      </p>
      <p>Theorem 1. Let Q = (O; S; q) be an OMQ from the OMQ language (G; CQ).
If Q is acyclic and free-connex, then the following problems are in CD Lin:
1. enumeration of complete answers and of least partial answers to Q;
2. all-testing of complete answers to Q.</p>
      <p>Let us clarify the notions used in Theorem 1. A CQ q(x) is acyclic if it has a
join tree. An acyclic CQ q(x) is free-connex if it remains acyclic after adding an
atom R(x) with R a fresh relation symbol of arity jxj.</p>
      <p>The results for complete answers in Theorem 1 are obtained by reduction to
the case without ontologies whereas the result for least partial answers requires
the design of a novel enumeration algorithm.</p>
      <p>Theorem 1 is accompanied by lower bounds that identify signi cant
challenges in extending enumeration in CD Lin beyond OMQs that satisfy the
structural properties mentioned in the theorem. As in the case without ontologies,
these lower bounds (i) are conditional on certain assumptions whose failure would
imply a remarkable advance in algorithm theory and (ii) do not result in fully
edged dichotomies as they rely on additional assumptions regarding the query.
Enumerating Answers to OMQs</p>
      <p>
        The triangle conjecture states that it is not possible, given an undirected
graph G with m edges as an adjacency list, to decide in time O(m) whether G
contains a triangle [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. Sparse Boolean matrix multiplication means to compute,
given two Boolean matrices A and B as a list of their non-zero entries, the
nonzero entries of the matrix product AB over the Boolean semiring, see e.g. [
        <xref ref-type="bibr" rid="ref16">16</xref>
        ].
There is no known algorithm that solves sparse Boolean matrix multiplication
in time O(m), m the sum of the numbers of non-zero entries of A, B, and AB. If
such an algorithm exists, then nding it requires dramatic advances in algorithm
theory. See e.g. [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] for more information.
      </p>
      <p>Theorem 2. Let Q = (O; S; q) be an OMQ from the OMQ language (E LI; CQ)
that is non-empty and self-join free.
1. If q is not acyclic, then enumeration of Q is not in CD Lin unless the triangle
conjecture fails, both for complete answers and for least partial answers.
2. If q is connected and acyclic, but not free-connex, then enumeration of Q
is not in CD Lin unless sparse Boolean matrix multiplication is possible in
time O(m), both for complete answers and for least partial answers.
We also show that least partial answers cannot be added to Point 2 of Theorem 1
as there is an OMQ Q 2 (ELI; CQ) that is free-connex acyclic such that
alltesting least partial answers to Q is not in CD Lin unless the triangle conjecture
fails.</p>
      <p>Finally, enumeration and all-testing in CD Lin is closely related to
singletesting in linear time (in data complexity), and we also clarify the limits of
that.</p>
      <p>Theorem 3.
1. Single-testing is in linear time for weakly acyclic OMQs from (G; CQ).
2. Let Q be an OMQ from (E LI; CQ) that is non-empty and self-join free. If
Q is not weakly acyclic, single-testing for Q is not in linear time unless the
triangle conjecture fails.</p>
      <p>Here, a CQ q(x) is weakly acyclic if it becomes acyclic after consistently replacing
all answer variables with fresh constants (and thus the connectedness condition
of join trees only applies to quanti ed variables).</p>
      <p>Acknowledgements. This research was funded by DFG project QTEC. We
thank the anonymous reviewers for useful comments.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Abboud</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Williams</surname>
            ,
            <given-names>V.V.</given-names>
          </string-name>
          :
          <article-title>Popular conjectures imply strong lower bounds for dynamic problems</article-title>
          .
          <source>In: Proceedings of FOCS 2014</source>
          . pp.
          <volume>434</volume>
          {
          <fpage>443</fpage>
          . IEEE Computer Society (
          <year>2014</year>
          ). https://doi.org/10.1109/FOCS.
          <year>2014</year>
          .53
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Abiteboul</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hull</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Vianu</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          : Foundations of Databases. Addison-Wesley (
          <year>1995</year>
          ), http://webdam.inria.fr/Alice/
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Bagan</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Durand</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Grandjean</surname>
          </string-name>
          , E.:
          <article-title>On acyclic conjunctive queries and constant delay enumeration</article-title>
          . In: Duparc,
          <string-name>
            <given-names>J.</given-names>
            ,
            <surname>Henzinger</surname>
          </string-name>
          ,
          <string-name>
            <surname>T.A</surname>
          </string-name>
          . (eds.)
          <source>Proceedings of CSL 2007. Lecture Notes in Computer Science</source>
          , vol.
          <volume>4646</volume>
          , pp.
          <volume>208</volume>
          {
          <fpage>222</fpage>
          . Springer (
          <year>2007</year>
          ). https://doi.org/10.1007/978-3-
          <fpage>540</fpage>
          -74915-8 18
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Barcelo</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Dalmau</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Feier</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lutz</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pieris</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>The limits of e ciency for open- and closed-world query evaluation under guarded TGDs</article-title>
          . In: Suciu,
          <string-name>
            <given-names>D.</given-names>
            ,
            <surname>Tao</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            ,
            <surname>Wei</surname>
          </string-name>
          ,
          <string-name>
            <surname>Z</surname>
          </string-name>
          . (eds.)
          <source>Proceedings of PODS 2020</source>
          . pp.
          <volume>259</volume>
          {
          <fpage>270</fpage>
          .
          <string-name>
            <surname>ACM</surname>
          </string-name>
          (
          <year>2020</year>
          ). https://doi.org/10.1145/3375395.3387653
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Berkholz</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gerhardt</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Schweikardt</surname>
          </string-name>
          , N.:
          <article-title>Constant delay enumeration for conjunctive queries: a tutorial</article-title>
          .
          <source>ACM SIGLOG News</source>
          <volume>7</volume>
          (
          <issue>1</issue>
          ),
          <volume>4</volume>
          {
          <fpage>33</fpage>
          (
          <year>2020</year>
          ). https://doi.org/10.1145/3385634.3385636
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Berkholz</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Schweikardt</surname>
          </string-name>
          , N.:
          <article-title>Constant delay enumeration with fpt-preprocessing for conjunctive queries of bounded submodular width</article-title>
          . In: Rossmanith,
          <string-name>
            <given-names>P.</given-names>
            ,
            <surname>Heggernes</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            ,
            <surname>Katoen</surname>
          </string-name>
          ,
          <string-name>
            <surname>J</surname>
          </string-name>
          . (eds.)
          <source>Proceedings of MFCS 2019. LIPIcs</source>
          , vol.
          <volume>138</volume>
          , pp.
          <volume>58</volume>
          :
          <issue>1</issue>
          {
          <fpage>58</fpage>
          :
          <fpage>15</fpage>
          .
          <string-name>
            <surname>Schloss</surname>
          </string-name>
          Dagstuhl - Leibniz-Zentrum fur Informatik (
          <year>2019</year>
          ). https://doi.org/10.4230/LIPIcs.MFCS.
          <year>2019</year>
          .58
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Bienvenu</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>ten Cate</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lutz</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Wolter</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          :
          <article-title>Ontology-based data access: A study through disjunctive datalog, CSP, and MMSNP</article-title>
          .
          <source>ACM Trans. Database Syst</source>
          .
          <volume>39</volume>
          (
          <issue>4</issue>
          ),
          <volume>33</volume>
          :1{
          <fpage>33</fpage>
          :
          <fpage>44</fpage>
          (
          <year>2014</year>
          ). https://doi.org/10.1145/2661643
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Bienvenu</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ortiz</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>Ontology-mediated query answering with data-tractable description logics</article-title>
          . In: Faber,
          <string-name>
            <given-names>W.</given-names>
            ,
            <surname>Paschke</surname>
          </string-name>
          ,
          <string-name>
            <surname>A</surname>
          </string-name>
          . (eds.)
          <source>Proceedings of Reasoning Web. Lecture Notes in Computer Science</source>
          , vol.
          <volume>9203</volume>
          , pp.
          <volume>218</volume>
          {
          <fpage>307</fpage>
          . Springer (
          <year>2015</year>
          ). https://doi.org/10.1007/978-3-
          <fpage>319</fpage>
          -21768-0 9
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Carmeli</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          , Kroll, M.:
          <article-title>Enumeration complexity of conjunctive queries with functional dependencies</article-title>
          .
          <source>Theory Comput. Syst</source>
          .
          <volume>64</volume>
          (
          <issue>5</issue>
          ),
          <volume>828</volume>
          {
          <fpage>860</fpage>
          (
          <year>2020</year>
          ). https://doi.org/10.1007/s00224-019-09937-9
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Carmeli</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          , Kroll, M.:
          <article-title>On the enumeration complexity of unions of conjunctive queries</article-title>
          .
          <source>ACM Trans. Database Syst</source>
          .
          <volume>46</volume>
          (
          <issue>2</issue>
          ), 5:
          <issue>1</issue>
          {5:
          <issue>41</issue>
          (
          <year>2021</year>
          ). https://doi.org/10.1145/3450263
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Carmeli</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Zeevi</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Berkholz</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kimelfeld</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Schweikardt</surname>
          </string-name>
          , N.:
          <article-title>Answering (unions of) conjunctive queries using random access and random-order enumeration</article-title>
          . In: Suciu,
          <string-name>
            <given-names>D.</given-names>
            ,
            <surname>Tao</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            ,
            <surname>Wei</surname>
          </string-name>
          ,
          <string-name>
            <surname>Z</surname>
          </string-name>
          . (eds.)
          <source>Proceedings of PODS 2020</source>
          . pp.
          <volume>393</volume>
          {
          <fpage>409</fpage>
          .
          <string-name>
            <surname>ACM</surname>
          </string-name>
          (
          <year>2020</year>
          ). https://doi.org/10.1145/3375395.3387662
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>Deep</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hu</surname>
            ,
            <given-names>X.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Koutris</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          :
          <article-title>Enumeration algorithms for conjunctive queries with projection</article-title>
          . In: Yi,
          <string-name>
            <given-names>K.</given-names>
            ,
            <surname>Wei</surname>
          </string-name>
          ,
          <string-name>
            <surname>Z</surname>
          </string-name>
          . (eds.)
          <source>Proceedings of ICDT 2021. LIPIcs</source>
          , vol.
          <volume>186</volume>
          , pp.
          <volume>14</volume>
          :
          <issue>1</issue>
          {
          <fpage>14</fpage>
          :
          <fpage>17</fpage>
          .
          <string-name>
            <surname>Schloss</surname>
          </string-name>
          Dagstuhl - Leibniz-Zentrum fur Informatik (
          <year>2021</year>
          ). https://doi.org/10.4230/LIPIcs.ICDT.
          <year>2021</year>
          .14
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <string-name>
            <surname>Deep</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Koutris</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          :
          <article-title>Ranked enumeration of conjunctive query results</article-title>
          . In: Yi,
          <string-name>
            <given-names>K.</given-names>
            ,
            <surname>Wei</surname>
          </string-name>
          ,
          <string-name>
            <surname>Z</surname>
          </string-name>
          . (eds.)
          <source>Proceedings of ICDT 2021. LIPIcs</source>
          , vol.
          <volume>186</volume>
          , pp.
          <volume>5</volume>
          :
          <issue>1</issue>
          {5:
          <fpage>19</fpage>
          .
          <string-name>
            <surname>Schloss</surname>
          </string-name>
          Dagstuhl - Leibniz-Zentrum fur Informatik (
          <year>2021</year>
          ). https://doi.org/10.4230/LIPIcs.ICDT.
          <year>2021</year>
          .5
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          14.
          <string-name>
            <surname>Lutz</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Przybylko</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>Enumerating answers to ontology-meditated queries</article-title>
          . To appear on arXiv
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          15.
          <string-name>
            <surname>Segou n</surname>
          </string-name>
          , L.:
          <article-title>Constant delay enumeration for conjunctive queries</article-title>
          .
          <source>SIGMOD Rec</source>
          .
          <volume>44</volume>
          (
          <issue>1</issue>
          ),
          <volume>10</volume>
          {
          <fpage>17</fpage>
          (
          <year>2015</year>
          ). https://doi.org/10.1145/2783888.2783894
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          16.
          <string-name>
            <surname>Yuster</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Zwick</surname>
            ,
            <given-names>U.</given-names>
          </string-name>
          :
          <article-title>Fast sparse matrix multiplication</article-title>
          .
          <source>ACM Trans. Algorithms</source>
          <volume>1</volume>
          (
          <issue>1</issue>
          ),
          <volume>2</volume>
          {
          <fpage>13</fpage>
          (
          <year>2005</year>
          ). https://doi.org/10.1145/1077464.1077466
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>