Problemadvanced
Data exchange problem
Also called data exchange.
Given a source instance and a schema mapping, build a target instance that satisfies the mapping and answer queries over it.
The data exchange problem takes data structured under a source schema and a schema mapping to a target schema, and asks for a target instance that satisfies the mapping, built for real, together with a way to answer queries over it. The mapping usually allows many target instances, so the problem also asks which one to build and which query answers are trustworthy. This page states the problem and its complexity. The universal solution page defines the preferred target instances, and core computation gives the smallest of them. Unlike GAV and LAV integration, which leaves the target virtual, data exchange materializes it.
In plain words
An airline sends its timetable to a travel site. The two systems store trips in different ways, and a set of rules says how one form becomes the other. Some rules need values the airline does not have, such as the airport of a stop. The site must still store something, so it stores placeholders for the unknown values.
Many target databases follow the rules, and they disagree on the placeholders. The site wants one that claims nothing beyond what the rules force, so that a question gets only the answers that hold whatever the unknown values are. For simple questions, one database built in a mechanical way does this. With rules on the target side as well, a solution may not exist at all, and in the worst case no program can decide whether it does.
Definition
Input. A schema mapping , where is a set of source-to-target tgds and is a set of target tgds and egds . A source instance over constants. Set semantics holds throughout.
Solutions. A target instance , over constants and labeled nulls , is a solution for if satisfies .
The three tasks.
- Existence of solutions: decide whether has a solution.
- Materialization: build a solution, preferably a universal solution, which has a homomorphism into every solution.
- Query answering: for a target query , compute the certain answers .
Complexity is measured in data complexity, with and fixed and as the input, unless combined complexity is named.
Variants
- No target dependencies. . A solution always exists.
- Target egds. Keys and functional dependencies on the target. The chase can fail, and then no solution exists.
- Weakly acyclic target tgds and egds. The standard setting, where every chase stops; see weak acyclicity.
- Arbitrary target tgds. The chase may run forever.
- Other semantics. Closed world solutions, which allow only what the mapping justifies, give other certain answers, in particular for queries with negation.
- Other data models. XML data exchange, with tree patterns in the mapping.
Examples
The mapping has and .
A solution by the chase. For with , the chase gives
It is a universal solution. The query has the certain answers : these are the null-free answers of on .
A target egd that forces equalities. Add the egd : each city has at most one next leg. The chase on the same merges with and with , and the result is the first four facts of , up to the names of the nulls.
No solution. With the same egd and , every solution has . The egd gives and then . Two different constants cannot be equal, so the chase fails and has no solution.
Known algorithms
- The chase. Apply the dependencies as rules, with fresh nulls for the existential variables, until all hold. If it stops without failure, the result is a universal solution. If an egd equates two constants, there is no solution. For source-to-target tgds, the oblivious chase gives the canonical universal solution.
- Core computation. Shrink a universal solution to its core, the smallest universal solution; see core computation for data exchange.
- Naive evaluation. For a union of conjunctive queries, evaluate the query on any universal solution as if the nulls were constants and drop the tuples with nulls. The result is the certain answers.
- Query rewriting. For some classes of mappings and queries, rewrite the target query so that it runs on the source.
| Algorithm | Time | Space | Properties | Code |
|---|---|---|---|---|
| Core computation for data exchange | O(m^(w+2)) worst | O(m) extra | deterministicexactnot in placeofflineiterative | 1 language |
Bounds
All bounds are in data complexity unless stated.
- No target dependencies. The canonical universal solution has polynomial size and takes polynomial time. Certain answers of unions of conjunctive queries take polynomial time (theorem, Fagin, Kolaitis, Miller and Popa).
- Weakly acyclic target tgds with egds. Each chase sequence has polynomial length, so the existence of solutions is decidable in polynomial time, and a universal solution is built in polynomial time when one exists (theorem, same paper). Certain answers of unions of conjunctive queries stay polynomial.
- Combined complexity. With the mapping as part of the input, the chase can make a number of nulls doubly exponential in the size of the mapping, even for weakly acyclic sets.
- Arbitrary target tgds. The existence of solutions is undecidable (theorem; see Arenas, Barceló, Libkin and Murlak, Chapter 5, and Kolaitis, Panttaja and Tan for the complexity of the problem).
- Queries with inequalities. For some fixed conjunctive queries with inequalities the certain answers are coNP-complete. Abiteboul and Duschka showed this for views, which is data exchange with LAV source-to-target tgds and no target dependencies.
Reductions
- Certain answers to naive evaluation. For unions of conjunctive queries, is the set of null-free tuples of for any universal solution . The reason is that is preserved by homomorphisms, and maps into each solution.
- Data integration as data exchange. With , the solutions are the global databases of a data integration system with sound sources and the same mapping. So the certain answers are the same in both settings, and LAV query answering with views is a special case.
- Existence of a universal solution. When a solution exists and the chase stops, the chase result is universal. With weakly acyclic dependencies, a solution exists if and only if a universal solution exists.
Applications
- Extract, transform and load. Moving data from operational systems into a warehouse is data exchange, with mappings written as rules.
- Data migration. Moving a database to a new schema, keeping what the old data says and no more.
- Schema mapping tools. Research prototypes generate mappings from schema matching correspondences and run them as data exchange programs.
- Mapping management. Composition and inversion of mappings build on the semantics of data exchange.
References
- Ronald Fagin, Phokion G. Kolaitis, Renée J. Miller and Lucian Popa, Data exchange: semantics and query answering, Theoretical Computer Science 336(1), 2005, pages 89-124, data exchange settings, universal solutions, the chase and certain answers
- Marcelo Arenas, Pablo Barceló, Leonid Libkin and Filip Murlak, Foundations of Data Exchange, Cambridge University Press, 2014, Chapters 4 to 7: the problem of relational data exchange, existence of solutions, good solutions, query answering and rewriting
- Phokion G. Kolaitis, Jonathan Panttaja and Wang-Chiew Tan, The complexity of data exchange, PODS 2006, pages 30-39
- Serge Abiteboul and Oliver M. Duschka, Complexity of answering queries using materialized views, PODS 1998, pages 254-263, conjunctive queries with inequalities
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.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H0 no proof |
|
| Lean | L0 no Lean part |
|
| Visual | V0 none |
|
| Writing | W2 basic |
|
Tag H27N8G Edit this page History Report an error Markdown