переведи и структурированно перескажи 5. Migration transformations
In this section we formalise migration transformations occurring between legacy data sources of a legacy system and new data
sources of a target system. In order to have sufficient expressive power for specifying complex transformations in a comprehensive
manner, we adopt abstract state machines (ASMs), a high-level specification language introduced by Gurevich [10]. As ASMs are
distinguished from other computation models by the power of modelling algorithms at arbitrary levels of abstraction, we have the
capability of modelling each migration transformation as a deterministic computation executed at a flexible but fixed level of
abstraction.
Definition 3. A transformation is a tuple ð Þ M; M0; Mn; δ consisting of a non-empty setM of models together with an initial model
M0 ∈M and a final model Mn ∈M, and a one-step transition function δ over M, i.e., δ : M↦M.
The one-step transition function δ is determined by a transition rule inductively defined by
• update rule: the value of the object τ(t1,…,tn) is updated to t0,
τ t1;…;tn ð Þ :¼ t0
• conditional rule: if ϕ is true, then execute the rule R; otherwise do nothing,
if ϕ then R endif
• block rule: the rules R1,…,Rn are executed in parallel,
par R1…Rn endpar
• sequential rule: the rules R1,…,Rn are executed sequentially,
seq R1…Rn endseq
Fig. 8. Galois connection between abstract and concrete models.
B. Thalheim, Q. Wang / Data & Knowledge Engineering 87 (2013) 260–278 269
• forall rule: the rule R is executed in parallel for each x1,…,xn satisfying φ,
forall x1,…,xn with φ do R enddo
• call rule: the rule R is called with parameters t1,…,tn.
R t1;…;tn ð Þ
A rule declaration is an expression R(x1,…,xn)=R′ for a rule R′ and the free variables of R′ are x1,…,xn. In a rule R(t1,…,tn), the
variables x1,…,xn in R′ are replaced by the parameters t1,…,tn, respectively.
An update is a pair (‘, b), where ‘ is an object and b is called the value of ‘. An update set Δ is a set of updates. An update set Δ is
consistent if it does not contain conflicting updates, i.e., for all (‘, b), (‘, b′)∈Δ we have b=b′.
Applying a transition rule R over a model M yields a set Δ(R, M) of updates on objects. If Δ(R, M) is consistent, then updates in
Δ(R, M) lead a transformation from the current model M to its successor model δ(M) such that there exists a unique model S′=
S+Δ resulting from updating S with Δ:
valSþΔð Þ¼ ‘ b if ð Þ ‘; b ∈Δ
valSð Þ‘ else :
A run is a finite sequence M0,…,Mn of models with Mi≠Mn for 0bibn, and δ(Mi)=Mi+1 for all i=0,…,n−1.
In the rest of this section, we will formally present two fundamental subclasses of migration transformations.
5.1. Property-preserving transformations
The first subclass of migration transformations is property-preserving transformations, which transform data and their
description from one model (i.e., an initial model) to another model (i.e., a final model) in a way that preserves data and
constraints of the initial model.
Suppose that a logic L is used for expressing queries over models of property-preserving transformations. If Ψ is a set of
formulae, then Ψ[τ1←φ1,…,τk←φk] is also a set of formulae, which is obtained by substituting each object type τi(x1,…,xk) in Ψ
by a formula φi where fr(φi)={x1,…,xk}.
Definition 4. A property-preserving transformation (PPT) is a transformation Π ¼ Mð Þ ; M0; Mn; δ , where M0 ∈Mð Þ S0 for S0=
(T0,Σ0) and Mn ∈Mð Þ Sn for Sn= (Tn,Σn), satisfying the following conditions:
• ∧ 0≤ibj≤n
Mi⪯LMj, and
• there exists a set ΦpFð Þ L; Tn of constraints that is equivalent to Σ0, i.e., Φ=Σ0[τ1←φ1,…,τk←φk], and Mn⊨ ∧
ϕ∈Φ
ϕ holds.
In the above definition, the first condition ensures that data in a model Mi can always be retrieved from its successor model Mj
even when their schemata are different, i.e., Mj reflects Mi. The second condition requires an equivalent form of constraints
imposed on the initial model M0 to be satisfied by the final model Mn.
Property-preserving transformations in data migration include extracting a legacy kernel, mapping data between models with
different schemata, loading a new kernel, etc.
Example 5. The transformation PA in Example 1 is a PPT that extracts the legacy kernel. If the constraints φ1 and φ2 (over SA) in
Example 3 are imposed on the initial model of PA, then the following constraint φ1′, which is in an equivalent form of φ1 over
Slegacy, needs to be satisfied by the final model of PA.
φ′
1≡∀x1; x3; y1; y3⋅ðð∃x2; x4⋅CARRIER x1; “truck”; x2; x3; x4 ð Þ ; “A” ∧
∃y2; y4⋅CARRIER y1; “truck”; y2; y3; y4 ð Þ ; “A” ∧x3≠y3Þ⇒x1≠y1Þ
:
Note that the constraint corresponding to φ2 of SA becomes trivial in Slegacy after the transformation. □
In general a legacy system may have a number of legacy data sources managed in heterogeneous environments, e.g., Oracle
databases, flat files, XML documents, Excel spreadsheets, and Access databases. Therefore, the first step in the ETL process of data
migration is to extract a legacy kernel that consolidates all legacy data sources. In order to handle heterogeneity of legacy data
sources, such task should be performed at a high level of abstraction. The resulting legacy kernel must preserve data of each
legacy data source without loss of information. Therefore, a legacy kernel is the least upper bound of a set of abstract models
corresponding to legacy data sources in terms of a reflecting relation determined by the specific logic for querying these abstract
models.
Definition 5. Let M′ ¼ f g M1;…; Mn be a set of abstract models from the same model space ð Þ M; ⪯; ⊥;⊤; ⊔; ⊓ , i.e., M′
pM. Then
the legacy kernel MK of M′ is the least upper bound of models in M′ satisfying ⊔M′
⪯MK .
Transformations for mapping data between two models with different schemata are generally considered as PPTs. According to
Definition 4, a PPT requires that data in the initial model of a PPT must be preserved in its final model without loss of information.
270 B. Thalheim, Q. Wang / Data & Knowledge Engineering 87 (2013) 260–278
Note that, although transformations for mapping data often operate at the schema level, e.g., specifying mappings between schema
components of two models, not every transformation for mapping data can be handled as a schema transformation. We allow
transformations for mapping data between two models to leverage the semantics defined at the data level, so such transformations
are not always generic [4]. For example, depending on data in a model, different mapping functions can be initiated for transforming different types of data.
Loading a new kernel is a PPT that can often be straightforwardly defined. We thus skip the detailed discussion on such
transformations.