I'm looking for a starting point to research the best way to use Epsilon for refining/updating models (and to verify Epsilon is the right tool in general). I would like to use it to transform between two very similar metamodels. One is Ecore from an XSD file and the 2nd is the Ecore I have manually cleaned up a bit around things like references ( I hope to eventually automate the metamodel transformation as well). Since the changes follow a semi-consistent pattern I want to just describe how they change rather than mapping all the ways they are the same.

For example, in XSL I would use something like this and just add rules for the changes.

For Epsilon, ETL seems the best choice, but I haven't found a concrete example of model refinement. I found the old thread pasted below that talks about using the "CommonEmfMetamodel transformation strategy" with ETL, but I can't find any additional information on it and the examples link in the thread is broken.

As long as we are discussing alternatives, do let me know if there is a better Epsilon choice than ETL. From what I can tell ETL is the right choice because: EWL is for manual changes, EOL might be an option according to the EWL chapter but ETL matching feels closer to what I need, and Flock actually seems interesting but I think its Type-focus might not be right for my use case.

Thanks,
dave

Dimitrios Kolovos wrote on Sun, 29 April 2007 11:57

Hi Laurent,

A transformation strategy can be attached to an ETL transformation (via
the Transformation Strategy tab or the respective API if you are running
from Java) to define how the transformation will handle input elements
for which the user has not specified an explicit transformation rule.

For example, the CommonEmfMetamodel transformation strategy, works very
similarly to the ATL "refine" mode: for each element of the source model
for which no transformation rule has been specified, it creates a copy
of the element in the target model. In case you need your transformation
to do something "slightly" different than the strategy you can also use
the "auto" keyword. You can find a working example of all these in the
OORefinement example available at: http://dev.eclipse.org/viewcvs/indextech.cgi/org.eclipse.gmt /epsilon/examples/OORefinement/OORefinement.zip

ETL also provides an extension point which you can use to implement
custom transformation strategies (if you need more information about
this feature please let me know).

Cheers,
Dimitrios

Laurent Merlet wrote:
> Hi all,
>
> I'am trying to understand what is the aim of "transformations
> strategies"...
> I have already read the transformation strategies section of the online
> doc, but i don't see exactly what it consists of.
> Is it only for using ETL in Java ?
>
> If someone can explain it to me, I would be grateful.
>
> Best regards,
>
> Laurent MERLET

Actually, if it helps here is a very simplified example before metamodel, before model and after metamodel. You will note I am essentially turning semantic key attributes (favoriteSiblingNref, favoriteChildNref) into refs (favoriteSibling, favoriteChild). The attribute transformation pattern is very similar across the entire metmodel, but do note at the model level it does depend on the class and the instance in question. For example favoriteSiblingNref is the name of a sibling of that Child instance (the name is only unique to the Parent document fragment). And favoriteChildNref is the name of one of that Parent's children.

Thanks for the tip and link. I looked at it some more and it does seem like a good candidate. I specifically like how it supports multiple migration rules for the same type. For my specific case everything is so feature-specific I haven't decided if its the best fit or not, but I plan to try it out. It seems I can do a rule at Object with a guard for the features I am looking for. I just haven't decided if writing straight Java (or OML) against the Ecore APIs might be cleaner for my specific case. We will see :)...

As Antonio mentioned Flock might be the right choice for your case. In the broader sense ETL is the transformation language in the Epsilon suite, and strictly speaking a model refinement is a model transformation. In general model transformations are seen as a process in which a set of transformation rules are applied to an input model and as a result you get an output model. However, and ETL in particular supports this, your input and output models can be the same model, i.e., you are not creating a new model but modifying or refining it. Or you can create a new output model, but at the same time modify your input model.

I know this is not a solution per se, but just wanted to let you know that there is much you can do with ETL.

Regards,

Horacio Hoyos Rodriguez
Epsilon Committer
Research Assistant
University Of York