Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Model-to-Model Transformation » "Many-Model to Model" transformation with qvto?
"Many-Model to Model" transformation with qvto? [message #1011932] Wed, 20 February 2013 14:33 Go to next message
Miriam Hundemer is currently offline Miriam Hundemer
Messages: 12
Registered: February 2013
Junior Member
Hi all,

I am still new to qvto but my newest project already provides my with kind of a special issue which I could not find an answer for up to now:

In my project I want to transform several input models (xml files), that are all based on the same meta-model, to one single output model (uml).
Is there a way to do such a "many-model to model" transformation in qvto or is only one input model possible at a time?

If this does not work, another approach could be to use a programm/script to do the model-to-model transformations seperately and then join them afterwards.
Regarding this second approach my question is: Is it possible to execute qvto commands in java code?

Thanks a lot,

Miriam
Re: "Many-Model to Model" transformation with qvto? [message #1011975 is a reply to message #1011932] Wed, 20 February 2013 16:05 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4099
Registered: July 2009
Senior Member
Hi

Yes many to One should be possible.

The secret is the "@" operator to specify your input extent; See p76 of
the QVT spec.

Regards

Ed Willink

On 20/02/2013 15:56, Miriam Hundemer wrote:
> Hi all,
>
> I am still new to qvto but my newest project already provides my with
> kind of a special issue which I could not find an answer for up to now:
>
> In my project I want to transform several input models (xml files),
> that are all based on the same meta-model, to one single output model
> (uml).
> Is there a way to do such a "many-model to model" transformation in
> qvto or is only one input model possible at a time?
>
> If this does not work, another approach could be to use a
> programm/script to do the model-to-model transformations seperately
> and then join them afterwards.
> Regarding this second approach my question is: Is it possible to
> execute qvto commands in java code?
>
> Thanks a lot,
>
> Miriam
Re: "Many-Model to Model" transformation with qvto? [message #1012932 is a reply to message #1011975] Fri, 22 February 2013 13:33 Go to previous messageGo to next message
Miriam Hundemer is currently offline Miriam Hundemer
Messages: 12
Registered: February 2013
Junior Member
Hi Ed

you're not talking about chapter 8.1.18 "Advanced Features: dynamic definition and parallelism" when you say p76, are you? Because I could not find any "@" operator there... Sad
Could you be a little more specific and maybe tell me which chapter of the QVT spec you mean?

But tanks a lot for your quick answer!!!

Regards

Miriam
Re: "Many-Model to Model" transformation with qvto? [message #1012957 is a reply to message #1012932] Fri, 22 February 2013 14:13 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4099
Registered: July 2009
Senior Member
Hi

p76 of "Meta Object Facility (MOF) 2.0 Query/View/Transformation
Specification Version 1.1 Final Adopted Specification ptc/09-12-05" is
8.2.1.16 MappingParameter

NB Page numbers are those shown on the page, not those shown in a tool.

NB. There really aren't very many '@' characters to search for. I found
p76 for you by starting at the top.

Regards

Ed Willink


On 22/02/2013 13:33, Miriam Hundemer wrote:
> Hi Ed
>
> you're not talking about chapter 8.1.18 "Advanced Features: dynamic
> definition and parallelism" when you say p76, are you? Because I could
> not find any "@" operator there... :( Could you be a little more
> specific and maybe tell me which chapter of the QVT spec you mean?
>
> But tanks a lot for your quick answer!!!
>
> Regards
>
> Miriam
Re: "Many-Model to Model" transformation with qvto? [message #1012978 is a reply to message #1012957] Fri, 22 February 2013 15:01 Go to previous messageGo to next message
Fabio L. S. is currently offline Fabio L. S.
Messages: 15
Registered: July 2010
Location: Brazil
Junior Member
Hi Ed;

There is a newer specification also numbered as 1.1 as the "ptc/09-12-05". It is from 2011 and it is available at the OMG website (http://www.omg.org/spec/QVT/) and its code is "formal/2011-01-01".

In this version, the MappingParameter is on page 94.

And yes, it is very strange and confusing!

Regards;


Fabio Levy Siqueira
Re: "Many-Model to Model" transformation with qvto? [message #1013001 is a reply to message #1012978] Fri, 22 February 2013 15:40 Go to previous messageGo to next message
Miriam Hundemer is currently offline Miriam Hundemer
Messages: 12
Registered: February 2013
Junior Member
Ok,

now I've found the chapter you ment Ed, but as I use the specification Fabio mentioned above, it is indeed on page 94, sorry for the confusion.

But if I'm interpreting this right, the "@" is not exactly what I need. As I understand , the "@" is only used for the parameters of a mapping in order to specify the precise in or out model they "belong to". But the in and out models still have to be defined in the transformation declaration above and are fixed afterwards.

transformation T(in src:S, out dest1:D, out dest2:D);
mapping X::foo(inout Y@dest1) : Y@dest2;
// 'X' is a class of 'S' metamodel and 'Y' is a class of 'D' metamodel


Here, the inmodels src and the outmodels dest1 and dest2 are defined in the transformation declaration and used later as parameter type in the mapping operation.

Perhaps I didn't explain my problem properly:

What I would need in my project (I think) is kind of beeing able to have a list (of variable length) of in models in the transformation declaration because from one execution of the transformation to the next, it is possible that the number of in models (xml files) changes.
Is there something like the second example?

//transformation with more than one but fixed number of inmodels
transformation T1 (in inModel1:Metamodel, inModel2:Metamodel, out outModel:UML);

//transformation with variable number of inmodels
transformation T (<list_of_inModels>, out outModel:UML);


All of the inmodels will be of the same metamodel.
Re: &amp;amp;quot;Many-Model to Model&amp;amp;quot; transformation with qvto? [message #1013002 is a reply to message #1012978] Fri, 22 February 2013 15:36 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4099
Registered: July 2009
Senior Member
Hi

Sorry for the confusion. I should have known better.

The 1.1-Beta was the prevailing spec for so long, that I gave up looking
for the non-Beta.

Regards

Ed Willink


On 22/02/2013 15:01, Fabio L. S. wrote:
> Hi Ed;
>
> There is a newer specification also numbered as 1.1 as the
> "ptc/09-12-05". It is from 2011 and it is available at the OMG website
> (http://www.omg.org/spec/QVT/) and its code is "formal/2011-01-01".
>
> In this version, the MappingParameter is on page 94.
>
> And yes, it is very strange and confusing!
>
> Regards;
Re: &amp;amp;quot;Many-Model to Model&amp;amp;quot; transformation with qvto? [message #1013029 is a reply to message #1013001] Fri, 22 February 2013 16:17 Go to previous message
Ed Willink is currently offline Ed Willink
Messages: 4099
Registered: July 2009
Senior Member
Hi

If it's a variable number of models, I suggest creating a super-model
that references all the others.

Regards

Ed Willink

On 22/02/2013 15:40, Miriam Hundemer wrote:
> Ok,
>
> now I've found the chapter you ment Ed, but as I use the specification
> Fabio mentioned above, it is indeed on page 94, sorry for the confusion.
>
> But if I'm interpreting this right, the "@" is not exactly what I
> need. As I understand , the "@" is only used for the parameters of a
> mapping in order to specify the precise in or out model they "belong
> to". But the in and out models still have to be defined in the
> transformation declaration above and are fixed afterwards.
>
> transformation T(in src:S, out dest1:D, out dest2:D);
> mapping X::foo(inout Y@dest1) : Y@dest2;
> // 'X' is a class of 'S' metamodel and 'Y' is a class of 'D' metamodel
>
> Here, the inmodels src and the outmodels dest1 and dest2 are defined
> in the transformation declaration and used later as parameter type in
> the mapping operation.
>
> Perhaps I didn't explain my problem properly:
>
> What I would need in my project (I think) is kind of beeing able to
> have a list (of variable length) of in models in the transformation
> declaration because from one execution of the transformation to the
> next, it is possible that the number of in models (xml files) changes.
> Is there something like the second example?
>
> //transformation with more than one but fixed number of inmodels
> transformation T1 (in inModel1:Metamodel, inModel2:Metamodel, out
> outModel:UML);
>
> //transformation with variable number of inmodels
> transformation T (<list_of_inModels>, out outModel:UML);
>
> All of the inmodels will be of the same metamodel.
Previous Topic:Large Model, minor changes
Next Topic:[QVT] Calling QVT transformation from within java class
Goto Forum:
  


Current Time: Sun Oct 26 07:06:48 GMT 2014

Powered by FUDForum. Page generated in 0.01823 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software