AMW Use Case - Metamodel comparison and model migration

AMW Logo

Metamodels need to be compared for several reasons. Two important reasons are:
1) to migrate the models conforming to different versions of a metamodel;
2) to represent the differences between two similar metamodels.

The objective of this use case is to demonstrate how weaving models created with the help of the AMW plugin are used to compare different models. The weaving model is used to produce model transformations between the models conforming to these metamodels.

Overview

This use case compares two different versions of the same metamodel, Scade(v1) and Scade(v2). The different versions have been developed by two different persons, based on a formal specification. Scade is a standard for development of embedded software for the Avionics Industry. The Scade metamodels developed are not the official version supported by the Scade suite. The goal is to produce a transformation that transforms the source model conforming to Scade(v1) into the target model conforming to Scade(v2). To be able to correctly transform the equivalent elements, it is necessary to compare the elements from both metamodels.

The first step is to create a weaving model containing equivalence links between the model elements. This is done by executing matching transformations and by refining the weaving model in the AMW prototype. These transformations assign a similarity value between the elements of both metamodels. For instance, we assign high similarity values for elements that have the same name and type. A high similarity value means the element have a good probability to the equivalent.

This weaving model is a declarative representation of the links between the metamodels. The weaving model is used to produce a model transformation. This model transformation is responsible to translate the source model into the target model.



"Metamodel comparison" Use Case's Overview

The comparison weaving model conforms to a weaving metamodel that is an extension of the core weaving metamodel. The metamodel extension contains an Equivalent link. This link contains a similarity attribute that saves the similarity estimation between a left and a right element. This link is extended by different kinds of links, depending on the type of elements that are being compared, for example AttributeEqual and ReferenceEqual. The relations between ElementEqual and AttributeEqual links are created according to the containment relations between Classes and Attributes. For the elements that have similarity value lower than a given threshold, the Equivalent links are rewritten into NotEquivalent links.



Metamodel extension for comparison (excerpt)

The weaving model is used to produce a transformation from the source model into the target model. A rule from this transformation is shown below.



Transformation rule automatically generated

Download and examples

Metamodel
Comparison

The Atlas Model Weaver plugin has an integrated environment that enables to easily compare two models. Go to the download page. AMW also produces a model transformation based on a weaving model. These functionalities are available on the weaving panel context menu.

The accuracy of the weaving model depends on the proximity of the models that are compared.

Scade simple

This example uses two simplified versions of the Scade metamodels (arround 30 classes) to easily illustrate the metamodel comparison use case.

Scade complete

This example is a full version of the Scade metamodels, with arround 400 elements each. It contains the weaving models and the transformation that was generated.

Example HowTo

This document is a step-by-step HowTo that explains how to execute the examples.

Related use cases

Matching

Matching is the generic process that creates weaving models. This use case gives a general overview of the matching process, and how it is handled by AMW and ATL.

Model difference

This use case calculates the differences between two models. The difference between two models is an essential process to control the changes and evolutions of models. The result of the difference is used to apply a patch in the models.

Tool interoperability

This use case shows how weaving models are used to capture the semantic heterogeneities between different tools' metamodels. We use two well known bug tracking tools, Mantis and Bugzilla.

Bridge between SQL and KM3

This use case shows how weaving models and model transformations are used to translate SQL-DDL (Data Definition Language) into KM3 (a modeling technical space) and also to translate KM3 into SQL.

Relational DB to XML

This use case shows how weaving models can be used to perform the data mapping between relational DBs and XML.

Merge of geographical information (GML) and statistical data

This use case presents a weaving model used to define a merge operation between a metamodel with geographical information (an extension of GML) and a metamodel with statistical data into a graphical representation (SVG).

Bridge between DSL and UML Profiles

This use case shows how AMW and ATL are used to produce a bridge between Domain Specific Languages (DSLs) and UML profiles.

System Architecture (SA) management

This use case shows how to map the overlapping concepts of different views of a complex system. It uses a System Architecture (SA) framework called DoDAF (Department of Defense Architecture Framework).

Acknowledgement

The present work is being supported by the OpenEmbeDD project, the ModelPlex european project, and the Usine Logicielle project of the System@tic Paris Region Cluster.