Definitionadvanced
Why-provenance and where-provenance
Also called why-provenance, where-provenance, witness basis.
The sets of input tuples that witness an output tuple, and the input locations from which each output value was copied.
Why-provenance and where-provenance are two ways to explain an answer of a query by the input data. The why-provenance of an output tuple is a set of witnesses: sets of input tuples that are enough to produce it, one for each way the query derives it. The where-provenance of a value in an output tuple is the set of input locations, a relation, a tuple and an attribute, from which the query copied that value. Buneman, Khanna and Tan defined both in 2001, and showed that the minimal witnesses depend only on the meaning of the query, while where-provenance depends on how the query is written.
Definition
The setting is the positive relational algebra (selection, projection, natural join, union and renaming) under set semantics, as on the relational algebra page. Each input tuple has an identifier, written , so that a set of tuples is a set of identifiers. is the input instance and a query; all queries here are monotone, so implies .
Witnesses. For , a witness for is a set with . The set of all witnesses is upward closed: a superset of a witness, inside , is a witness. A witness is minimal if no proper subset is a witness.
Witness basis (why-provenance). The witness basis is a set of witnesses defined by induction on the expression , one witness for each derivation of :
- for ;
- ;
- ;
- , where and are the two parts of ;
- , where a part is empty when is not in that side.
Each member of the witness basis is a witness, by induction on . The minimal witness basis is the set of minimal members of .
Where-provenance. A location is a triple : relation , tuple and attribute . For an output tuple and an attribute of , the where-provenance is a set of locations, by induction:
- ;
- selection keeps the where-provenance of its input;
- projection takes the union over the input tuples with ;
- a natural join copies the value of a join attribute from both sides, so for a shared attribute it takes the union of the two sides, and for any other attribute it takes the side that has ;
- union takes the union of the two sides;
- a value that the query writes as a constant, such as in , has empty where-provenance.
The why-provenance is about tuples, and the where-provenance is about single values in them.
Two facts (Buneman, Khanna and Tan 2001).
- The minimal witness basis is the set of minimal witnesses. Every witness contains a member of the witness basis: if , some derivation of uses only tuples of , and the member of that it gives is a subset of . So the minimal members of are exactly the minimal witnesses, and equivalent queries have the same minimal witness basis, since they have the same witnesses.
- Where-provenance is not invariant. Two equivalent queries can give different where-provenance, as the second example below shows.
From fact 1 and monotonicity: for every set of deleted tuples, if and only if some minimal witness of is disjoint from . So the minimal witness basis answers every question of the form "does survive the deletion of ?".
Examples and non-examples
Take with , , , and with , , . Let , the floors on which someone works. Then .
- Why-provenance. The output has two derivations, through and , so ; both are minimal. Similarly and . Check by deletion: removing keeps all three answers, since and survive. Removing removes only, since is in both witnesses of . Removing and leaves only .
- Where-provenance. : the value 2 was copied from only, although and are needed to produce it. For , the value comes from both sides of the join, and is the four locations , , , .
- Equivalent queries, same minimal witnesses. Let and . They are equivalent under set semantics, since the second part is contained in . For the output , , while . The witness bases differ, but the minimal witness basis is for both.
- Non-example: where-provenance of equivalent queries. On a relation with the tuple , the queries and are equivalent. For the output and attribute , the first gives , because selection copies the value, and the second gives , because the value is a constant of the query.
- Non-example: queries with difference. For , the output depends on the absence of tuples, so a set of present tuples is not enough to explain it, and the witness definitions above do not apply. Removing a tuple can add an output. Provenance for queries with negation needs other models.
Related definitions
- Lineage. Cui, Widom and Wiener (2000) defined the lineage of a view tuple as the source tuples that contribute to it, for select-project-join views with aggregation and set operations. For a positive query, the lineage of is the union of the members of its witness basis: for the output above. Lineage loses the information of which tuples work together.
- Provenance semirings. Green, Karvounarakis and Tannen (2007) showed that lineage, why-provenance and the minimal witness basis are each the annotations of a commutative semiring, and that each is a homomorphic image of the provenance polynomials ; see provenance semirings. For the example, the provenance polynomial of is ; forgetting the coefficients and exponents gives the why-provenance. Where-provenance is about locations, not about tuples, and is not a semiring annotation of this kind.
- Probabilistic databases. The probability of an output tuple on a probabilistic database with independent tuples is the probability that some minimal witness is fully present, so it depends only on the minimal witness basis and the tuple probabilities.
- Deletion propagation and view maintenance. The deletion criterion above is the basis of propagating deletions to a materialized view; incremental view maintenance keeps the counts of derivations for the same purpose.
- Recursive queries. For Datalog, a tuple can have infinitely many derivations, but it has only finitely many witnesses, since each is a subset of the finite instance. The minimal witnesses are defined as before and still answer the deletion question.
References
- Peter Buneman, Sanjeev Khanna and Wang-Chiew Tan, Why and where, a characterization of data provenance, Proceedings of the 8th International Conference on Database Theory (ICDT), LNCS 1973, 316 to 330 (2001), the definitions of witnesses, the witness basis and the minimal witness basis (why-provenance) and of where-provenance; the minimal witness basis is invariant under query equivalence and where-provenance is not
- Yingwei Cui, Jennifer Widom and Janet L. Wiener, Tracing the lineage of view data in a warehousing environment, ACM Transactions on Database Systems 25(2), 179 to 227 (2000), the lineage of a view tuple, the source tuples that contribute to it, for select-project-join views with aggregation and set operations
- Todd J. Green, Grigoris Karvounarakis and Val Tannen, Provenance semirings, Proceedings of the 26th ACM Symposium on Principles of Database Systems (PODS), 31 to 40 (2007), why-provenance, lineage and the minimal witness basis as semirings of annotations, and their relation to provenance polynomials
- James Cheney, Laura Chiticariu and Wang-Chiew Tan, Provenance in databases, why, how, and where, Foundations and Trends in Databases 1(4), 379 to 474 (2009), survey of lineage, why-provenance, how-provenance and where-provenance, with their definitions for the positive relational algebra
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 | W4 complete |
|
Tag XWZGP9 Edit this page History Report an error Markdown