Common Warehouse Metamodel in EMF

The Common Warehouse Metamodel (CWM) is a standard by the Object Management Group (OMG). The intention of CWM is to define a standard for metadata in Data Warehouses and Business Intelligence applications. CWM uses the Meta Object Facility (MOF) as the underlying framework. MOF is also used in other standards of the OMG, for example UML.

My intention was to learn about CWM and it is very difficult to learn a data model by studying the specifications on paper. I wanted an interactive editor. But i did not find an open source editor in the net. I found a MOF complient database, the Metadata Repository (MDR) (note 2011: no longer available), but it does not have an editor.

So i decided to transform the CWM/MOF model to EMF and generate an editor from it.

The editor is in an early, but it is already usable for experiments and for learning CWM.

Mapping MOF to EMF Ecore

In [1,2] a mapping between MOF and EMF is described. These articles served as a starting point, but i did not find the E-MORF software described in one of these articles on the net. Therefore i wrote an XSLT transformation that implements the following mapping of MOF elements to EMF elements.

MOF Element EMF Element EMF Tag
XMI.content ecore:EPackage ecore:EPackage
Model:Attribute ecore:EReference or ecore:EAttribute eStructuralFeatures
Model:Class ecore:EClass eClassifiers
Model:DataType ecore:EEnum or ecore:EDataType eClassifiers
Model:Package eSubpackages
Model:Reference ecore:EReference eStructuralFeatures

I transformed the CMW 1.1 XML specification into an Ecore/EMF model.

The following screenshot shows a small extract of the resulting EMF ecore model.

Model of CWM in EMF Ecore

An editor plugin for CWM in EMF

From the ecore model i generated an EMF Editor. The following screenshot shows the "New Wizard". You can see that there is a model for every subpackage of CWM. The "CWM Model" is the best choice most of the time.

New Wizard of CWM in EMF Ecore

The next screen shows the subpackages available and the complexity of CWM. In this example the "relational container is chosen".

New children nodes for the relational package of CWM

The relational package is used for information on objects in relational databases. In the next screenshot the elements available are shown.

Elements in the relational package

The editor is available at github.

There are a number of open issues.