• No results found

Discovering Editing Rules For Data Cleaning

N/A
N/A
Protected

Academic year: 2021

Share "Discovering Editing Rules For Data Cleaning"

Copied!
8
0
0

Loading.... (view fulltext now)

Full text

(1)

Discovering Editing Rules For Data Cleaning

Thierno Diallo

Universit ´e de Lyon INSA de Lyon, LIRIS.

Orchestra Networks Paris, France

thierno.diallo@insa-lyon.fr

Jean-Marc Petit

Universit ´e de Lyon INSA de Lyon, LIRIS

jean-marc.petit@insa-lyon.fr

Sylvie Servigne

Universit ´e de Lyon INSA de Lyon, LIRIS

sylvie.servigne@insa-lyon.fr

ABSTRACT

Dirty data continues to be an important issue for companies. The database community pays a particular attention to this subject. A variety of integrity constraints like Conditional Functional Dependencies (CFD) have been studied for data cleaning. Data repair methods based on these constraints are strong to detect inconsistencies but are limited on how to correct data, worse they can even introduce new errors. Based on Master Data Management principles, a new class of data quality rules known as Editing Rules (eR) tells how to fix errors, pointing which attributes are wrong and what values they should take.

However, finding data quality rules is an expensive process that involves intensive manual efforts. In this paper, we de-velop pattern mining techniques for discovering eRs from ex-isting source relations (possibly dirty) with respect to master relations (supposed to be clean and accurate). In this set-ting, we propose a new semantics of eRs taking advantage of both source and master data. The problem turns out to be strongly related to the discovery of both CFD and one-to-one correspondences between sources and target attributes. We have proposed efficient techniques to address the discov-ery problem of eRs and heuristics to clean data.

We have implemented and evaluated our techniques on real-life databases. Experiments show both the feasibility, the scalability and the robustness of our proposal.

1.

INTRODUCTION

Poor data quality continues to have a serious impact on companies leading to both wasting time and money. There-fore, finding efficient techniques to correct dirty data is an important issue. Database community pays a particular at-tention to this subject.

A variety of integrity constraints have been studied for data cleaning from traditional functional and inclusion de-pendencies to their conditional extensions [6, 7, 14, 18]. These constraints help us to determine whether errors are

Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. To copy otherwise, to republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. This article was presented at the 9th International Workshop on Quality in Databases (QDB) 2012. Copyright 2012

present in the data but they fall short of telling us which attributes are concerned by the error and moreover how to exactly correct it. Worst, heuristic methods based on that constraints may introduce inconsistencies when trying to repair the data. These limitations motivate [16] to de-fine Editing Rules: a new class of data quality rules that tells how to efficiently fix errors. Editing Rules (eRs) are boosted by the recent developpement of master data man-agement (MDM [11, 28, 30]) and are defined in term of master data, a single repository of high-quality data that provides various applications with a synchronized, consis-tent view of its core business entities [23]. This helps to fix and enrich dirty source data using the corresponding val-ues from master data. However, for eRs to be effective in practice, it is necessary to have techniques in place that can automatically discover such rules. This practical concern highlights the need for studing the discovering problem of eRs. We assume the existence of both sources and master data. Our approach is based on the following process: (1) Finding one-to-one attribute mapping between source and master relation using approximative unary inclusion depen-dencies discovery. (2) Infering rules from master relation. And (3) Applying rules on input source relation.

Contribution.In this paper we define and provide solu-tions for discovering eRs in databases provided with source data and master data. In particular we make the follow-ing contribution: (1) We introduce a new semantics of eRs allowing to precisely define the discovery problem as a pat-tern mining one. (2) We propose heuristics to apply eRs in a data cleaning process. And (3) We present an experimental evaluation of our techniques demonstrating their usefulness for discovering eRs. We finally evaluate the scalability and the robustness of our techniques.

Related Works. This work finds similarities to con-straint discovery and Association Rule (AR) mining. Plenty of contribution has been proposed for Functional Dependen-cies inference and AR mining [2, 27, 19, 21, 26], but less for CFDs mining [8, 15, 12]. In [8], a tool is proposed for data quality management which suggests possible rules and identifies conform and non-conform records. Effective algo-rithms for discovering CFDs and dirty values in a data in-stance are presented, but the CFDs discovered may contain redundant patterns. In [15], three methods to discover CFDs are proposed. The first one is called CFDMiner which mines only constant CFDs i.e. CFDs with constant patterns only. CFDMiner is based on techniques for mining closed item-sets [27]. The two other ones, called CTANE and FastCFD,

(2)

were developed for general (non constant) CFDs discovery. CTANE and FastCFD are respectively extensions of well-known algorithms TANE [19] and FastFD [31] for mining FDs. In [12] a powerfull method for mining frequent con-stant CFDs is proposed.

The problem we address is also related to mapping func-tion discovery between source and target schemas. Indeed, attributes involved in INclusion Dependencies (INDs) cor-respond each other with respect to a mapping function [22]. Many contribution has been proposed in this setting. For example in [4], based on INDs, the SPIDER algorithm that efficiently find all the INDs in a given relation is proposed. In [20] a dependency graph is built as a measure of the de-pendency between attributes, then matching node pairs are found in the dependency graphs by running a graph match-ing algorithm. In [33], a robust algorithm for discovermatch-ing single-column and multi-column foreign keys is proposed. The algorithm may be used as a mapping algorithm for min-ing correspondmin-ing attributes. In addition, many techniques have been proposed to identify one-to-one correspondences in different domains such as schema matching [5, 29], ontol-ogy alignments [13] or understanding logical database design [22]. Since introduction of eRs by [16], as far as we know, no contribution has been made for the discovery problem of eRs.

This work is also closed to data repair techniques based on constraints proposed this last decade. We can precisely cite [6] which propose a cost based model stated in term of value modification instead of tuple insertions and dele-tions. The techniques used are carried by FDs and INDs. In [10] the model of [6] is extended with respect to CFDs to improve the consistency of data. But repairs still may intro-duce some errors. In an dynamic environement where data and constraints evolve, [9] propose a novel unified cost model for data and constraint repair. In [32], the user feedback is integrated in the cleaning process, improving existing auto-matic repair techniques based on CFDs. Record matching through matching dependencies is associated and unified to data repair by [17] to improve efficiency of data cleaning algorithm.

Paper Organization. This paper is organized as follows. In section 2, we give preliminary definitions. In section 3 we describe the problem statement. We give details of our solutions for the eRs discovery problem in section 4. In section 5 we describe the use of eRs to repair data. Section 6 presents an experimental evaluation of our methods and section 7 finally concludes the paper.

2.

PRELIMINARIES

We shall use classical database notions (e.g. [1], CFDs and INDs terminologies [7, 14, 18, 12, 22]). The relation symbol is generally denoted byRand the relation schema of

Ris denoted bysch(R). When clear from context, we shall use R instead ofsch(R). Each attributeA has a domain, denoted byDOM(A). A relation is a set of tuples and the projection of a tupleton an attribute setX is denoted by

t[X]. Given a relationr overR andA∈R, active domain ofAinris denoted byADOM(A, r). The active domain of

ris denoted byADOM(r).

2.1

Conditional Functional Dependencies

The reader familiar with CFDs may skip this section. CFDs have been recently introduced in the context of data

r0 A B C D t1 : 0 1 0 2 t2 : 0 1 3 2 t3 : 0 0 0 1 t4 : 2 2 0 1 t5 : 2 1 0 1 Figure 1: A Toy relationr0

cleaning [7]. They can be seen as an unification of Functional Dependencies (FD) and Association Rules (AR) since they allow to mix attributes and attribute/values in dependen-cies. We now consider a relation schemaR, the syntax of a CFD is given as follows:

Definition 1 Syntax: A Conditional Functional Depen-dency (CFD) ρ on R is a pair (X → Y, Tp) where (1)

XY ⊆R, (2)X→Y is a standard Functional Dependency (FD) and (3)Tp is a pattern tableau with attributes inR. The FD holds on a set of tuples selected by the condition carried by the pattern tableau.

For eachA∈Rand for each pattern tupletp∈Tp,tp[A] is either a constant inDOM(A), or an‘unnamed variable’

denoted by ’ ’, or an empty variable denoted by ’∗’ which in-dicates that the corresponding attribute does not contribute to the pattern (i.e. A6∈XY).

The semantics of a CFD extends the semantics of FD with mainly the notion of matching tuples. Letr be a relation over R,X ⊆R andTp a pattern tableau over R. A tuple

t ∈r matches a tuple tp∈ Tp overX, denoted by t[X]

tp[X], iff for each attribute A∈ X, eithert[A] =tp[A], or

tp[A] =’ ’, ortp[A] =’∗’.

Definition 2 Semantics: Letr be a relation overR and

ρ = (X → Y, T) a CFD with XY ⊆ R. We say that r

satisfies ρ, denoted byr|=ρ, iff for allti,tj∈r and for all

tp∈T, ifti[X] =tj[X]tp[X] thenti[Y] =tj[Y]tp[Y]. That is, if ti[X] andtj[X] are equal and in addition, they both match the patterntp[X], thenti[Y] andtj[Y] must also be equal to each other and both match the patterntp[Y].

Example 1 Letr0be a relation defined overABCD (Fig-ure 1). We can say r0 |= (AC →D,(2,∗,0k 1)). Where

kseparates the left hand side of the FD from it right hand side, and (2,∗,0k1) a pattern tableau consisting of one line i.e. the pattern tuple.

We say thatr satisfies a set Σ of CFD overR, denoted by

r|= Σ ifr|=ρfor each CFDρ∈Σ. A CFD (X →Y, Tp) is in thenormal form [14], when|Y|= 1 and|Tp|= 1. In the sequel we consider CFDs in their normal form and composed only by constant values.

2.2

Editing Rules

Editing Rule syntax [16] is slightly rephrased in the fol-lowing definition.

Definition 3 Syntax: Let Rand S be two relation sym-bols. R is the relation source symbol andS is the target master one. LetX (resp. Y) be a list of distinct attributes from sch(R) (resp. sch(S)), A ∈ sch(R)\X, B ∈ sch(S) andZ⊆sch(R). An eRϕover (R, S) is of the formϕ: ((X, Y)→(A, B), tp[Z]) wheretp[Z] is a pattern tuple over

(3)

r FN LN AC phn type str city zip item

t1 : Bob Brady 020 079172485 2 501 Elm St. Edi EH7 4AH CD

t2 : Robert Brady 131 6884563 1 null Lnd null CD

t3 : Robert Brady 020 6884563 1 null null EH7 4AH DVD

t4 : Mary Burn 029 9978543 1 null Cad null BOOK

s FN LN AC Hphn Mphn str city zip DOB gender

s1 : Robert Brady 131 6884563 079172485 51 Elm Row Edi EH7 4AH 11/11/55 M

s2 : Mark Smith 020 6884563 075568485 20 Baker St. Lnd NW1 6XE 25/12/67 M

u ItemId Item DOF Price

u1 : 701B Book 04/03/10 45

u2 : 017A CD 11/10/10 11

u3 : 904A DVD 25/08/10 16

Figure 2: source relationr and master database {s, u}

Let r ∈sch(R) ands ∈sch(S) be respectively a source and a master relation. The semantics of eRs has been de-fined with respect to the insertion of a tuple t in r [16]. The idea is to “correct”rusing values ofs with respect to pattern selection applying onr.

Definition 4 Semantics:An eRϕ=((X,Y)→(A,B),tp[Z]), with respect to a master tupletm∈s, is applied tot∈rto obtaint0 if: (1)t[Z] matchestp[Z]. (2)t[X] =tm[Y]. And (3)t0 is obtained by the updatet[A] :=tm[B]. That is, ift

matchestpand ift[X] equalstm[Y], thentm[B] is assigned tot[A].

Example 2 Let us consider the tuplest1ands1in Figure 2.

t1is in a source relation ands1is in a master relation. The valuet1[F N] =Bobmay be corrected using the right name

s1[F N] =Robert from the master relation with respect to the eR ((phn, M phn) → ((F N),(F N)), tp2[type] = (2)). That is, if t[type] = 2 (indicating mobile phone) and if there is a master tuple s with s[M phn] = t[phn], then

t[F N] :=s[F N].

3.

PROBLEM STATEMENT

The problem we are interested in can be stated as follows: given an instancerfrom a source databasedand an instance

sfrom a master databasem, it is to find all applicable eRs onr with respect tos. However, in a data mining setting, the previous semantics of eRs (Definition 4) needs to be properly extended since it just involves tuple insertion. We need to define the semantics to identify rules. In the sequel, to alleviate notations the master database is reduced to a single master relation. Preliminary, we introduce a general schema mapping functionfbetween attributes of source re-lation and master rere-lation. This function is based on the following requirements with respect to the strong expres-siveness of the master relation schema: (1) Each attribute of a source relation should have a mapping attribute in a master relation, and only one. And (2) If two attributes

A, B of a source relation have the same mapping attribute in a master relation, thenA=B.

Letsch(R) andsch(S) be respectively the source schema relation and the master one.

Definition 5 A mapping functionffromRtoS, is defined as a total and injective function;f: sche(R)→sche(S) By extension, forX ⊆sch(R) we note: f(X) =S

A∈X{f(A)}. The new semantics of eRs can now be given.

Definition 6 New semantics: Let ϕ=((X,Y) → (A,B),

tp[Z]) be an eR over (R, S),ra source relation overRands

a master relation overS. We say thatϕis satisfied in (r, s) with respect tof, denoted by (r, s)|=f ϕ, if: (1)f(X) =Y. (2)f(A) =B. (3)f(Z) =Z0. And (4)s|=Y →B, tp[Z0].

Example 3 Let ϕ = ((zip, zip) → (AC, AC), tp = (EH7 4AH)) be an eR defined onr, sof Figure 2. We can say that

ϕis satisfied in (r, s) with respect to the identity function. Indeed, attributes are the same (i.e zip = zip) and s |=

zip→AC, tp= (EH7 4AH).

The problem of Discovering eRs (denoted by DER) is de-fined as follows: Given a source relationr, a master relation

s and a mapping function f, find all eRs satisfied in (r, s) with respect tof.

4.

MINING EDITING RULES

In order to solve the DER problem, we have to deal with the following steps: (1) Discovering the mapping between attributes with respect to a mapping function f. (2) Dis-covering a cover of CFDs satisfied in s. And (3) Propa-gating CFDs from s to r using f. For each discovered CFDs (Y → B, tp[Z0]), generating an eR ((f−1(Y), Y) (f−1(B), B), f−1(tp[Z0])).

4.1

Same Schemas on source and master

rela-tion

In this approach, let us assume that the schema of R is equal to the schema ofS. The syntax (Definition 3) of eRs is adapted accordingly as follows:

Definition 7 New Syntax: LetR andS be two relation symbols with sch(R) =sch(S). Let X be a list of distinct attributes from sch(R), A∈ sch(R)\X and Z ⊆sch(R). An eRϕover (R, S) is of the formϕ: (X→A, tp[Z]) where

tp[Z] is a pattern tuple overR.

This definition is closer to CFD definition. The CFDs discovery problem has been already studied in [8, 12, 15]. In [12] we proposed efficient techniques to discover all constant CFDs satisfied by a given relation. The DER problem can be resolved as follows: (1) Discovering a cover of CFDs satisfied in s. And (2) For each discovered CFDs (X → A, tp[Z]), generating the eR ((X, X)→(A, A), tp[Z]).

4.2

Different Schemas on source and master

relation

(4)

In this case, it is necessary to find out, through a map-ping function, correspondences between attributes of mas-ter relation and source relation. Different techniques may be used to specify such a mapping function. For example the attribute naming assumption may be used, or based on instances, ontology alignement [13] and inclusion dependen-cies discovery (INDs) [4]. Clearly, due to the presence of errors in source relations and due to the high quality data of the master relation, the definition of such a correspondence should be flexible, which is indeed possible with approxima-tive unary INDs [22].

4.2.1

From source and master relations to INDs

We define the mapping functionf with respect to unary INDs from the source relationrto the master relations. Ef-ficient techniques have been proposed to discover such unary IND satisfied in a given database [22, 4].

LetAandBbe respectively single attributes. The unary IND A ⊆ B means all values of attribute A are included in the bag of values of attribute B. An IND candidate is satisfied when it fulfills the IND definition. For example in Figure 2, we have: Hphn⊆phn.

We want to identify all unary INDs based on both source and master relations to catch correspondencies between at-tributes. To that end, we introduce a preprocessing of re-lations to be as close as possible to Association Rule. The intuition is to use techniques based on the latter. We call such preprocessingcondensed representation.

Example 4 The condensed representationCR(r0) of relationr0 (Figure 1 recalled below) is given as follows:

r0 A B C D t1 : 0 1 0 2 t2 : 0 1 3 2 t3 : 0 0 0 1 t4 : 2 2 0 1 t5 : 2 1 0 1 CR(r0 ): 0k A B C 1k B D 2k A B D 3k C

Given a common relationr over a schemasch(R) the con-densed representation ofr, denoted byCR(r), is defined by:

CR(r) ={(v, X)|v∈ADOM(r), X =S

{A ∈sch(R)|∃t∈

r, t[A] = v}}. For a set of relations, CR(r1, . . . , rn) = S

i=1..nCR(ri). The support of an attribute set X ⊆ R inCR(r), denoted bysup(X, CR(r)), is defined by:

sup(X, CR(r)) =|{(v, Y)∈CR(r)|X⊆Y}|

The closure of an attributeA ∈ sch(R) with respect to

CR(r), denoted byA+CR(r), is defined as:

A+CR(r)= \ (v,X)∈CR(r)

{X|A∈X}

Property 1 Letrbe a relation overRandA, Battributes ofR. r|=A⊆B⇐⇒B∈ACR+ (r)⇐⇒sup({A, B}, CR(r)) =

sup({A}, CR(r)).

Proof. r|=R[A]⊆S[B].

For all v ∈ πA(r), ∃t ∈ r such that v = t[B]. So v ∈

πA(r)⇐⇒ v∈πB(r). ∀(v, X) ∈CR(r), A ∈X ⇐⇒ B ∈

X. SoB∈T

(v,X)∈CR(r){X|A∈X}. FinallyB∈A+CR(r)

The property 1 avoids the heavy process of computing the intersection between attributes when calculating the closure to extract unary INDs. The support is used instead thanks

to this property. Moreover in practice, it is necessary to in-troduce approximation measure to extract unary INDs from relation. For example, this can be done using the natural error measureg03 introduced by [22]. We recall their defini-tion in our context. Letr be a source over schema R and letsbe a master relation over schemaS.

g03 (R[X]⊆S[Y],{r, s}) = 1−max{|πX(r

0)|:r0 ⊆r,{r, s} |=R[X]S[Y]} |πX(r)|

Example 5 In Figure 2, we have:g30(R[AC]⊆S[AC],{r, s}) = 1-(2/3) = 1/3.

The use of this particular error measure helps character-ize the correspondence between attributes based on unary INDs.

Definition 8 Let A ∈ sch(R), B ∈ sch(S) and a [0, 1]-threshold value. We say thatAcorresponds toBinr, swith respect to, denoted by{r, s} |=corr(A, B), ifg03(R[A]⊆

S[B],{r, s})≤.

By extension, we say that X corresponds to Y wrt if

∀A∈X,∃B ∈Y such that{r, s} |=corr(A, B). The error measure related to the correspondence (denotederror) can be also defined using the support of attribute sets as follows.

Definition 9 Let r be a relation over R and A, B ∈ R.

error(A⊆B) = supsup({A,B}({A})).

Property 2 Let r be a relation over R and A, B ∈ R.

error(A⊆B) =g03(A⊆B).

Thanks to definition 9 and property 2, we just need to com-pute the support of every single attribute (item of size 1) and the support of every couple of generated candidates at-tributes (CandidateGeneration) for A and B (itemsets of size 2). Therefore, we use theAPRIORI[3] algorithm until level 2 without any threshold (Algorithm 1).

Algorithm 1ScalableClosure

Require: A condensed representationCRofrands.

Ensure: F1, F2, itemsets and their supports of size 1 and 2 respectively.

1: F1={(A, support(A))|A∈R} 2: C2=CandidateGeneration(F1) 3: for all(v, X)∈CR(r)do

4: F2 =subset(C2, X) – Return the subset of C2 con-tainingX 5: for alle∈F2do 6: support(e)+ = 1 7: end for 8: end for 9: return F1, F2

4.2.2

From approximative unary INDs to a mapping

function f

Given the source relation, the master relation and a

threshold, Algorithm 2 outputs a mapping function based on approximative unary INDs.

(5)

Algorithm 2(SR2MR) Mapping from Source Relation to Master Relation

Require: a source relation r over R, a master relation s

overS.

Ensure: A mapping functionf fromRtoS

1: CR=P reprocessing(r, s); 2: (F1, F2) =scalableClosure(CR); 3: for allA∈Rdo 4: ((B, ), F2) =F indBest(F1, F2, A); 5: whileg03(A⊆B)≤do 6: =+ 0.05 7: end while 8: f(A) =B 9: end for 10: return f

Preprocessing(r,s) (first step of Algorithm 2) computes for both relations the condensed representation. The itemsets

F1,F2 and the supports are generated thanks to Algorithm 1. For each attributeAinRa corresponding attribute inS

is mined byFindBest (Algorithm 3) procedure with respect to a mapping functionf. Thethreshold is increased until a correspondence is found through approximative unary IND. When many approximative unary INDs are concerned, the one with the biggest cardinality is choosen. The symbol⊥

refers to the default attribute.

Algorithm 3FindBest

Require: F1,F2 andA∈R.

Ensure: attributeB∈S: a mapping attribute forA. 1: Let (A, v)∈F1;

2: LetE={(AiAj, v)∈F2|A=AiorA=Aj}

3: if ∃(AB, v) ∈ E such that for all (X, v0) ∈ E, v ≥ v0 then

4: Remove all occurrences ofB inF2 5: return ((B,v0

v), F2) 6: else

7: return ((⊥,1), F2) 8: end if

4.2.3

Mining Editing Rules

Once one-to-one correspondence between attributes is com-puted, we build the eRs from CFDs satisfied bysto solve DER problem as described in Algorithm 4.

Algorithm 4Discovery of Editing Rules

Require: ra source relation,sa master relation, Σ the set of CFDs satisfied ins,a threshold.

Ensure: eRs forrwith respect tos

1: res=∅;

2: f=SR2M R(r, s); 3: for allA∈Rdo

4: Let (s.B, err) =f(A); errthe associated error when computing the corresponding attribute (FindBest, Al-gorithm 3)

5: CF D={cf d∈Σ|cfd defined over s}

6: for allX→A, tp[Z]∈CF Ddo

7: if g(A∪X∪Z)∈Rthen

8: if ∀B ∈(A∪X∪Z) such thatf(g(B)).err≤ then 9: res+ = (f−1(X), X) → f−1(A), A), tp[f−1(Z)] 10: end if 11: end if 12: end for 13: end for 14: return res

5.

APPLYING EDITING RULES

Applying eRs is actually a process of data repair [16]. Thi process was previously studied by [7] using CFDs with some challenges. The main one is presented.

5.1

Main problem of data repair based on

CFDs

r1 A B C D E t1: 0 0 1 2 3 t2: 0 0 1 4 5 %1= (DC→E,(∗,∗,2,2k5)) %2= (AB→C,(0,0k2,∗,∗)) %3= (CD→E,(∗,∗,1,2k5)) %4= (CD→E,(∗,∗,1,4k5))

Figure 3: a relation r1 over ABCDE and a set of

CFDs

Actually the correction of dirty tuples may cause some rules to become no more applicable. In this setting the or-der in which they are applied is important to maximize the number of rules used in practice to correct data. Letr1 be a relation defined Figure 3 on the schema ABCDE, with a set of CFDs. When the set of CFDs is applied in the order they appear on Figure 3, only%2 is applied. There are no tuples matching patternD = 2, C = 2 of %1 and they are no tuples matching pattern of%3and%4because%2changed the value oft[C] from 1 to 2.

In another hand, if we apply the set in the following order

%4,%3,%2 and %1 all of them are actually applied. This ex-ample highlights the importance of the order in which rules are applied. Therefore it is necessary to develop heuristics that maximize the number of rules used in practice.

5.2

Heuristics for data repair

In the sequel we recall the runing example of [16] with some modifications to have the same relation schema, i.e.

LN, Hphn, M phn, DOB and gender attributes are re-moved from master relation schema S. Similary LN,phn,

typeanditemattributes are removed fromR. ThusS and

R schemas are now equal and contain F N, AC, str, city

andzip.

Let us consider the example of Figure 4. The set of CFDs satisfied by the mastersincludes: (zip→AC, (EH7 4AH,131)) and (zip→str, (EH7 4AH,51 Elm Row)). Two eRs can be built: ((zip,zip) →(AC,AC), (EH7 4AH,131)) and ((zip,zip)→(str,str), (EH7 4AH,51 Elm Row)). There-fore, the tuple t1 in the source relation can be updated:

t1[AC, str] is changed to (131, 51 Elm Row). Once eRs are discovered, we can now apply them to clean data.

r FN AC str city zip

t1 Bob 020 501 Elm St. Edi EH7 4AH

t2 Robert 131 null Lnd null

t3 Robert 020 null null EH7 4AH

t4 Mary 029 null Cad null

s FN AC str city zip

s1 Robert 131 51 Elm Row Edi EH7 4AH

s2 Mark 020 20 Baker St. Lnd NW1 6XE

Figure 4: source relationr and master relation son the same schema

(6)

5.2.1

Heuristic

H0

: Baseline

The use of eRs in a basic data cleaning process is described in Algorithm 5. Discovered eRs Σ are used to correct dirty relationr. The number of corrected tuples (cpt) is kept to evaluate the accuracy of the process.

Algorithm 5HeuristicH0: Baseline

Require: r, Σ

Ensure: A new relation r0 |= Σ and cpt: the number of corrected tuples ofr.

1: cpt= 0; 2: r0=r;

3: for allt∈r0do

4: for all(X, Y)→(A, B), tp[Z]∈Σ such thatttp[Z]

do 5: if t[X]tp[Z]then 6: t[A] :=t[B] 7: cpt+ + 8: end if 9: end for 10: end for 11: return r0, cpt

5.2.2

Heuristic

H0∗

: Baseline-Recall

The heuristicH0∗called Baseline-Recall iterates over rules. Therefore a rule not applied at a given iteration stepican be applied at the next iteration stepi+ 1. For example, on Figure 3 at a first step we apply the set of rules%1,%2,%3and

%4using heuristicH0. Only%2is applied. As a consequence,

t[C] is changed from 1 to 2. Using heuristic H0∗ ensure a second iteration and then %1 can be now applied because

t2 matches the pattern of%1. Since we have no garantee of termination in some noisy case due to CFDs violation, we have set a maximum value of iteration to 100.

5.2.3

Heuristic

H1

: Left-Hand-Side-Length-Sorted

We previously studied the importance of the order in which rules are applied in order to maximize the number of rules used in practice. Several techniques can be used. For example, we can sort the rules with respect to the size (in term of number of attributes) of their left hand side. The in-tuition is to apply rules with less selectivity first. The Recall strategy can be also applied toH1to obtain Left-Hand-Side-Length-Sorted-Recall heuristic (H1∗). These alternatives are experimentally verified in the next section.

6.

EXPERIMENTAL STUDY

We ran experiments to determine the effectiveness of our proposed techniques. We report our results using real dataset and provide examples demonstrating the quality of our dis-covered eRs. In particular we use HOSP1 dataset. Our experiments were run using a machine with an Intel Core 2 Duo (2.4GHz) CPU and 4GB of memory.

6.1

Discovering Editing Rules

Our experimental study has been set up in the same condi-tion of [16]. We use the same HOSP data and the same ta-bles: HOSP, HOSP MSR XWLK and STATE MSR AVG. In [16], authors manually designed for HOSP data 37 eRs in 1

http://www.hospitalcompare.hhs.gov

Figure 5: Scalability w.r.t. response time and mem-ory usage

total, obtained by a carefull analysis2. Five important ones cited by [16] are:

ϕ1=((ZIP,ZIP)→(ST,ST),tp1[ZIP]=());

ϕ2=((phn,phn)→(ZIP,ZIP),tp2[phn]=());

ϕ3=((mCode,ST),(mCode,ST))→(sAvg,sAvg),tp3=());

ϕ4=((id,mCode),(id,mCode))→(Score,Score),tp4=());

ϕ5=(id, id)→(hName,hName),tp5=());

We have run the Cfun 3 open source implementation of constant CFDs discovery [12] and we have been able to recover all eRs listed by [16]. For example the eR ϕ5 = (id, id)→(hN ame, hN ame), tp5 = ()) is equivalent to the set of constant CFDs in the formid→hN ame. All constant CFDs satisfied by the master relation have been extracted. Figure 5 shows the scalability with respect to response time and memory usage. The algorithm scales lineary both for execution time and memory usage [12].

6.2

Data repair

The experimental protocol is defined as follows: (1) Du-plicating experimental relation r to obtain r0. (2) Intro-ducing noise into r0. Null values are introduced into the relation. The noise rate of the relation is defined as the ra-tio of (number of noisy tuples) / (number of total tuples). (3) Discovering rules Σ fromr. And (4) Applying Σ tor0.

We evaluate the scalability of the repair process described in Algorithm 5. Figure 6 shows that the process scales for source relation sizing from 4000 to 160000 tuples and for noise rate of 5 and 10%.

We evaluate the quality of the repair process embedded in the discovered eRs. We show the accuracy in terms of 2Note to the referee: At the time of the submission of our paper, authors of [16] did not disclosed all their eRs, only 5 of them are publicly available

3

(7)

Figure 6: Scalability w.r.t. data correction and Ac-curacy of data repair

pourcentage of errors corrected, defined as the ratio of (to-tal number of corrected tuples) / (to(to-tal number of noisy tuples). The source relation still may contain noises that are not fixed [10]. In the experiment of Figure 6 we have varied noise rate from 1 to 10% and set the total number of tuples to 100 000. The repair quality decreases when the noise rate increases, but it remains superior to 82% for all strategies. Heuristics are quite equivalent when inconsisten-cies are in low rate, less than 2% of noise. Baseline (H0) implements the Algorithm 5 which apply rules on the same order they are discovered and once. When the process is re-peated the total of effective rules applied increase, therefore “Baseline-Recall” (H0∗) increases the accuracy rate. The benefit increases more when rules are sorted with respect to the length of left hand sides. FromH0 to “Left-Hand-Side-Length-Sorted”H1 heuristic, the accuracy grows from 82 to 90% for a noise rate of 10%. The combination of sorting with respect to left hand sides length and iteration (H1∗) gives the best accuracy rate.

7.

CONCLUSION

Editing Rules are a new class of data quality rules boosted by the emergence of master data both in industry [11, 28, 30] and academia [16]. In this paper we propose a new semantics of Editing Rules in order to be able to infer them from exist-ing source database and a correspondexist-ing master database. Based on this new semantics, we have proposed a mining process in 3 steps: (1) Eliciting one-to-one correspondences between attributes of a source relation and attributes of the master database. (2) Mining CFDs in the master relations. Finally (3) Building Editing Rules.

Then we tackled the problem of data repair from our dis-covered Editing Rules. We have proposed a few cleaning heuristics. Finally, we have developed the algorithms and ran experiments. Results obtained have shown that our

ap-proach scales in the size of the database and provides good repair results.

Many perspectives exist, for instance the inference of many-to-many correspondences instead of one-to-ones. The main problem is then to propagate the CFDs into the source data with the “right” attribute. We quote also that the notion of equivalence classes explored in [6] could be interesting in our context. We also plan to extend our proposals to deal with many source and master relations.

8.

REFERENCES

[1] S. Abiteboul, R. Hull, and V. Vianu.Fondations of Databases. Vuibert, 2000.

[2] R. Agrawal, T. Imielinski, and A. N. Swami. Mining association rules between sets of items in large databases. InProceedings of the 1993 ACM SIGMOD International Conference on Management of Data, Washington, D.C., May 26-28, 1993, pages 207–216. ACM Press, 1993.

[3] R. Agrawal and R. Srikant. Fast algorithms for mining association rules. InProceedings of the 1994 VLDB International Conference, 1994. VLDB Press, 1994. [4] J. Bauckmann, U. Leser, F. Naumann, and V. Tietz.

Efficiently detecting inclusion dependencies. InICDE, pages 1448–1450, 2007.

[5] Z. Bellahsene, A. Bonifati, and E. Rahm, editors.

Schema Matching and Mapping. Springer, 2011. [6] P. Bohannon, W. Fan, and M. Flaster. A cost-based

model and effective heuristic for repairing constraints by value modification. InIn ACM SIGMOD

International Conference on Management of Data, pages 143–154, 2005.

[7] P. Bohannon, W. Fan, F. Geerts, X. Jia, and A. Kementsietsidis. Conditional functional dependencies for data cleaning. InICDE, pages 746–755, 2007.

[8] F. Chiang and R. J. Miller. Discovering data quality rules.PVLDB, 1(1):1166–1177, 2008.

[9] F. Chiang and R. J. Miller. A unified model for data and constraint repair. InProceedings of the 2011 IEEE 27th International Conference on Data Engineering, ICDE ’11, pages 446–457, Washington, DC, USA, 2011. IEEE Computer Society.

[10] G. Cong, W. Fan, F. Geerts, X. Jia, and S. Ma. Improving data quality: Consistency and accuracy.

VLDB, 2007.

[11] Deloitte and Oracle.Getting Started with Master Data Management. Deloitte and Oracle White paper, 2005. [12] T. Diallo, N. Novelli, and J.-M. Petit. Discovering

(frequent) constant conditional functional

dependencies.International Journal of Data Mining, Modelling and Management (IJDMMM), Special issue ”Interesting Knowledge Mining”:1–20, 2012.

[13] J. Euzenat and P. Shvaiko.Ontology matching. Springer-Verlag, Heidelberg (DE), 2007.

[14] W. Fan, F. Geerts, X. Jia, and A. Kementsietsidis. Conditional functional dependencies for capturing data inconsistencies.ACM Trans. Database Syst., 33(2), 2008.

[15] W. Fan, F. Geerts, J. Li, and M. Xiong. Discovering conditional functional dependencies.IEEE Trans. Knowl. Data Eng., 23(5):683–698, 2011.

(8)

[16] W. Fan, J. Li, S. Ma, N. Tang, and W. Yu. Towards certain fixes with editing rules and master data. In

Proceedings of VLDB’10, Sept 2010.

[17] W. Fan, J. Li, S. Ma, N. Tang, and W. Yu. Interaction between record matching and data repairing. In

SIGMOD Conference’11, pages 469–480, 2011. [18] L. Golab, H. Karloff, F. Korn, D. Srivastava, and

B. Yu. On generating near-optimal tableaux for conditional functional dependencies.Proc. VLDB Endow., 1(1):376–390, 2008.

[19] Y. Huhtala, J. Karkkainen, P. Porkka, and H. Toivonen. Tane: An efficient algorithm for discovering functional and approximate dependencies.

The Computer Journal, 42(3):100–111, 1999. [20] J. Kang and J. F. Naughton. On schema matching

with opaque column names and data values. In

SIGMOD, pages 205–216. ACM Press, 2003. [21] S. Lopes, J.-M. Petit, and L. Lakhal. Efficient

discovery of functional dependencies and armstrong relations. InEDBT, volume 1777 ofLNCS, pages 350–364, Konstanz, Germany, 2000. Springer. [22] S. Lopes, J.-M. Petit, and F. Toumani. Discovering

interesting inclusion dependencies: application to logical database tuning.Inf. Syst., 27(1):1–19, 2002. [23] D. Loshin.Master Data Management. Morgan

Kaufmann, 2009.

[24] M. J. Maher and D. Srivastava. Chasing constrained tuple-generating dependencies. InPODS, pages 128–138, 1996.

[25] R. Medina and L. Nourine. Conditional functional dependencies: An fca point of view. InICFCA, pages 161–176, 2010.

[26] N. Novelli and R. Cicchetti. Fun: An efficient algorithm for mining functional and embedded dependencies. InICDT, pages 189–203, 2001. [27] N. Pasquier, Y. Bastide, R. Taouil, and L. Lakhal.

Discovering frequent closed itemsets for association rules. InICDT, pages 398–416, 1999.

[28] D. Power.A Real Multidomain MDM or a Wannabe. Orchestra Networks white paper, 2010.

[29] E. Rahm and P. A. Bernstein. A survey of approaches to automatic schema matching.The VLDB Journal, 10:334–350, December 2001.

[30] P. Russom.Defining Master Data Management. the data warehouse institute, 2008.

[31] C. Wyss, C. Giannella, and E. Robertson. Fastfds: A heuristic-driven, depth-first algorithm for mining functional dependencies from relation instances extended abstract.Data Warehousing and Knowledge Discovery, pages 101–110, 2001.

[32] M. Yakout, A. K. Elmagarmid, J. Neville,

M. Ouzzani, and I. F. Ilyas. Guided data repair.Proc. VLDB Endow., 4(5):279–289, Feb. 2011.

[33] M. Zhang, M. Hadjieleftheriou, B. C. Ooi, C. M. Procopiuc, and D. Srivastava. On multi-column foreign key discovery.PVLDB, 3(1):805–814, 2010.

Figure

Figure 1: A Toy relation r 0
Figure 2: source relation r and master database {s, u}
Figure 3: a relation r 1 over ABCDE and a set of CFDs
Figure 5: Scalability w.r.t. response time and mem- mem-ory usage
+2

References

Related documents

In this whitepaper primer, we outline the benefi ts and costs of Integrated Financial Planning (IFP) so that any senior fi nancial professional can determine if, how, and when

Anastassiou, Quantitative approximation by fractional smooth Picard singular operators, 2009 (submitted for publication). Anastassiou, On right fractional calculus, Chaos, Solitons

The presentation and positioning of ANPs and practice nurses in relation to general practitioners on the websites in this study can be seen to maintain and, in some ways,

Visual Genome aims to bridge the gap between all these datasets, collecting not just annotations for a large number of objects but also scene graphs, region descriptions, and

596 A large bronze figure of Buddha, presumably late Qing

Although this study showed various perspectives regarding career development plans of Dental students in Tanzania, Universities need to ascertain professional

The time between the start of this prodromal phase and the start of anti-psychotic treatment is sometimes referred to as duration of untreated illness (DUI). The onset of

Ramirez, OATH 2418/07 (petitioner was not entitled to retain custody of seized vehicle where it failed to make timely service of notice in both English and Spanish,