Generation of ATL after executing equality and structural matchings

This example uses matching transformations to produce a weaving model between two versions of the same metamodel. It uses the same algorithms from the AMW_Match_SF example (see below). This example automatically produces an ATL transformation.

This example modifies the Book.km3 metamodel available the Atlantic Zoo. This way we have two versions of the same metamodel.
This example executes a set of matching transformations to automatically produce a weaving model. The weaving model contains links between the old and new versions of the metamodels.

Instructions

Executing the transformations

There is an Ant Script (scripts/executeAll.xml) that produces a weaving model (models/mw_refined_match.ecore) between two metamodels (models/Book.ecore and models/BookNew.ecore). BookNew.ecore is a modified version of Book.ecore. This weaving model in The script executes the following actions:

  • Executes the PropagationGraph.atl transformation. This transformation creates the cartesian product between the elements of the input metamodels and it calculates a similarity value between every pair of elements. The similarities are calculated using the name, cardinality and type.
  • Executes the SimilarityFlood.atl transformation. It propagates the similarity values calculated by PropagationGraph.atl through the elements that are connected.
  • Executes the Selects_SF_amw.atl transformation. This transformation selects a set of nodes with the best similarity values and creates a weaving model (models/mw_refined_match.ecore).
  • Executes the hot/AMWtoATL_Match.atl transformation. This transformation takes as input the weaving model generated by the matching transformations and it produces an ATL model as output (output/Book2BookNew.ecore).
  • Extracts the output/Book2BookNew.ecore model into an ATL file.

Loading the weaving model into AMW:

The weaving model (models/mw_refined_match.amw) can be loaded by double-clicking on the file or by using the wizard.

Remarks:

  • The ATL transformations can also be executed separatedly by using the corresponding launch configuration scripts.
  • The PropagationGraph.atl transformation contains rules that match more than one input element. This is a new feature of the ATL 2006 compiler. Instructions about how to install it are available here.
  • The "for" task that executes the SimilarityFlooding.atl transformation several times is not a standard Ant task, but a task available at the Ant Contrib project. It is necessary to install the "for" task as described here.
  • The SimilarityFlood.atl transformation has some performance issues when matching large models.
  • The final output transformation contains one expression that cannot be executed (transformation of authors). This shows the necessity to create more accurate matching transformations. More complex examples with more complex heuristics will be available gradually in this site.