Example 1 - Formalization of Encoding
- Encoding of dom and its subsets is done by using the symbols 0 and 1.
- Let d Í dom and let a = {d0, d1,..di,...} be an enumeration of d.
- The encoding of d relative to a is the function enca which maps di to the binary representation of i (with no leading zeros) for each di Î d.
- enca(di) represents the encoding of di.
Given:
- d Í dom
- Enumeration a for d
- Target schema S
- Source schema R = {R1, ..., Rm}. The encoding of instances of R uses the alphabet {0, 1, [, ], #} È R È {S}
An instance I over R with adom(I) Í d is encoded relative to a as follows:
1. enca(<a1,...,ak) is [enca(a1)#...#enca(ak)].
2. enca(I(Ri)), for Ri Î R, is Ri enca(t1)...enca(tl), where t1,...,tl are tuples in I(Ri) in the lexicographic order induced by the enumeration a.
3. enca(I) = enca(I(R1))...enca(I(Rm))
Let R = {P, Q}, I be the following instance over R and let a = abc:
P : Q :
a b c c
b a
Then enca(I) = P[0#1][1#0]Q[10#10].