Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [QVTr] Is it impossible to create a profileApplication in QVT Relation Language?
[QVTr] Is it impossible to create a profileApplication in QVT Relation Language? [message #677173] Tue, 07 June 2011 19:15 Go to next message
Sabine Mueller is currently offline Sabine MuellerFriend
Messages: 2
Registered: June 2011
Junior Member
Hi,
by using QVT Relation language (QVT R) I would like to apply a profile in a transformation. Therefore I need to create some code in this way:

<xmi:XMI xmi:version="2.1" xmlns:xmi="  //schema.omg.org/spec/XMI/2.1" xmlns:xsi="  //www.w3.org/2001/XMLSchema-instance" xmlns:MyProfile="  ///schemas/MyProfile/_jIh_MEE2EeCEN_hYm6Ct-Q/99" xmlns:ecore="  //www.eclipse.org/emf/2002/Ecore" xmlns:uml="  //www.eclipse.org/uml2/3.0.0/UML" xsi:schemaLocation="  ///schemas/MyProfile/_jIh_MEE2EeCEN_hYm6Ct-Q/99 ../Model/ProfileModels/MyProfile.uml#_jIj0YEE2EeCEN_hYm6Ct-Q">
  <uml:Model xmi:id="_qb8akM37EdqwVrslYOdUDA">
  <!-- ... -->
      <profileApplication xmi:id="_DC760IwsEeCVgu6ZKnAeAA">
        <eAnnotations xmi:id="_DC760YwsEeCVgu6ZKnAeAA" source="h ttp://www.eclipse.org/uml2/2.0.0/UML">
          <references xmi:type="ecore:EPackage" href="../Model/ProfileModels/MyProfile.uml#_jIj0YEE2EeCEN_hYm6Ct-Q"/>
        </eAnnotations>
        <appliedProfile href="../Model/ProfileModels/MyProfile.uml#_XkGiwB07Ed-QQ4mYkrb7Gg"/>
      </profileApplication>
  <!-- ... -->
  </uml:Model>
</xmi:XMI>

To me it seem impossible to create this code by using QVT-R. Here is why:

1. I don't have a chance to add the xsi:schemaLocation attribute to element <xmi:XMI>, i.e. xsi:schemaLocation="[...]/schemas/MyProfile/_jIh_MEE2EeCEN_hYm6Ct-Q/99 ../Model/ProfileModels/MyProfile.uml#_jIj0YEE2EeCEN_hYm6Ct-Q"

2. There is no way to access a href-Property for references (i.e. href="../Model/ProfileModels/MyProfile.uml#_jIj0YEE2EeCEN_hYm6Ct-Q") and appliedProfile (i.e. href="../Model/ProfileModels/MyProfile.uml#_XkGiwB07Ed-QQ4mYkrb7Gg").

Maybe no. 1 is only a problem when using Topcased, so even solving no. 2 would be most helpful. The following QVT relation (for EMF 2.5) results in code that is close to a solution in no. 2, but it still lacks the href. Href is not supported in by UML-Metamodel.

  relation profileApplication
  {
    enforce domain target mdl : uml::Model
    {
      profileApplication = pa : uml::ProfileApplication {
      
        eAnnotations = doc : ecore::EAnnotation {
          source = '  //www.eclipse.org/uml2/2.0.0/UML',
          references = set : ecore::EPackage {
           -- no way to set href-property
          }          
        },
        appliedProfile = prof : uml::Profile {
           -- no way to set href-property
        }
      }
    };
  }

Results in:

   <uml:Model>
    <!-- ... -->
    <profileApplication xmi:id="_vDV3UCMZEeCZ7MQ24lstxw" appliedProfile="_vDWeYCMZEeCZ7MQ24lstxw">
      <eAnnotations xmi:id="_vDV3UiMZEeCZ7MQ24lstxw" source="  //www.eclipse.org/uml2/2.0.0/UML" references="_vDV3VCMZEeCZ7MQ24lstxw"/>
    </profileApplication>
  </uml:Model>
  <ecore:EPackage xmi:id="_vDV3VCMZEeCZ7MQ24lstxw" name="MyProfile"/>
  <uml:Profile xmi:id="_vDWeYCMZEeCZ7MQ24lstxw" name="MyProfile"/>
  <!-- ... -->

Using EMF 2.6 the relation above fails, because for any reason references are now EObjects. But this does not make it easier.

Has anyone an idea or any suggestion how to apply a profile using QVT Relation Language (QVT R)?

(The same is discussed for QVT Operational Language (QVT O) is solved in this post, but can not be applied in QVT R: www.eclipse.org/forums/index.php/mv/msg/32162/104316/#msg_104316)

Thanks a lot,
Sabine
Re: [QVTr] Is it impossible to create a profileApplication in QVT R? -- Where is http gone? [message #677175 is a reply to message #677173] Tue, 07 June 2011 19:18 Go to previous messageGo to next message
Sabine Mueller is currently offline Sabine MuellerFriend
Messages: 2
Registered: June 2011
Junior Member
Hi,

I had to remove all "http" from my message, because I may not post any URLs yet. So please imagine, there would be a http where you find one missing.

Thanks,
Sabine
(no subject) [message #677186 is a reply to message #677175] Tue, 07 June 2011 19:40 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 4150
Registered: July 2009
Senior Member
Hi Sabine

QVTr has no UML support yet.

Since I've had to devote my time to MDT/OCL this year, QVTr has made no
progress in the Indigo release.

However the new modeled pivot support for MDT/OCL should make an OMG
compliant (UML with profiles) QVTr much easier so I hope to make
progress on QVTr for Juno.

I'm afraid that doesn't help you now.

Anyone interested in helping me on QVTr?

Regards

Ed Willink

On 07/06/2011 20:18, Sabine Mueller wrote:
> Hi,
>
> I had to remove all "http" from my message, because I may not post any
> URLs yet. So please imagine, there would be a http where you find one
> missing.
> Thanks,
> Sabine
>
Re: (no subject) [message #753653 is a reply to message #677186] Fri, 28 October 2011 08:19 Go to previous message
Siegfried Nolte is currently offline Siegfried NolteFriend
Messages: 40
Registered: August 2009
Member
Hi Sabine, Ed, folks,

I came to this discussion from the medini forum, where I learned a bit about it from a guy named "Thomas". Generally applying profiles to models within M2M transformations should be possible. I did it for myself with Eclipse QVT-O. My presentation at a last year's GI Workshop ("Informatik2010") covered it in a bit. The presentation and the sample project (GI2010/qvt/OM/MVC.qvto), both in german, are to be fond on my website (http://www.siegfried-nolte.de/GI2010/GI2010.html, see the GI2010.zip). So the Eclipse's UML metamodel representation and the profile operations (applyProfile, applyStereotype) included in there do it.

Pitily the declarative MVC.qvt is missing. I will try to prepare an example with QVT-R as well. Though I learned from Thomas, that he wants to go a step further and create an UML profile dynamically with a M2M transformation. First I thought it to be easy but now I'm convinced, that it isn't.

Yet it must be possible with diving a bit deeper into the metamodel. So we have to continue discussing in a while.

See you,
Siegfried

[Updated on: Fri, 28 October 2011 09:58]

Report message to a moderator

Previous Topic:[ATL] Query a model element using XPATH expression
Next Topic:Transforming to and from nested objects
Goto Forum:
  


Current Time: Sun Nov 23 19:11:30 GMT 2014

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

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