AMW Use Case - Bridge between SQL-DDL and KM3

AMW Logo

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 to translate KM3 into SQL. In model management platforms, this use case is considered an application of ModelGen operations.

Overview

The development of bridges between different technical spaces is a complex process divided in several phases. This use case illustrates a bridge between an SQL-DDL file into a KM3 file. The SQL-DDL file conforms to a SQL grammar, for example with standard CREATE TABLE statements. KM3 is a standard language for defining metamodels for the modeling world.

The first step of the bridging process is to inject the SQL-DDL file into the EMF technical space (Ecore is the metametamodel). The injection creates an SQL-DDL model that conforms to an SQL-DDL metamodel (see Figure 1.a). This metamodel is created manually by a developer.

Then a weaving model (Mw) is created between the SQL-DDL and KM3 metamodels. Mw conforms to MMw, which is an extension to the core weaving metamodel. This extension contains different kinds of links that define the equivalences between the elements of SQL-DDL and the elements of KM3. However, these two metamodels have different expressiveness. This means it is not always possible to link all the elements of SQL and KM3. For instance, a KM3 Class does not have a "default value" property; a SQL-DDL Table does not have references.



1. Injection and weaving

The weaving model is used as specification to produce model transformations (in ATL). We implement a higher-order transformation (HOT) based on a generic transformation pattern. This HOT takes the weaving model as input and produces a transformation model as output (Figure 2.a). This output transformation is used to transform a SQL-DDL model into a KM3 model (Figure 2.b).



2. Transforming KM3 model into KM3 file

The last step of the bridging process is the extraction of the KM3 model (with KM3 concepts such as Class, Attribute, Reference) into the textual concrete syntax of KM3 (see Figure 3).



3. Extraction of KM3 model into KM3 file

Download and examples

SQL-DDL to KM3

This example implements a complete chain of operations that enables to bridge between SQL-DDL and KM3 (injection, weavings, transformations and extraction). It uses an SQL file extracted from the Mantis bug tracker tool.

SQL-DDL to KM3 HowTo

This document contains step-by-step instructions explaining how to execute the SQL-DDL to KM3 example.

KM3 to SQL-DDL

This example implements a bridge between KM3 and SQL-DDL, i.e., it is the opposite scenario of the example above. It also provides the complete chain of operations.

KM3 to SQL HowTo

This document contains step-by-step instructions explaining how to execute the KM3 to SQL-DDL example.

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.

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.

Metamodel comparison

This use case demonstrates how weaving models are used to compare different metamodels and to produce executable model transformations (we use two metamodels used to define embedded software in the avionics industry).

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.

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

This work is supported by the OpenEmbeDD project.

Reference

Atzeni, P, Cappellari, P, Bernstein, P A. ModelGen: Model-Independent Schema and Data Translation. EDBT 2006, pp. 368-385