<!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>A note on computing certain answers to queries over incomplete databases</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Marcelo Arenas</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Elena Botoeva</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Egor V. Kostylev</string-name>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Vladislav Ryzhikov</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Free University of Bozen-Bolzano</institution>
          ,
          <country country="IT">Italy</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Pontificia Universidad Cato ́lica de Chile</institution>
          ,
          <country country="CL">Chile</country>
        </aff>
        <aff id="aff2">
          <label>2</label>
          <institution>University of Oxford</institution>
          ,
          <country country="UK">UK</country>
        </aff>
      </contrib-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>The ability to handle incomplete information is fundamental in many areas, including
data integration, data exchange, inconsistent databases, and the Semantic Web. In such
areas, it is often impossible to describe the domain of interest in a full, comprehensive
way, so the aim of an incomplete database is to concisely represent a (potentially
infinite) number of completions. Incomplete information is usually represented by allowing
placeholders for unknown values, which are called “nulls”. An incomplete database I
with such nulls then represents a set of databases with complete information, called
representations of I, each of which is obtained by replacing nulls by actual values.</p>
      <p>
        One of the most important problems associated to databases is query answering.
Since an incomplete database I can have several representations, the aim in this context
is to find the “certain answers” to a query Q, that is, an incomplete database I0 that
precisely represents the answers to Q over all the representations of I. Unfortunately,
this is possible only in restricted settings, which allow for the so called strong
representation systems [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. To overcome this limitation, it was recently proposed in [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] the
idea of computing “certain answers as objects”. It is argued in [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] that we should aim
for finding an object (i.e., an incomplete database) representing the answers over the
representations of an incomplete database in the most informative way. More precisely,
informativeness in this context is formalised as the following preorder on incomplete
databases: I1 I2 if and only if each representation of I2 is a representation of I1, that
is, the more representations an incomplete database has, the less informative it is. Then
given a query Q over an incomplete database I, the certain answers as objects to Q over
I are defined as a greatest lower bounds under of the set of answers to Q over all the
representations of I.
      </p>
      <p>In this paper, we make initial steps in the study of the complexity of the problem of
computing certain answers as objects. In particular, we concentrate on the widely
studied setting of union of conjunctive queries with inequalities and incomplete databases
under the open-world assumption, and we provide positive and negative results. On the
positive side, we show that in this case the certain answers to a query can be
computed. On the negative side, we show that this computation can be costly, as the certain
answers can be of exponential size even if we restrict to conjunctive queries with
inequalities over binary relations.</p>
    </sec>
    <sec id="sec-2">
      <title>Preliminaries</title>
      <p>We assume countably infinite disjoint sets of constants, denoted by Const, and of nulls,
denoted by Null. A relational schema (or just schema) is a set of relation names with
associated arities. An incomplete database I over is an assignment of a k-ary relation
RI over (Const[Null) to each k-ary name R in . Sets of constants and nulls that occur
in I are denoted by Const(I) and Null(I), respectively, and their union, called an active
domain, is denoted by adom(I). A complete database is an incomplete database without
nulls. In what follows, we use I, I1, I2, I0, : : : to denote incomplete databases, and D,
D1, D2, D0, : : : to denote complete databases.</p>
      <p>
        The semantics of an incomplete database I is defined in terms of its representations,
which are complete databases that are considered as possible interpretations of I [
        <xref ref-type="bibr" rid="ref1 ref5">1, 5</xref>
        ].
To define this semantics, we need the following notion: a valuation on an incomplete
database I is a map v : adom(I) ! Const that is the identity on Const(I). Such
a mapping naturally extends to databases, so we write v(I) as well. Then, under the
open-world assumption, the set of representations of I, denoted by [[I]], is defined as
[[I]] = fD j D is a complete database and v(I) D for some valuation v of Ig: Note
that [[I]] 6= ; for every incomplete database I. An incomplete database I2 is at least
as informative as an incomplete database I1 [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ], denoted by I1 I2, if [[I2]] [[I1]].
Notice that is a preorder, that is, it is reflexive and transitive. Moreover, given an
incomplete database I and a set I of incomplete databases, I is a lower bound for I if
I I0 for every I0 2 I, and I is a greatest lower bound for I if I is a lower bound for
I and for every lower bound I0 for I, it holds that I0 I. The set of all greatest lower
bounds of I is denoted by glb(I).
      </p>
      <p>
        A homomorphism from an incomplete database I1 to an incomplete database I2 is
a function h : adom(I1) ! adom(I2) that is the identity on Const(I1) and such that
h(I1) I2 (we define h(I) analogously to v(I) before). We write I1 7! I2 if there
is a homomorphism from I1 to I2, and I1 7! I, for a set I of incomplete databases,
if I1 7! I2 for each I2 2 I. Then a characterization of is given by the following
statement [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]:
      </p>
      <p>I1</p>
      <sec id="sec-2-1">
        <title>I2 if and only if I1 7! I2:</title>
        <p>
          (1)
As customary, a query Q over a schema is a function that assigns to each complete
database D of a complete database Q(D). Moreover, given an incomplete database I,
the certain answers as object (or certain answers, for short) to Q over I, denoted by
cert(Q; I), is defined [
          <xref ref-type="bibr" rid="ref7">7</xref>
          ] as an incomplete database satisfying
cert(Q; I) 2 glb(ans(Q; I));
        </p>
        <p>where ans(Q; I) = fQ(D) j D 2 [[I]]g:
Notice that two greatest lower bounds I1, I2 of ans(Q; I) are equivalent in terms of the
information ordering: I1 I2 and I2 I1; thus, we can choose any greatest lower
bound of ans(Q; I) as the certain answer to Q over I.
3</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>Computing Certain Answers</title>
      <p>
        In this section, we focus on the problem of computing cert(Q; I) for a union of
conjunctive queries Q with inequalities (UCQ6=) and an incomplete database I. It is assumed
that a reader is familiar with the syntax of such queries as well as their semantics (i.e.,
the definition of Q(D)). Complete proofs of the results below can be found in [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ].
      </p>
      <p>The first issue we have to deal with when computing cert(Q; I) is the fact that
ans(Q; I) may be infinite. The following proposition overcomes this limitation by
showing that it is not necessary to consider the entire set ans(Q; I) when computing
cert(Q; I), but instead one can consider just a finite subset of it.</p>
      <p>Proposition 1. Let Q be a UCQ6= over a schema and I an incomplete database over
. Then there exists D ans(Q; I) such that D is finite and cert(Q; I) is a greatest
lower bound of D.</p>
      <p>In fact, from the proof of Proposition 1, it is possible to obtain a simple
exponentialtime algorithm that, given a UCQ6= Q and an incomplete database I, returns a set D
ans(Q; I) such that cert(Q; I) 2 glb(D), where each D 2 D is of linear size in the size
of I. We denote such D by anscan(Q; I).</p>
      <p>
        Now, given a finite set D, it is known (see, e.g., [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ], [6, Proposition 5], or [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]) that
a greatest lower bound of D with respect to the relation 7! and, by (1), to the relation
can be computed via the (direct) product of the databases in D, which is defined as
follows. Let I1 and I2 be incomplete databases over a schema . The product I1 I2
is a database I such that, for each k-ry relation R in ,
      </p>
      <p>RI = f a1
b1; : : : ; ak</p>
      <p>bk j (a1; : : : ; ak) 2 RI1 ; (b1; : : : ; bk) 2 RI2 g;
here a a = a for all a 2 Const [ Null and a b is a fresh null na;b for all different
a; b 2 Const [ Null. It immediately follows that Const(I) Const(I1) \ Const(I2).
Note that the product is associative and commutative (up to renaming of nulls). For
D = fD1; : : : ; Dng, we denote by Q D the product D1 Dn. The following
picture illustrates this notion for a schema consisting of a single binary relation:
a</p>
      <p>b
c
I1
a
b
I2
nb;a</p>
      <p>a
nc;b</p>
      <p>I1</p>
      <p>I2
na;b
b
nc;a
By combining Proposition 1 with the algorithm for computing anscan(Q; I), we obtain
an algorithm for computing a certain answer.</p>
      <p>Proposition 2. Let Q be a UCQ6= over a schema and I and incomplete database
over . Then cert(Q; I) can be computed as Q anscan(Q; I).</p>
      <p>Finally, in the following theorem, which is the main result of this note, we prove
that the certain answers as objects can be of exponential size, even if we restrict to the
case of conjunctive queries over binary relations.</p>
      <p>Theorem 1. There exists a family of incomplete databases In, for n 2 N, and a
conjunctive query Q with inequality such that the size of the smallest cert(Q; In) grows
exponentially in the size of In.</p>
      <p>Proof. (Sketch) For a natural number m, consider the complete database</p>
      <p>Zm = fZ(d1; d2); : : : ; Z(dm 1; dm); Z(dm; d1)g;
where d1; d2; : : : ; dm are (distinct) constants, encoding a directed cycle of length m.</p>
      <p>Let n be a natural number, and let p1; : : : ; pn be the first n prime numbers. We
define In to be the incomplete database containing
– disjoint cycles Zp1 ; : : : ; Zpn ,
– for a constant ai, i = 1; ::; n, the pairs R(ci; ai) for each constant ci in Zpi ,
– for constants b1 and bn, the pairs P (a1; b1) and P (an; bn), and
– for nulls l1; : : : ; ln 1, the pairs P (ai; li) and P (ai+1; li) for 1 i n 1.
Below we depict I5:</p>
      <p>Z2 Z3 Z5 Z7 Z11
P
a1
b1</p>
      <p>R
a2</p>
      <p>R
a3</p>
      <p>R
a4</p>
      <p>R
P</p>
      <p>P
l1</p>
      <p>P</p>
      <p>P
l2</p>
      <p>P</p>
      <p>P
l3</p>
      <p>P</p>
      <p>P
l4</p>
      <p>R
a5</p>
      <p>P
b5
Consider the query
Q(x; y) = 9z(Z(x; y) ^ R(x; z) ^ R(y; z) ^ Q6=(z));
where</p>
      <p>Q6=(z) = 9u9v(P (z; u) ^ P (z; v) ^ (u 6= v)):</p>
      <sec id="sec-3-1">
        <title>We can show the following property:</title>
        <p>(minimal) each binary relation Cpi = f(c; d) j Z(c; d) 2 Zpi g, for 1 i
ans(Q; In), and any other relation in ans(Q; In) subsumes one of them.
Let Zn = fCp1 ; : : : ; Cpn g. We define a directed cycle of nulls of size p1
n, is in
pn
Z
= fZ(n1; n2); : : : ; Z(np1
pn 1; np1
pn ); Z(np1
pn ; n1)g:</p>
      </sec>
      <sec id="sec-3-2">
        <title>We can prove two claims.</title>
        <p>Claim. Any of certain answers cert(Q; In) is in glb(Zn).</p>
        <sec id="sec-3-2-1">
          <title>Claim. Set Z is in glb(Zn).</title>
          <p>The proof of the claims relies on (minimal), while the construction of Z and the
proof of the second claim rely on the fact that Cpi are cycles of prime length. Indeed,
Z is (isomorphic to) the product of all Cpi , as the product of a pair of directed cycles
of sizes k1 and k1, when k1 and k2 are co-prime numbers, is a directed cycle of the size
k1 k2.</p>
          <p>
            From the above claims, it follows that Z and cert(Q; In) are homomorphically
equivalent. It is well-known from graph theory that every graph that is homomorphically
equivalent to a directed cycle has to contain that cycle. Hence, the minimal certain
answer cert(Q; In) is of exponential size in the size of In. (We observe that the size of
In is polynomially bounded in n, as pn &lt; cn2, for a constant c [
            <xref ref-type="bibr" rid="ref2">2</xref>
            ].) tu
          </p>
        </sec>
      </sec>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <given-names>S.</given-names>
            <surname>Abiteboul</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Hull</surname>
          </string-name>
          , and
          <string-name>
            <given-names>V.</given-names>
            <surname>Vianu</surname>
          </string-name>
          .
          <source>Foundations of Databases. Addison-Wesley</source>
          ,
          <year>1995</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <given-names>T. M.</given-names>
            <surname>Apostol</surname>
          </string-name>
          . Introduction to Analytic
          <source>Number Theory</source>
          . Springer-Verlag, New York,
          <year>1976</year>
          . Undergraduate Texts in Mathematics.
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <given-names>M.</given-names>
            <surname>Arenas</surname>
          </string-name>
          ,
          <string-name>
            <given-names>E.</given-names>
            <surname>Botoeva</surname>
          </string-name>
          ,
          <string-name>
            <given-names>E. V.</given-names>
            <surname>Kostylev</surname>
          </string-name>
          , and
          <string-name>
            <given-names>V.</given-names>
            <surname>Ryzhikov</surname>
          </string-name>
          .
          <article-title>A note on computing certain answers to queries over incomplete databases (extended version)</article-title>
          .
          <source>Technical report</source>
          ,
          <year>2017</year>
          . Available at http://marenas.sitios.ing.uc.cl/publications/amw17-ext.pdf.
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <given-names>C.</given-names>
            <surname>Chang</surname>
          </string-name>
          and
          <string-name>
            <given-names>H.</given-names>
            <surname>Keisler</surname>
          </string-name>
          .
          <source>Model Theory</source>
          . North-Holland, Amsterdam,
          <year>1990</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <given-names>T.</given-names>
            <surname>Imielinski</surname>
          </string-name>
          and
          <string-name>
            <given-names>W. Lipski</given-names>
            <surname>Jr</surname>
          </string-name>
          .
          <article-title>Incomplete information in relational databases</article-title>
          .
          <source>J. ACM</source>
          ,
          <volume>31</volume>
          (
          <issue>4</issue>
          ):
          <fpage>761</fpage>
          -
          <lpage>791</lpage>
          ,
          <year>1984</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <given-names>L.</given-names>
            <surname>Libkin</surname>
          </string-name>
          .
          <article-title>Incomplete information and certain answers in general data models</article-title>
          .
          <source>In Proc. of the 30th ACM Symp. on Principles of Database Systems (PODS)</source>
          , pages
          <fpage>59</fpage>
          -
          <lpage>70</lpage>
          ,
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <given-names>L.</given-names>
            <surname>Libkin</surname>
          </string-name>
          .
          <article-title>Certain answers as objects and knowledge</article-title>
          . Artif. Intell.,
          <volume>232</volume>
          :
          <fpage>1</fpage>
          -
          <lpage>19</lpage>
          ,
          <year>2016</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <given-names>B. ten</given-names>
            <surname>Cate</surname>
          </string-name>
          and
          <string-name>
            <given-names>V.</given-names>
            <surname>Dalmau</surname>
          </string-name>
          .
          <article-title>The product homomorphism problem and applications</article-title>
          .
          <source>In Proc. of the 18th International Conference on Database Theory (ICDT</source>
          <year>2015</year>
          ), pages
          <fpage>161</fpage>
          -
          <lpage>176</lpage>
          ,
          <year>2015</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>