Misplaced Pages

Embedded dependency

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.

In relational database theory, an embedded dependency (ED) is a certain kind of constraint on a relational database. It is the most general type of constraint used in practice, including both tuple-generating dependencies and equality-generating dependencies. Embedded dependencies can express functional dependencies, join dependencies, multivalued dependencies, inclusion dependencies, foreign key dependencies, and many more besides.

An algorithm known as the chase takes as input an instance that may or may not satisfy a set of EDs, and, if it terminates (which is a priori undecidable), output an instance that does satisfy the EDs.

Definition

An embedded dependency (ED) is a sentence in first-order logic of the form:

x 1 , , x n . ϕ ( x 1 , , x n ) z 1 , , z k . ψ ( y 1 , , y m ) {\displaystyle \forall x_{1},\ldots ,x_{n}.\phi (x_{1},\ldots ,x_{n})\rightarrow \exists z_{1},\ldots ,z_{k}.\psi (y_{1},\ldots ,y_{m})}

where { z 1 , , z k } = { y 1 , , y m } { x 1 , , x n } {\displaystyle \{z_{1},\ldots ,z_{k}\}=\{y_{1},\ldots ,y_{m}\}\setminus \{x_{1},\ldots ,x_{n}\}} and ϕ {\displaystyle \phi } and ψ {\displaystyle \psi } are conjunctions of relational and equality atoms. A relational atom has the form R ( w 1 , , w h ) {\displaystyle R(w_{1},\ldots ,w_{h})} and an equality atom has the form w i = w j {\displaystyle w_{i}=w_{j}} , where each of the terms w , . . . , w h , w i , w j {\displaystyle w,...,w_{h},w_{i},w_{j}} are variables or constants.

Actually, one can remove all equality atoms from the body of the dependency without loss of generality. For instance, if the body consists in the conjunction A ( x , y ) B ( y , z , w ) y = 3 z = w {\displaystyle A(x,y)\land B(y,z,w)\land y=3\land z=w} , then it can be replaced with A ( x , 3 ) B ( 3 , z , z ) {\displaystyle A(x,3)\land B(3,z,z)} (analogously replacing possible occurrences of the variables y {\displaystyle y} and w {\displaystyle w} in the head). Analogously, one can replace existential variables occurring in the head if they appear in some equality atom.

Restrictions

In literature there are many common restrictions on embedded dependencies, among with:

When all atoms in ψ {\displaystyle \psi } are equalities, the ED is an EGD and, when all atoms in ψ {\displaystyle \psi } are relational, the ED is a TGD. Every ED is equivalent to an EGD and a TGD.

Extensions

A common extension of embedded dependencies are disjunctive embedded dependencies (DED), which can be defined as follows:

x 1 , , x n . ϕ ( x 1 , , x n ) i = 1 z 1 i , , z k i . ψ ( y 1 i , , y m i ) {\displaystyle \forall x_{1},\ldots ,x_{n}.\phi (x_{1},\ldots ,x_{n})\rightarrow \bigvee _{i=1}^{\ell }\exists z_{1}^{i},\ldots ,z_{k}^{i}.\psi (y_{1}^{i},\ldots ,y_{m}^{i})}

where { z 1 i , , z k i } = { y 1 i , , y m i } { x 1 , , x n } {\displaystyle \{z_{1}^{i},\ldots ,z_{k}^{i}\}=\{y_{1}^{i},\ldots ,y_{m}^{i}\}\setminus \{x_{1},\ldots ,x_{n}\}} and ϕ {\displaystyle \phi } and ψ {\displaystyle \psi } are conjunctions of relational and equality atoms.

Disjunctive embedded dependencies are more expressive than simple embedded dependencies, because DEDs in general can not be simulated using one or more EDs. An even more expressive constraint is the disjunctive embedded dependency with inequalities (indicated with DED {\displaystyle ^{\neq }} ), in which every ψ {\displaystyle \psi } may contain also inequality atoms.

All the restriction above can be applied also to disjunctive embedded dependencies. Beside them, DEDs can also be seen as a generalization of disjunctive tuple-generating dependencies (DTGD).

References

  1. ^ (Kanellakis 1990)
  2. ^ (Abiteboul, Hull & Vianu 1995, p. 217)
  3. Greco, Sergio; Zumpano, Ester (Nov 2000). Michel Parigot, Andrei Voronkov (ed.). Querying Inconsistent Databases. 7th International Conference on Logic for Programming Artificial Intelligence and Reasoning. Reunion Island, France: Springer. pp. 308–325. doi:10.1007/3-540-44404-1_20.
  4. ^ (Deutsch 2009)
  5. Zhang, Heng; Jiang, Guifei (Jun 2022). Characterizing the Program Expressive Power of Existential Rule Languages. AAAI Conference on Artificial Intelligence. Vol. 36. pp. 5950–5957. arXiv:2112.08136. doi:10.1609/aaai.v36i5.20540.

Further reading

Categories: