18
What is a Quasi- Inverse? Jordan Johnson May 29, 2008 TWIGS at UCSC

What is a Quasi-Inverse?

Embed Size (px)

DESCRIPTION

What is a Quasi-Inverse?. Jordan Johnson May 29, 2008 TWIGS at UCSC. A. B. Background: Data Exchange. Given: Databases A, B Problem: Populate B with data from A. Background: Schemata. A, B specified by schemata S , T Mappings relate the schemata. S = { EmployeeDB: { - PowerPoint PPT Presentation

Citation preview

Page 1: What is a Quasi-Inverse?

What is a Quasi-Inverse?

Jordan JohnsonMay 29, 2008TWIGS at UCSC

Page 2: What is a Quasi-Inverse?

Background: Data Exchange

• Given: Databases A, B• Problem: Populate B with data from A

A B

Page 3: What is a Quasi-Inverse?

Background: Schemata

• A, B specified by schemata S, T

• Mappings relate the schemata

S = { EmployeeDB: {

HrlyEmp(id, name, wage),

SalariedEmp(id, name, sal)

} }

T = { PersonnelDB: {

Emp(id, name, ssn)

} }

Page 4: What is a Quasi-Inverse?

Background: A Mapping

M = (S, T, )where = {

(id, nm, w):HrlyEmp(id, nm, w) (ssn): Emp(id, nm, ssn),

(id, nm, s):SalariedEmp(id, nm, s) (ssn): Emp(id, nm, ssn)

}are tuple generating dependencies specifying the mapping.

Page 5: What is a Quasi-Inverse?

• Mappings as data?• Operations on mappings:

compose [Madhavan/Halevy, 2003] match/diff/etc [Bernstein, 2003] invert [Fagin, 2006]

Well, only sometimes…

Background: what, more?

Page 6: What is a Quasi-Inverse?

The problem with inverses…

• Original must be injective.

• S-T mapping Defined w.r.t. schemata

Domain/range are DB instances

Page 7: What is a Quasi-Inverse?

Our example again:

(id, nm, w):HrlyEmp(id, nm, w) (ssn): Emp(id, nm, ssn),

(id, nm, s):SalariedEmp(id, nm, s) (ssn): Emp(id, nm, ssn)

Page 8: What is a Quasi-Inverse?

Other problematic mappings:

• Projection: {P(x, y) Q(x)}

• Union: {P(x) R(x), Q(x) R(x)}

• Decomposition: {P(x, y, z) Q(x, y) ^ R(y, z)}

Page 9: What is a Quasi-Inverse?

Quasi-Inverse (of a function)

• Given f : X -> Y, a function g is a quasi-inverse if: g : Z -> X, whereran(f) Z Y, and

f g f = f

Page 10: What is a Quasi-Inverse?

Quasi-Inverse (of a function)

• Examples: f(x) = x2

g1(x) = sqrt(x)

g2(x) = -sqrt(x)

f(x) = x g(x) = x + , where 0 1.

Page 11: What is a Quasi-Inverse?

Features of Quasi-Inverses

• Weaker conditions than for inverse

• Still recovers some of the original

• If an inverse f exists: a single quasi-inverse g exists g = f

Page 12: What is a Quasi-Inverse?

Quasi-Inverse (of a mapping)

• Problem:

What’s a good analogous quasi-inverse definition for schema mappings?

Page 13: What is a Quasi-Inverse?

Quasi-Inverse (of a mapping)

• Idea: Parameterize the idea of “inverse” w.r.t. equivalence relations ~1, ~2 on schema instances.

Page 14: What is a Quasi-Inverse?

Quasi-Inverse: Preliminaries

• S´ is a replica of S.• Instance I´ is a replica of I.• For mapping M = (S, S´, ),

Inst(M) = set of all (I1, I2) such that I1 and I2 are instances of S, S´ (resp.) and satisfy .

Id = (S, S´, id), where id containsR(x) -> R(x) for all R in S.

Note: I1 (Inst(Id)) I2 if I1´ I2.

Page 15: What is a Quasi-Inverse?

Quasi-Inverse: Preliminaries

• Note: M’ is an inverse of M ifInst(Id) = Inst(M’ · M).

• For a binary relation D, letI1 D[~1, ~2] I2

if there exist J1, J2

such that (I1, I2) ~(1,2) (J1, J2)

and J1 D J2.

Page 16: What is a Quasi-Inverse?

Quasi-Inverse (of a mapping)

• Formal definition: Given a mapping M = (S, T, ),M´ = (T, S, ´) is a (~1, ~2)-inverse of M iffInst(Id)[~1, ~2] = Inst(M’ · M)[~1, ~2].

Page 17: What is a Quasi-Inverse?

Quasi-Inverse (of a mapping)

• Again, M = (S, S´, ).• Let Sol(M, I) be the set of solutions for instance I under M: all J such that (I, J) satisfy .

• Let (I1 ~M I2) Sol(M, I1) = Sol(M, I2).

• M’ is a quasi-inverse of M means:M’ is a (~M, ~M)-inverse of M.

Page 18: What is a Quasi-Inverse?

Example Quasi-Inverses

• Projection: {P(x, y) Q(x)}

QI: {Q(x) z.P(x,z)}

• Union: {P(x) R(x), Q(x) R(x)}

QI: {R(x) P(x) Q(x)}