Translating Schemas and Data Between Metamodels

MSR-TR-2007-36 |

ModelGen is an operator that automatically translates a source model expressed in a source metamodel into an equivalent target model expressed in a different metamodel. For example, given an XML schema, ModelGen can automatically generate an equivalent relational schema or Java interface. This paper describes a new algorithm for ModelGen with several novel properties. It automatically determines a series of transformations to generate the target model. It generates forward- and reverse-views that transform instances of the source model into instances of the target and back again. It supports rich mappings of inheritance hierarchies to flat relations. And it supports incremental modification of a source-to-target mapping. We prove its correctness and demonstrate its practicality in an implementation.