<!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>Consistent Query Answering in Data Warehouses</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Leopoldo Bertossi</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Loreto Bravo</string-name>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Mo´ nica Caniupa´ n</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Carleton University</institution>
          ,
          <country country="CA">Canada</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Universidad de Bio-Bio</institution>
          ,
          <country country="CL">Chile</country>
        </aff>
        <aff id="aff2">
          <label>2</label>
          <institution>Universidad de Concepcio ́n</institution>
          ,
          <country country="CL">Chile</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>A Data Warehouse (DW) is a data repository that organizes and physically integrates data from multiple sources under special kinds of schemas. A DW is composed by a set of dimensions that re ect the way the data is structured, and the facts that correspond to quantitative data related with the dimensions. A dimension schema is a hierarchical graph of categories. A dimension instance is strict if every element of the dimension has a unique ancestor element in each of the ancestor categories. This property is crucial for the ef ciency of the system since it allows for the correct computation of aggregate queries using pre-computed views. A dimension instance may become non-strict after update operations. When this happens, the instance can be minimally repaired in several ways. In this paper we characterize consistent answers to aggregate queries by means of smallest ranges that contain the answers obtained from every minimal repair. We also introduce the notion of canonical dimension which captures information about all the minimal repairs. We use this dimension to approximate consistent query answers.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>
        Data Warehouses (DWs), or more generally, multidimensional databases, are data
repositories that integrate data from different sources, and keep historical data for analysis
and decision support [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]. DWs represent data according to dimensions and facts. The
former re ect the perspectives from which data are viewed, and we may have several
of them. The latter corresponds to data (also known as measures) which are generally
quantitative and are associated to the different dimensions.
      </p>
      <p>Facts can be aggregated, ltered and referenced using the dimensions. As an
illustration, the facts related to the sales of a company may be associated to the dimensions
time and location, and should be understood as the sales at certain locations in certain
periods of time. A dimension schema is usually a hierarchical lattice of category names.
A dimension instance for the schema assigns sets or extensions to the category names,
and also imposes a lattice like structure between elements of different categories.</p>
      <p>As an example, the dimension time could be represented by the schema: date!month
!year. The multidimensional structure of a DW allows users to formulate aggregate
queries at different levels of granularity.</p>
      <p>Example 1. A company that manages an online Chilean phone call repository created a
Phone Traf c DW, with dimensions Time and Phone with the schema shown in Figure
1(a). In the Time dimension, each Date is associated to a Month and each month is
associated to a Year which is associated to a category All. On the other hand, in the Phone
dimension, each Number is associated to an AreaCode and to a City. Both AreaCode
and City are connected to a Region. The top category is All.</p>
      <p>All
Year
Month
Date</p>
      <p>All</p>
      <p>Region
AreaCode City</p>
      <p>Number</p>
      <p>Region</p>
      <p>all</p>
      <p>IX VIII</p>
      <p>N1 N2 N3
AreaCode</p>
      <p>City
TCH TEM CCP</p>
      <p>Number</p>
      <p>N1
N2
N3
N1
N2
N3</p>
      <p>Calls</p>
      <p>Date In Out
Jan 1,07 3 0
Jan 1,07 2 1
Jan 1,07 5 5
Jan 2,07 8 0
Jan 2,07 0 3
Jan 2,07 5 1
(a) Dimensions schemas
(b) Phone dimension instance</p>
      <p>
        (c) Fact table
Generally, a dimension (instance) is required to be strict, this is, every element of a
category should reach no more that one element in each ancestor category [
        <xref ref-type="bibr" rid="ref13 ref17">17, 13</xref>
        ]. For
example, in the Phone Traf c DW, we expect this property to hold since each number
should be associated with a unique city, region and area code. If a dimension instance
satis es its strictness constraint, we say that it is consistent. If dimensions are stored as
relational tables, strictness can be imposed by a set of functional dependencies over the
tables, as the following example shows.
      </p>
      <p>
        Example 2. The dimension instance in Figure 1 (b) is strict, since, as expected, every
number rolls-up to a unique area code, city and region. On the other hand, dimension
in Figure 2 is not strict since now element N3 rolls-up to both IX and VIII in category
Region which shows that the data is not accurate and also implies that pre-computed
answers at the level of AreaCode and City cannot be used to compute answers for
Region. The relational table in Figure 2 maps the edges between the elements of categories
Number and Region. Since the functional dependency of Region upon Number does not
hold in that table, the dimension instance is not strict. 2
Dimensions that are strict and homogenous (cf. Section 2) allow for the correct use of
pre-computed answers at low level categories to compute aggregate queries at higher
levels. Thus, query answering over strict dimensions increases ef ciency of DWs [
        <xref ref-type="bibr" rid="ref22">22</xref>
        ].
Even though strictness is important, DWs do not enforce it, and a dimension might
become non-strict after an update performed to adapt to changes in data sources or
modi cations to the business rules [
        <xref ref-type="bibr" rid="ref14 ref15 ref20">15, 14, 20</xref>
        ]. In an enterprise DW, with possibly
terabytes of data [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ], ensuring strictness of dimensions may be vital for ef cient query
answering and keeping the data clean.
      </p>
      <p>
        In [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] the concept of minimal repair is formalized, as a strict dimension instance
that minimally differs from the given one by a minimum number of changes. Also logic
programs to specify and compute them are provided. In that work, the focus is on how
all
to aid the developer or administrator to restore consistency by nding a single repair.
However, there might be several alternative repairs, and it is not always possible to
know which one is the desirable one.
      </p>
      <p>Here we focus on answering aggregate queries that involve inconsistent dimension
instances. In order to obtain semantically meaningful answers, we use the class of all
minimal repairs to provide a minimal numerical range to which the answer to the query
should belong. With this kind of answer we capture information that is shared by, or
invariant under, the minimal repairs of the original instance.</p>
      <p>
        This is a form of consistent query answering (CQA) [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ], a problem that has been
investigated in the relational setting (cf. [
        <xref ref-type="bibr" rid="ref5 ref8">5, 8</xref>
        ] for recent surveys). In this paper, a
consistent answer to an aggregate query captures through an interval the answers to the same
query that would be obtained from each of the minimal repairs if they were
materialized. We also introduce the notion of a canonical dimension instance for the original,
possibly inconsistent, dimension instance, and we show how to obtain it. This
dimension captures information about all the minimal repairs, and can be used to approximate
the consistent query answers.
      </p>
      <p>The rest of the paper is organized as follows: Section 2 presents the
multidimensional model. Next, Section 3 de nes repairs of dimension instances and consistent
query answer to aggregate queries. Section 4 presents the canonical dimension instance.
Related work and some conclusions are discussed in Section 5. This paper presents
some initial and ongoing research on dealing with inconsistent DW dimensions.
2</p>
    </sec>
    <sec id="sec-2">
      <title>The Multidimensional Model</title>
      <p>
        In this section we present the multidimensional database model that we use as the
basic framework for our research. It is described in detail in [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ]. A dimension schema
S consists of a pair (C; %), where C is a set of categories, and % is a child/parent
relation between categories. The dimension schema can be also represented with a
directed acyclic graph where the vertices correspond to the categories and the edges to
the child/parent relation. The transitive and re exive closure of % is denoted by % .
There are no shortcuts in the schemas, this is, if Ci % Cj there is no category Ck such
that Ci % Ck and Ck % Cj . Every dimension schema contains a distinguished top
category called All which is reachable from all other categories, i.e. for every C 2 C,
C% All. The leaf categories are called bottom categories. To simplify the presentation
and without loss of generality, we assume categories do not have attributes, and schemas
have a unique bottom category.
      </p>
      <p>Example 3. The Phone dimension schema S = (C; %) of Figure 1(a) is de ned by:
C=fNumber, AreaCode, City, Region, Allg, %= f(Number, AreaCode), (Number, City),
(AreaCode, Region), (City, Region), (Region, All)g. The relation % is % [ f(Number,
Number), (Number, Region), (Number, All), : : : g. The bottom category is Number, and
its ancestors are AreaCode, City, Region, and All. 2
A dimension (instance) D over a dimension schema S = (C; %) is a tuple (M; &lt;), such
that: (i) M is a nite collection of ground atoms of the form C(a) where C 2 C and a
is a constant. If C(a) 2 M, a is said to be an element of C. The constant all is the only
element of category All. Categories are assumed to be disjoint, i.e. if Ci(a); Cj (a) 2 M
then i = j. There is a function that maps elements to categories so that (a) = Ci
iff Ci(a) 2 M. (ii) The relation &lt; contains the child/parent relationships between
elements of different categories, and is compatible with %: If a &lt; b, then (a) % (b).
We denote with &lt; the re exive and transitive closure of &lt;.</p>
      <p>The roll-up relation between categories Ci and Cj , denoted RCCij (D) consists of the
set of pairs f(a; b) j Ci(a); Cj (b) 2 M and a &lt; bg. When the dimension is clear from
the context, we denote the roll-up relation simply by RCCij .</p>
      <p>
        A dimension instance D is said to be homogeneous [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ] if, for every pair of
categories Ci % Cj and element a in Ci, there is an element b in Cj such that a &lt; b. In
what follows we restrict ourselves to homogeneous dimensions. Moreover, a dimension
D = (M; &lt;) is strict if, for every different elements a, b, c with a &lt; b and a &lt; c,
it holds (b) 6= (c) [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ]. In other words, strictness ensures that every relation &lt;
between two categories is functional. In the paper, we will say that a dimension instance
is inconsistent if it is not strict.
      </p>
      <p>Example 4. The dimension instance in Figure 1(b) is de ned over the Phone dimension
schema in Figure 1(a), and consists of:
M = fNumber(N1), Number(N2), Number(N3), AreaCode(45), AreaCode(41),</p>
      <p>City(TCH), City(TEM), City(CCP), Region(IX), Region(VIII), All(all)g,
&lt; = f(N1,41), (N2,45), (N3,41), (N1,TCH), (N2,TEM), (N3,CCP), (45,IX), (41,VIII),
(TCH,VIII), (TEM,IX), (CCP,VIII), (IX,all), (VIII,all)g.</p>
      <p>Relation &lt; contains all the elements in &lt; plus others, such as (N1,N1) and (N1,VIII).</p>
      <p>The dimension instance in Figure 1(b) is both homogeneous and strict. In
comparison, the dimension instance in Figure 2 is homogeneous, but not strict since N3 rolls-up
to both IX and VIII in category Region. 2
A dimension instance is sumarizable if it allows to compute answers to aggregate
queries using other pre-computed queries. As an illustration, consider the DW in Figure
1, the query that request the number of calls grouped by Region, can be computed by
using pre-computed answers at category AreaCode or City, if any. This will be more
ef cient since the pre-computed tables will be smaller than the fact tables.</p>
      <p>
        A dimension is summarizable if it is both homogeneous and strict [
        <xref ref-type="bibr" rid="ref17">17</xref>
        ].4 Due to
our homogeneity assumption, to ensure summarizability we only need strictness. For
instance, the dimension instance in Figure 1(b) is summarizable since it is homogeneous
and strict. In contrast, the dimension instance in Figure 2 is not summarizable since it
is not strict. If a DW is not summarizable, it will either return incorrect answers if
4 A requirement for summarizability which is not related to the dimension but to the query is that
only distributive aggregate functions should be used (e.g. MAX, MIN, SUM, and COUNT).
using pre-computed views, or it will lose ef ciency by needing to compute the answers
starting from the bottom category.
3
      </p>
    </sec>
    <sec id="sec-3">
      <title>Repairs and Consistent Query Answering</title>
      <p>
        In this section we rst introduce the concept of minimal repair [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ], and next, we de ne
consistent query answers using minimal repairs as a basis. Intuitively, a minimal repair
is a new instance that is strict and is obtained by a minimum number of changes to the
original roll-up relation. To compare different repairs, we use the distance between the
given inconsistent instance and its repairs.
      </p>
      <p>Let D =(M; &lt;D) and D0 =(M; &lt;D0 ) be dimension instances over the same schema
S. The distance between D and D0 is de ned as dist(D; D0) = j(&lt;D0 r &lt;D) [
(&lt;D r &lt;D0 )j, i.e. the cardinality of the symmetric difference between the two
rollup relations. Now, we de ne the notions of repair and minimal repair.</p>
      <p>
        De nition 1. [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] Given a dimension instance D = (M; &lt;) over a schema S: (i) a
repair of D is a dimension instance D0 = (M0; &lt;0) over S, such that D0 is strict and
M0 = M; (ii) a minimal repair of D is a repair D0, such that dist(D; D0) is minimal
among all the repairs of D. (iii) Rep(D) denotes the class of minimal repairs of D. 2
Notice that a repair D0 of a dimension D contains the same elements as D. This
restriction is necessary since otherwise a repair could contain less elements in the bottom
category, and therefore, data from the fact tables would be lost in the aggregations. On
the other hand, repairs do not introduce new elements into a category. These new
elements would have no clear meaning, and would not be useful when posing aggregate
queries over the categories that contain them. For example, it is not clear what is the
meaning of an element in a category Month.
      </p>
      <p>
        Example 5. The dimension instances in Figure 3 are repairs of the non-strict dimension
instance D in Figure 2. All the repairs are obtained from D by performing insertions
and/or deletions of edges. For example, D1 is generated by deleting edge (CCP,VIII)
and inserting (CCP,IX). The distances between the repairs and the original dimension
instance D are: (a) dist(D; D1) = j(CCP,IX), (CCP,VIII)j = 2. (b) dist(D; D2) =
j(N3,41), (N3,45)j = 2. (c) dist(D; D3) = j(N3,TEM), (N3,CCP)j = 2. (d) dist(D; D4) =
j(45,VIII), (TEM,VIII), (45,IX), (TEM,IX)j = 4. Dimensions D1; D2; D3 are minimal
repairs since they are closer to D than D4. 2
Notice that we restore consistency by deleting or inserting edges between elements in
directly connected categories. Also, we use a cardinality-based repair semantics instead
of the set-inclusion-based [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ], which is more common in the relational case. This is
because, we assume that inconsistencies arise from a minimal number of errors and
thus repairing using cardinality based repairs is more natural. As an illustration, all the
repairs in Figure 3 would be minimal repairs under the set inclusion approach, since
none of the set differences is a subset of other. In particular dimension D4 would be a
minimal repair even though it is not really a good repair. Indeed, it modi es not only
the roll-ups of N3 (which is involved in the inconsistencies), but changes the roll-ups of
number N2 which is not even directly involved in the inconsistencies.
      </p>
      <p>
        As established in [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ], there always exists a repair of a dimension D = (M; &lt;); and
in every minimal repair D0 = (M; &lt;0), it holds j&lt;0 j j&lt;j. If an instance is already
strict, then it is its only minimal repair.
      </p>
      <p>
        all
The most common aggregate queries in DWs are those that perform grouping by
the values of a set of attributes, and return a single aggregate value per group:
SELECT Aj, : : : An, f(A) Aj,: : : An are attributes of the fact table T or the
rollFROM T, Ri, : : : Rm up functions Ri, : : : Rm (treated as tables), and f is
WHERE conditions one of min(A), max(A), count(A), sum(A), avg(A),
apGROUP BY Aj , : : : An plied to attribute A, with A \ fAj, : : : Ang= ;.
Intuitively, a consistent answer to one of those queries will be a range for each group that
contains the aggregation values obtained from all the minimal repairs. This de nition
is based on and extends the notion of consistent answer to a scalar (i.e. group-by free)
aggregate query presented in [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ].
      </p>
      <p>
        De nition 2. Given a dimension instance D and an aggregate query Q, a tuple of the
form ht1; : : : ; tn; [a; b]i is a consistent answer to query Q if: (i) [a; b] is a numerical
interval; (ii) for every minimal repair D0 of D tuple ht1; : : : ; tm; f (t1; : : : ; tn)i is an
answer to Q in D0 and f (t1; : : : ; tn) 2 [a; b]; and (iii) there is no smaller interval [a0; b0]
for which condition (ii) holds. 2
The non-aggregate portion ht1; : : : ; tni of a consistent answer contains the values for
the attributes in the SELECT clause (which are the same as in the GROUP BY clause), and
is a consistent answer in the usual, non-aggregate, sense [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. If the query is scalar, we
have a single numerical interval, without an associated tuple. The extreme values of the
consistent interval [a; b] are called, respectively, the greatest lower bound answer (glb)
and the least upper bound answer (lub) to Q for ht1; : : : ; tmi in D. If a = b, then the
interval can be represented as [a], or simply a. In particular, if the instance is consistent,
the intervals will be all of this form.
      </p>
      <p>Example 6. Consider the non-strict dimension in Figure 2 of the ongoing example, and
the following roll-up tables:
Q: SELECT R.City, SUM(C.In)</p>
      <p>FROM Calls C, RNCiutymber R RNCiutymber(D1) RNCiutymber(D2) RNCiutymber(D3)
WHERE C.Number = R.Number N1 TCH N1 TCH N1 TCH</p>
      <p>AND C.Out&lt;10 N2 TEM N2 TEM N2 TEM</p>
      <p>GROUP BY R.City N3 CCP N3 CCP N3 TEM
The answers to the query above are: hTCH,11i, hTEM,2i, hCCP,10i in repairs D1 and D2,
and hTCH,11i, hTEM,12i in D3. Thus, the consistent answers to Q are hTCH,11i,hTEM,
[2; 12]i. City CCP is in the answers from repairs D1 and D2 but not from D3, therefore
there is no consistent answer for it. 2
A cuboid query is an aggregate query where the selections in the WHERE condition
involve only attributes of the fact table and joins involve any attribute. This type of
queries are the most common in DWs and correspond to posing an aggregate query in
the fact table and then aggregating to a certain level of the dimension. The query in
Example 6 is cuboid since the selection condition C.Out&lt;10 refers to an attribute of the
fact table. In what follows, we will concentrate in this type of queries.</p>
      <p>
        In [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ], it was proved that CQA for scalar aggregate queries under functional
dependencies may be intractable. We can also expect intractability in our framework.
Proposition 1. There is an aggregate query with COUNT over an attribute such that
deciding if the glb of the consistent answer is not greater than a given integer is
NPhard.
      </p>
      <p>Proof. We reduce the NP-complete Hitting Set Problem (HSP) hS; ki to our problem.
Here S is a collection S1; : : : ; Sm of subsets of a base set S, and k 2 N. We have to
decide if there is a subset S(k) with jS(k)j k and jS(k) \Sij = 1, for every i. The schema
contains the categories Set, Element, and All with Set % Element % All. The following
dimension D is constructed: M = fSet(i) j i = 1; : : : ; mg [ fElement(x) j x 2 Sg,
and &lt; = f(i; x) j x 2 Sig. This dimension may not be strict if one of the Si
contains more that one element. In this case, minimal repairs are obtained by edge
deletions only. The HSP has a positive solution iff glb(SELECT COUNT(R.Element) FROM
RESleetmentR) k. 2
4</p>
    </sec>
    <sec id="sec-4">
      <title>The Canonical Dimension</title>
      <p>It may be expensive to compute consistent answers by querying all the minimal repairs,
which would be a naive approach directly inspired by the de nition of consistent
answer. A good alternative would be to nd a new dimension instance that represents the
repairs, in the sense that by querying it, at least an approximation to the consistent
answers can be computed. A possible choice could be the core dimension, that contains
the intersection of the roll-up relations of all the possible minimal repairs.</p>
      <p>The core dimension of the ongoing example is shown in Figure 4(a). It does not
conform to the original schema, since elements N3 and CCP do not have any ancestors.
Furthermore, the information of number N3 stored in the fact table will be lost.</p>
      <p>An alternative to the core could be a new dimension constructed from the repairs by
isolating the elements involved in inconsistencies. For example, if an element a rolls-up
to b1 in a repair, and to b2 in another, in the canonical dimension, we can add an element
fb1,b2g to which element a rolls up to.</p>
      <p>De nition 3. Given a dimension instance D over schema S, the set of repair parents in
category C for an element a is: RD(a,C) = fb j (b) = C; and there exists (M; &lt;Di )
in Rep(D) such that a &lt;Di bg. 2
The repair parents consist of the elements to which element a rolls-up to in category
C in some repair of D. If an element a does not roll up to the same element in C in
all the repairs, i.e. jRD(a; C)j &gt; 1, the roll-up relation between a and category C is
involved in an inconsistency. On the other hand, D = (M; &lt;) de ned over S = (C; %)
is consistent iff for every a 2 M and C 2 C, it holds that RD(a; C) 1.</p>
      <p>all</p>
      <p>all</p>
      <p>IX VIII fVIII,IXg
De nition 4. Given a dimension instance D = (M; &lt;D) over schema S, the
canonical dimension, denoted Canonical (D), is a dimension instance (M0; &lt;0) over S
constructed as follows:
Intuitively, the canonical dimension separates the elements involved in inconsistencies
from the ones that are not. The domain of the canonical dimension differs from the
one of the original instance, but still conforms to the same schema. Notice also that the
bottom categories will always have the same elements as the inconsistent instance, and
therefore, the same fact tables can be used.</p>
      <p>The consistent query answers to a query Q from D can be approximated by means of
a form of composition of answers to Q obtained from Canonical (D). We will illustrate
the process by means of our running example.</p>
      <p>Example 7. Figure 4(b) shows the canonical dimension of the Phone dimension (we
omit braces from singletons). In it, N3 rolls up to element fTEM,CCPg since it rolls up
to TEM in repair D3, and to CCP in repairs D1 and D2. The element fTEM,CCPg and
the edge (N3,fTEM,CCPg) are added to the canonical dimension in step (i). The edge
(fTEM,CCPg, fVII,IXg) is inserted into the canonical dimension in step (ii).</p>
      <p>In the canonical dimension, the roll-up table RPChityone contains f(N1, TCH), (N2,
TEM), (N3, fTEM,CCPg)g. This is the roll-up table we have to use to answer to query
Q in Example 6 from the canonical dimension. In this case, the answers are: hTCH,11i,
hTEM,2i, hfTEM,CCPg,10i.</p>
      <p>Now we will combine these answers as follows. The answers tell us that there were
2 incoming calls to TEM that we are sure of, and 10 calls that could have originated in
TEM or in CCP. Thus, we know the number of incoming calls to TEM is in the range
[2; 12]. In the case of TCH, there is no uncertainty about the number of calls, which are
11. Now, for city CCP there are no incoming calls that we are sure of, therefore, that
city is not part of the consistent answers.</p>
      <p>In this way we obtain the following composite answers to Q from the canonical
dimension: hTCH ,11i, hTEM,[2; 12]i. They can be used to approximate the consistent
answers. Actually, in this case, they coincide. 2
D</p>
      <p>C
d
A</p>
      <p>all</p>
      <p>all</p>
      <p>all</p>
      <p>all
In this example, since the canonical dimension is strict, the answers obtained from it
will be the same independently of the use of pre-computed answers. However, it could
be the case that the canonical dimension is not strict. In this case, answers obtained
using pre-computed answers may differ from the ones obtained without them, but still
will approximate the consistent answers as the following example shows.
Example 8. Consider the inconsistent dimension in Figure 5, the fact table Facts(A,N)
= f(a1,1), (a2,2), (a2,2), (a1,2)g and the cuboid query Q': SELECT R.C, SUM(Facts.N)
FROM Facts, RAC R WHERE Facts.A = R.A GROUP BY R.C. The consistent answer to
Q' obtained from repairs D1 and D2 is hc1; 7i.</p>
      <p>In the repairs , element a2 rolls-up to different elements in category B but to the
same element in category C. As a result, the canonical dimension (shown in Figure
5(d)) is not strict. The answers obtained from the canonical dimension without using
pre-computed answers are hc1; 7i; hfc1c2g; 4i which results in the composite answer
hc1; [7; 11]i. On the other hand, by using pre-computed answers from category D we
get hc1; 7i; which is also the composite answer. By using the pre-computed answers
from B we get hc1; 3i; hfc1c2g; 4i which results in the composite answer hc1; [3; 7]i.</p>
      <p>As it can be observed, all the composite answers can be used as approximation of
the consistent answers since they all contain the consistent interval. 2</p>
      <p>The following result holds to queries with aggregate functions SUM and COUNT
over fact tables with non-negative measures.</p>
      <p>Proposition 2. Let D be a dimension, and ht1; : : : ; tn; [a; b]i a consistent answer to a
cuboid query Q with aggregation functions SUM or COUNT from D. If ht1; : : : ; tn; [c; d]i
is obtained from the answers to Q from Canonical (D), then c a and d b. 2
The edges between singletons in the canonical dimension correspond to the portion of
the inconsistent dimension that is part of all the repairs, and therefore, the values
aggregated through them will always be the same or less than the glb of the consistent answer.
On the other hand, all the bottom elements that roll-up to an ancestor element c in the
inconsistent dimension, will roll-up in the canonical dimension, through all alternative
paths of categories in the schema, to an element that contains c. As a consequence, the
lub will always be contained in the range obtained from the canonical. Thus, for cuboid
queries with SUM or COUNT, the ranges of the consistent answers are contained in those
obtained using the canonical dimension.</p>
      <p>The consistent answers to queries with aggregate functions MIN and MAX can also
be approximated by means of a slightly different composition of the answers obtained
from the canonical instance.</p>
      <p>It relevant to note, that even though there might be an exponential number of repairs,
the size of the canonical dimension is polynomially bounded by the size of the
nonstrict dimension instance. This is a consequence of two different observations. First, the
dimension instance D and the canonical dimension Canonical (D) have both the same
bottom elements. Second, the number of extra elements in a category C of the canonical
dimension is at most the summation of the elements in all categories Ci where Ci % C.
5</p>
    </sec>
    <sec id="sec-5">
      <title>Discussion and Conclusions</title>
      <p>In this paper, we analyze CQA in multidimensional data warehouses. We give the notion
of consistent answer to an aggregate query with group-by statements. And we also
present the canonical dimension that allows us to compute approximate answers. This
is part of an ongoing research, and there are still many open problems.</p>
      <p>
        DWs have been conceived as collections of materialized views that extract data from
operational databases. Accordingly, much work has been focalized on resolving
inconsistencies between operational databases and DWs [10, 11, 2325, 16]. Only few works
have tackled the problem of resolving the inconsistencies in dimensions themselves.
This can be due to the fact that early research on DWs considered dimensions as the
static part of DWs, being the facts the only part that were affected by updates. Later
on, in [
        <xref ref-type="bibr" rid="ref14 ref15">15, 14</xref>
        ], it was shown that dimensions need to be adapted, due to changes in data
sources or the evolution of business rules. When updates affect the DWs, dimensions
may become non-strict. Non-strictness may also be caused by inconsistencies between
the databases that feed a DW, or by imprecise or erroneous data.
      </p>
      <p>
        In [
        <xref ref-type="bibr" rid="ref18">18</xref>
        ] the authors analyze the importance of enforcing strictness in dimension
instances. This is done by imposing constraints on the dimension schema that are used
to guide the update operations, with the goal of keeping dimensions strict. In [
        <xref ref-type="bibr" rid="ref21">21</xref>
        ] a
method to transform non-strict dimensions into strict dimensions is presented. This is
done by inserting new arti cial elements into categories. As an illustration, if an element
a rolls-up to both b and c in the same category, a new element (b,c) is created, and a is
associated with this new element. Any other element that was associated to elements b
or c becomes now associated to (b,c). Our dimension repairs are not constructed in this
way, we restore strictness by inserting or deleting edges between elements, but we do
not introduce new elements into categories.
      </p>
      <p>
        However, we do use the idea of merging elements to de ne the canonical dimension.
This is a unique dimension instance obtained by rst isolating the inconsistent data
(elements), i.e. those that cause a dimension to be non-strict, and then creating merged
elements. These are added into existing categories together with the original ones. In
contrast to the method presented in [
        <xref ref-type="bibr" rid="ref21">21</xref>
        ], we avoid that consistent data become related
with merged data. That is, if an element a1 rolls up to b, the latter not involved in
inconsistencies, it will remain related to b in the repairs, but not to (b,c).
      </p>
      <p>
        The notion of consistent answer to a rst-order query was rst de ned in [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ], in the
context of relational databases. CQA for aggregate queries with scalar functions under
the range semantics was introduced and analyzed in [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. The same range semantics was
adopted in [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] for scalar aggregate queries in data exchange. CQA for aggregate queries
with group-by statements under an extended range semantics was studied in [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ], for
relational databases and key constraints.
      </p>
      <p>
        In relational data warehouses, the strictness condition can be captured by means
of functional dependencies (FDs). In relational databases, repairs under FDs are always
obtained via tuple deletions (or changes of attribute values). Repairs obtained with these
techniques could result in dimensions that do not satisfy the dimension schema or where
the roll-up tables do not satisfy the transitive property. Another important difference
with the classical relational setting is that there, whole tuples are deleted, i.e. database
atoms of arity possibly higher than two, whereas in the case of DWs, only binary
relationships (edges between elements) are inserted or deleted. Finally, in the case of
DWs we use a cardinality-based repair semantics as opposed to the set-inclusion-based,
which is more common in the relational case [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. Repairs that minimize the number of
changes result in more reasonable dimensions in the context of DWs. Cardinality-based
relational repairs have been studied in detail in [
        <xref ref-type="bibr" rid="ref19 ref2">19, 2</xref>
        ].
      </p>
      <p>It would also be interesting to provide a more declarative de nition of the
canonical, and a simpler mechanism to compute it (or what may be relevant of it) from the
inconsistent dimension instance, without having to appeal to the explicit minimal
repairs. These and other properties of the canonical dimension are subject of ongoing and
future research.</p>
      <p>Acknowledgements: Leo Bertossi is a Faculty Member of the IBM Center for
Advanced Studies (Toronto Lab). Part of this work was done while he was visiting the
Universities of Bio-Bio and Concepcio´ n. He is very much grateful for the hospitality.
Mo´ nica Caniupa´n is funded by FONDECYT grant #11070186 and Loreto Bravo by
FONDECYT grant #11080260 and CONICYT grant PSD-57. We also thank Carlos
Hurtado for some useful comments.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <given-names>F.</given-names>
            <surname>Afrati</surname>
          </string-name>
          and
          <string-name>
            <given-names>P. G.</given-names>
            <surname>Kolaitis. Answering Aggregate</surname>
          </string-name>
          <article-title>Queries in Data Exchange</article-title>
          .
          <source>In PODS</source>
          , pages
          <volume>129</volume>
          
          <fpage>138</fpage>
          ,
          <year>2008</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <given-names>F.</given-names>
            <surname>Afrati</surname>
          </string-name>
          and
          <string-name>
            <given-names>P. G.</given-names>
            <surname>Kolaitis</surname>
          </string-name>
          . Repair Checking in Inconsistent Databases:
          <article-title>Algorithms and Complexity</article-title>
          . In ICDT,
          <year>2009</year>
          .
        </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>L.</given-names>
            <surname>Bertossi</surname>
          </string-name>
          , and
          <string-name>
            <given-names>J.</given-names>
            <surname>Chomicki</surname>
          </string-name>
          .
          <article-title>Consistent Query Answers in Inconsistent Databases</article-title>
          .
          <source>In PODS</source>
          , pages
          <volume>68</volume>
          
          <fpage>79</fpage>
          ,
          <year>1999</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <given-names>M.</given-names>
            <surname>Arenas</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Bertossi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Chomicki</surname>
          </string-name>
          ,
          <string-name>
            <given-names>X.</given-names>
            <surname>He</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            <surname>Raghavan</surname>
          </string-name>
          , and
          <string-name>
            <given-names>J.</given-names>
            <surname>Spinrad</surname>
          </string-name>
          . Scalar Aggregation in Inconsistent Databases.
          <source>Theoretical Computer Science</source>
          ,
          <volume>296</volume>
          (
          <issue>3</issue>
          ):
          <volume>405</volume>
          
          <fpage>434</fpage>
          ,
          <year>2003</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <given-names>L.</given-names>
            <surname>Bertossi</surname>
          </string-name>
          .
          <source>Consistent Query Answering in Databases. ACM Sigmod Record</source>
          ,
          <volume>35</volume>
          (
          <issue>2</issue>
          ):
          <volume>68</volume>
          
          <fpage>76</fpage>
          ,
          <year>2006</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <given-names>M.</given-names>
            <surname>Caniupan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Bravo</surname>
          </string-name>
          , and
          <string-name>
            <given-names>C.</given-names>
            <surname>Hurtado</surname>
          </string-name>
          .
          <article-title>Logic Programs for Repairing Inconsistent Dimensions in Data Warehouses. Submitted to Journal Theory and Practice of Logic Programming</article-title>
          ,
          <year>Jan 2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <given-names>S.</given-names>
            <surname>Chaudhuri</surname>
          </string-name>
          and
          <string-name>
            <given-names>U.</given-names>
            <surname>Dayal</surname>
          </string-name>
          .
          <article-title>An Overview of Data Warehousing and OLAP Technology</article-title>
          .
          <source>SIGMOD Record</source>
          ,
          <volume>26</volume>
          (
          <issue>1</issue>
          ):
          <volume>65</volume>
          
          <fpage>74</fpage>
          ,
          <year>1997</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <given-names>J.</given-names>
            <surname>Chomicki</surname>
          </string-name>
          . Consistent Query Answering:
          <article-title>Five Easy Pieces</article-title>
          .
          <source>In ICDT</source>
          , pages
          <volume>1</volume>
          
          <fpage>17</fpage>
          ,
          <year>2007</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <given-names>A.</given-names>
            <surname>Fuxman</surname>
          </string-name>
          , E. Fazli, and
          <string-name>
            <given-names>R. J.</given-names>
            <surname>Miller</surname>
          </string-name>
          .
          <article-title>Conquer: ef cient management of inconsistent databases</article-title>
          .
          <source>In SIGMOD</source>
          , pages
          <volume>155</volume>
          
          <fpage>166</fpage>
          ,
          <year>2005</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10. H.
          <string-name>
            <surname>Garcia-Molina</surname>
            ,
            <given-names>W.</given-names>
          </string-name>
          <string-name>
            <surname>Labio</surname>
            , and
            <given-names>J.</given-names>
          </string-name>
          <string-name>
            <surname>Yang</surname>
          </string-name>
          .
          <article-title>Expiring Data in a Warehouse</article-title>
          .
          <source>In VLDB</source>
          , pages
          <volume>500</volume>
          
          <fpage>511</fpage>
          ,
          <year>1998</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <given-names>H.</given-names>
            <surname>Gupta</surname>
          </string-name>
          and
          <string-name>
            <given-names>I. S.</given-names>
            <surname>Mumick</surname>
          </string-name>
          .
          <article-title>Selection of Views to Materialize Under a Maintenance Cost Constraint</article-title>
          .
          <source>In ICDT</source>
          , pages
          <volume>453</volume>
          
          <fpage>470</fpage>
          ,
          <year>1999</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <given-names>C.</given-names>
            <surname>Hurtado</surname>
          </string-name>
          and
          <string-name>
            <given-names>C.</given-names>
            <surname>Gutirrez</surname>
          </string-name>
          .
          <article-title>Data Warehouses and OLAP: Concepts, Architectures and Solutions, chapter Handling Structural Heterogeneity in OLAP</article-title>
          . Idea Group, Inc,
          <year>2007</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <string-name>
            <surname>C.</surname>
          </string-name>
          <article-title>A</article-title>
          .
          <string-name>
            <surname>Hurtado</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          <string-name>
            <surname>Gutierrez</surname>
          </string-name>
          ,
          <article-title>and</article-title>
          <string-name>
            <given-names>A. O.</given-names>
            <surname>Mendelzon</surname>
          </string-name>
          .
          <article-title>Capturing Summarizability with Integrity Constraints in OLAP</article-title>
          .
          <source>ACM Transacations on Database Systems</source>
          ,
          <volume>30</volume>
          (
          <issue>3</issue>
          ):
          <volume>854</volume>
          
          <fpage>886</fpage>
          ,
          <year>2005</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          14.
          <string-name>
            <surname>C.</surname>
          </string-name>
          <article-title>A</article-title>
          .
          <string-name>
            <surname>Hurtado</surname>
            ,
            <given-names>A. O.</given-names>
          </string-name>
          <string-name>
            <surname>Mendelzon</surname>
          </string-name>
          ,
          <article-title>and</article-title>
          <string-name>
            <given-names>A. A.</given-names>
            <surname>Vaisman</surname>
          </string-name>
          .
          <article-title>Maintaining Data Cubes under Dimension Updates</article-title>
          .
          <source>In ICDE</source>
          , pages
          <volume>346</volume>
          
          <fpage>355</fpage>
          ,
          <year>1999</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          15.
          <string-name>
            <surname>C.</surname>
          </string-name>
          <article-title>A</article-title>
          .
          <string-name>
            <surname>Hurtado</surname>
            ,
            <given-names>A. O.</given-names>
          </string-name>
          <string-name>
            <surname>Mendelzon</surname>
          </string-name>
          ,
          <article-title>and</article-title>
          <string-name>
            <given-names>A. A.</given-names>
            <surname>Vaisman. Updating OLAP</surname>
          </string-name>
          <article-title>Dimensions</article-title>
          .
          <source>In DOLAP</source>
          , pages
          <volume>60</volume>
          
          <fpage>66</fpage>
          ,
          <year>1999</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          16.
          <string-name>
            <given-names>H.</given-names>
            <surname>Kang</surname>
          </string-name>
          and
          <string-name>
            <given-names>C.</given-names>
            <surname>Chung</surname>
          </string-name>
          .
          <article-title>Exploiting Versions for On-line Data Warehouse Maintenance in MOLAP Servers</article-title>
          .
          <source>In VLDB</source>
          , pages
          <volume>742</volume>
          
          <fpage>753</fpage>
          ,
          <year>2002</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          17.
          <string-name>
            <given-names>H.</given-names>
            <surname>Lenz</surname>
          </string-name>
          and
          <string-name>
            <given-names>A.</given-names>
            <surname>Shoshani</surname>
          </string-name>
          .
          <article-title>Summarizability in OLAP and Statistical Data Bases</article-title>
          .
          <source>In SSDBM</source>
          , pages
          <volume>132</volume>
          
          <fpage>143</fpage>
          ,
          <year>1997</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          18.
          <string-name>
            <surname>C. Letz</surname>
            ,
            <given-names>E. T.</given-names>
          </string-name>
          <string-name>
            <surname>Henn</surname>
            , and
            <given-names>G. Vossen.</given-names>
          </string-name>
          <article-title>Consistency in Data Warehouse Dimensions</article-title>
          .
          <source>In IDEAS</source>
          , pages
          <volume>224</volume>
          
          <fpage>232</fpage>
          ,
          <year>2002</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          19.
          <string-name>
            <given-names>A.</given-names>
            <surname>Lopatenko</surname>
          </string-name>
          and
          <string-name>
            <given-names>L. E.</given-names>
            <surname>Bertossi</surname>
          </string-name>
          .
          <article-title>Complexity of consistent query answering in databases under cardinality-based and incremental repair semantics</article-title>
          .
          <source>In ICDT</source>
          , pages
          <volume>179</volume>
          
          <fpage>193</fpage>
          ,
          <year>2007</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref20">
        <mixed-citation>
          20.
          <string-name>
            <given-names>A. O.</given-names>
            <surname>Mendelzon</surname>
          </string-name>
          and
          <string-name>
            <given-names>A. A.</given-names>
            <surname>Vaisman</surname>
          </string-name>
          .
          <article-title>Temporal Queries in OLAP</article-title>
          . In VLDB, pages
          <volume>242</volume>
          
          <fpage>253</fpage>
          ,
          <year>2000</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref21">
        <mixed-citation>
          21.
          <string-name>
            <surname>T. B. Pedersen</surname>
            ,
            <given-names>C. S.</given-names>
          </string-name>
          <string-name>
            <surname>Jensen</surname>
            , and
            <given-names>C. E.</given-names>
          </string-name>
          <string-name>
            <surname>Dyreson. Extending Practical</surname>
          </string-name>
          Pre-Aggregation in
          <article-title>On-Line Analytical Processing</article-title>
          .
          <source>In VLDB</source>
          , pages
          <volume>663</volume>
          
          <fpage>674</fpage>
          ,
          <year>1999</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref22">
        <mixed-citation>
          22.
          <string-name>
            <given-names>M.</given-names>
            <surname>Rafanelli</surname>
          </string-name>
          and
          <string-name>
            <given-names>A.</given-names>
            <surname>Shoshani</surname>
          </string-name>
          .
          <article-title>STORM: a Statistical Object Representation Model</article-title>
          .
          <source>In SSDBM</source>
          , pages
          <volume>14</volume>
          
          <fpage>29</fpage>
          ,
          <year>1990</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref23">
        <mixed-citation>
          23.
          <string-name>
            <given-names>L.</given-names>
            <surname>Schlesinger</surname>
          </string-name>
          and
          <string-name>
            <given-names>W.</given-names>
            <surname>Lehner</surname>
          </string-name>
          .
          <article-title>Extending Data Warehouses by Semiconsistent Views</article-title>
          .
          <source>In DMDW</source>
          , pages
          <volume>43</volume>
          
          <fpage>51</fpage>
          ,
          <year>2002</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref24">
        <mixed-citation>
          24.
          <string-name>
            <given-names>D.</given-names>
            <surname>Theodoratos</surname>
          </string-name>
          and
          <string-name>
            <given-names>M.</given-names>
            <surname>Bouzeghoub</surname>
          </string-name>
          .
          <article-title>A General Framework for the View Selection Problem for Data Warehouse Design and Evolution</article-title>
          . In DOLAP, pages
          <volume>1</volume>
          
          <issue>8</issue>
          ,
          <year>2000</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref25">
        <mixed-citation>
          25.
          <string-name>
            <given-names>Y.</given-names>
            <surname>Zhuge</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Garcia-Molina</surname>
          </string-name>
          ,
          <article-title>and</article-title>
          <string-name>
            <given-names>J. L.</given-names>
            <surname>Wiener</surname>
          </string-name>
          .
          <article-title>Multiple View Consistency for Data Warehousing</article-title>
          .
          <source>In ICDE</source>
          , pages
          <volume>289</volume>
          
          <fpage>300</fpage>
          ,
          <year>1997</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>