Algorithm Search⌘K

Definitioncore

Schema mapping

Also called source-to-target dependencies.

A specification, usually by tuple-generating dependencies, of how the data of a source schema relates to a target schema.

A schema mapping is a formal statement of how the data of a source schema relates to the data of a target schema, usually given as a set of source-to-target tuple-generating dependencies. Its meaning is the set of pairs of a source instance and a target instance that satisfy it. This page gives the general form and its semantics. The page on GAV and LAV covers the two restricted forms that data integration uses, where one side of each rule is a single relation, and how queries are answered under them.

Definition

Let S\mathbf{S} and T\mathbf{T} be two relational schemas with no relation name in common. Instances are sets of facts. Source instances hold constants only. Target instances may also hold labeled nulls ⊥1,⊥2,…\bot_1, \bot_2, \ldots, which stand for unknown values.

A schema mapping is a triple M=(S,T,Σ)\mathcal{M} = (\mathbf{S}, \mathbf{T}, \Sigma), where Σ=Σst∪Σt\Sigma = \Sigma_{st} \cup \Sigma_t is a finite set of dependencies.

  • Σst\Sigma_{st} is a set of source-to-target tgds ∀x (φS(x)→∃y ψT(x,y))\forall x\, (\varphi_{\mathbf S}(x) \to \exists y\, \psi_{\mathbf T}(x, y)), where φS\varphi_{\mathbf S} is a conjunction of atoms over S\mathbf{S} and ψT\psi_{\mathbf T} is a conjunction of atoms over T\mathbf{T}.
  • Σt\Sigma_t is a set of target dependencies over T\mathbf{T} alone, usually tgds ∀x (φT(x)→∃y ψT(x,y))\forall x\, (\varphi_{\mathbf T}(x) \to \exists y\, \psi_{\mathbf T}(x, y)) and egds ∀x (φT(x)→xi=xj)\forall x\, (\varphi_{\mathbf T}(x) \to x_i = x_j). It may be empty.

The semantics of M\mathcal M is the set

[ ⁣[M] ⁣]={ (I,J)  :  I is an instance of S, J is an instance of T, (I,J)⊨Σ }.[\![\mathcal M]\!] = \{\, (I, J) \;:\; I \text{ is an instance of } \mathbf S,\ J \text{ is an instance of } \mathbf T,\ (I, J) \models \Sigma \,\}.

For a source instance II, a target instance JJ with (I,J)∈[ ⁣[M] ⁣](I, J) \in [\![\mathcal M]\!] is a solution for II. Two mappings are equivalent if they have the same semantics.

Some named forms of source-to-target tgds:

  • Full: no existential variables, so the head uses only values of the source.
  • GAV: full, with a single atom in the head.
  • LAV: a single atom in the body.

The general form, with conjunctions on both sides, contains both GAV and LAV rules.

Examples and non-examples

A mapping with new values. The source has Flight(x,y)\text{Flight}(x, y), a direct flight from xx to yy. The target has Leg(x,y)\text{Leg}(x, y), a leg of a trip. The mapping has the two source-to-target tgds

d1:∀x,y (Flight(x,y)→∃z (Leg(x,z)∧Leg(z,y))),d_1 : \forall x, y\, (\text{Flight}(x, y) \to \exists z\, (\text{Leg}(x, z) \wedge \text{Leg}(z, y))),
d2:∀x,y (Flight(x,y)→∃u Leg(x,u)).d_2 : \forall x, y\, (\text{Flight}(x, y) \to \exists u\, \text{Leg}(x, u)).

So each flight becomes two legs through an unknown stop. For I={Flight(a,b),Flight(b,c)}I = \{\text{Flight}(a, b), \text{Flight}(b, c)\}, the instance {Leg(a,⊥1),Leg(⊥1,b),Leg(b,⊥2),Leg(⊥2,c)}\{\text{Leg}(a, \bot_1), \text{Leg}(\bot_1, b), \text{Leg}(b, \bot_2), \text{Leg}(\bot_2, c)\} is a solution. So is {Leg(a,b),Leg(b,b),Leg(b,c),Leg(c,c)}\{\text{Leg}(a, b), \text{Leg}(b, b), \text{Leg}(b, c), \text{Leg}(c, c)\}, with the stops set to bb and cc. The mapping does not fix one target instance. The data exchange problem asks which solution to build.

A full mapping. ∀x,y,z (Emp(x,y)∧Dept(y,z)→WorksIn(x,z))\forall x, y, z\, (\text{Emp}(x, y) \wedge \text{Dept}(y, z) \to \text{WorksIn}(x, z)) copies a join of the source into the target. It makes no nulls.

Not definable: an exact copy. Let S\mathbf S have one relation RR and T\mathbf T one relation R′R'. The relation "JJ is II with RR renamed to R′R'" is not the semantics of any mapping of the form above. Assume a mapping has this semantics, and let I⊊I2I \subsetneq I_2 be two source instances with copies J⊊J2J \subsetneq J_2. Then (I2,J2)(I_2, J_2) satisfies Σ\Sigma, so J2J_2 satisfies Σt\Sigma_t. The bodies of Σst\Sigma_{st} read only the source, and their heads stay true when facts are added, so (I,J2)(I, J_2) satisfies Σst\Sigma_{st} as (I,J)(I, J) does. So (I,J2)(I, J_2) is in the semantics, but J2J_2 is not the copy of II.

Not closed under composition. Two mappings given by source-to-target tgds can compose to a mapping that no finite set of first-order tgds defines. The page on schema mapping composition gives the example and the second-order tgds that repair this.

  • Correspondences. A schema matching step finds pairs of elements that mean the same, such as the first column of Flight and the first column of Leg. A mapping adds the joins, the new values and the grouping that the correspondences leave open. Tools generate candidate mappings from correspondences and let a person choose.
  • GAV and LAV. The restricted forms used for a virtual, integrated view of many sources; see GAV and LAV.
  • Universal solution. A solution with a homomorphism into every solution; see universal solution. The chase builds one.
  • Certain answers. The answers of a target query that hold in every solution; see certain answers.
  • Weak acyclicity. A condition on Σt\Sigma_t that makes the chase stop; see weak acyclicity.
  • Operators on mappings. Composition, inversion and the test that a mapping has a solution for some source are studied as metadata management.

References

  1. Marcelo Arenas, Pablo Barceló, Leonid Libkin and Filip Murlak, Foundations of Data Exchange, Cambridge University Press, 2014, Chapter 3, Data exchange: key definitions, and Chapter 17, What is metadata management?
  2. Ronald Fagin, Phokion G. Kolaitis, Renée J. Miller and Lucian Popa, Data exchange: semantics and query answering, Theoretical Computer Science 336(1), 2005, the definition of a data exchange setting
  3. Maurizio Lenzerini, Data integration: a theoretical perspective, PODS 2002, pages 233-246
  4. AnHai Doan, Alon Halevy and Zachary Ives, Principles of Data Integration, Morgan Kaufmann, 2012, Chapter 5, Schema Matching and Mapping

Where this leads

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW4 complete
  • a review of the text: no review record reviews/DPX9ZV/text.yaml