Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » Re: [ATL] Datatype mapping during Ecore to KM3 extraction
Re: [ATL] Datatype mapping during Ecore to KM3 extraction [message #35701] Wed, 02 May 2007 17:05 Go to next message
Frédéric Jouault is currently offline Frédéric JouaultFriend
Messages: 572
Registered: July 2009
Senior Member
Hello,

Please, ask your future ATL-related questions on the
eclipse.modeling.m2m newsgroup. As a matter of fact, ATL has moved from
the GMT to the M2M project.

I added the eclipse.modeling.m2m newsgroup in copy of my answer, so that
you can directly reply to this message.


To answer your question:

You can automatize the process of extracting an Ecore metamodel to a KM3
file using either of these two main options:
- using an ant script (preferred method, see:
http://wiki.eclipse.org/index.php/AM3_Ant_Tasks),
- using Java code calling the KM3Projector class of the KM3 plugin.

To do things that the EMF2KM3.atl (i.e., Ecore-to-KM3) transformation
does not do yet (e.g., primitive types mapping), you can modify the
EMF2KM3.atl file available from:
http://www.eclipse.org/m2m/atl/atlTransformations/#EMF2KM3


Do not hesitate to contribute your modifications using Bugzilla.
Such a contribution to this very same transformation has already been
made (see: https://bugs.eclipse.org/bugs/show_bug.cgi?id=156446).


Regards,

Frédéric Jouault


Quentin Glineur wrote:
> Hi,
>
> I am wondering if it is possible to parametrize the process of
> extraction of an ecore metamodel to KM3 so that to obtain a "regular"
> km3 file ? By "regular", I mean having types mapped (for example from
> EString to String) and a package named "PimitiveTypes" with ocl
> datatypes instead of a package named "ecore" with ecore datatypes.
>
> Best regards,
>
> Quentin
Re: [ATL] Datatype mapping during Ecore to KM3 extraction [message #35735 is a reply to message #35701] Thu, 03 May 2007 07:34 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: quentin.glineur.obeo.fr

Hi,

Thank you very much for your guidance :)

Quentin

Frédéric Jouault a écrit :
> Hello,
>
> Please, ask your future ATL-related questions on the
> eclipse.modeling.m2m newsgroup. As a matter of fact, ATL has moved from
> the GMT to the M2M project.
>
> I added the eclipse.modeling.m2m newsgroup in copy of my answer, so that
> you can directly reply to this message.
>
>
> To answer your question:
>
> You can automatize the process of extracting an Ecore metamodel to a KM3
> file using either of these two main options:
> - using an ant script (preferred method, see:
> http://wiki.eclipse.org/index.php/AM3_Ant_Tasks),
> - using Java code calling the KM3Projector class of the KM3 plugin.
>
> To do things that the EMF2KM3.atl (i.e., Ecore-to-KM3) transformation
> does not do yet (e.g., primitive types mapping), you can modify the
> EMF2KM3.atl file available from:
> http://www.eclipse.org/m2m/atl/atlTransformations/#EMF2KM3
>
>
> Do not hesitate to contribute your modifications using Bugzilla.
> Such a contribution to this very same transformation has already been
> made (see: https://bugs.eclipse.org/bugs/show_bug.cgi?id=156446).
>
>
> Regards,
>
> Frédéric Jouault
>
>
> Quentin Glineur wrote:
>> Hi,
>>
>> I am wondering if it is possible to parametrize the process of
>> extraction of an ecore metamodel to KM3 so that to obtain a "regular"
>> km3 file ? By "regular", I mean having types mapped (for example from
>> EString to String) and a package named "PimitiveTypes" with ocl
>> datatypes instead of a package named "ecore" with ecore datatypes.
>>
>> Best regards,
>>
>> Quentin
Re: [ATL] Datatype mapping during Ecore to KM3 extraction [message #36274 is a reply to message #35701] Mon, 07 May 2007 15:39 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: quentin.glineur.obeo.fr

Hello,

Going further in my work (my transformation seems to works in M2M with
an ATL launch configuration), I have tried the ant task method as
recommended but I have problems in writing the "build.xml".

1)How to adapt the launch configuration given for the EMF2KM3 example
(especially how to properly write the "am3.loadModel" for both metamodel
which are, in my case Ecore and KM3) ?

2)how to manage injectors and extractors through ant tasks ? More
precisely, what are the requirements to get a km3 file as a result ? I
am thinking about a km3 extractor but does it already exists or do I
have to design one? Ad so far, how to make a right reference to it ?
(giving solely one name in the "extractor" tag seems strange to me, so
do I miss something ?).

Best regards,
Quentin.

Frédéric Jouault a écrit :
> Hello,
>
> Please, ask your future ATL-related questions on the
> eclipse.modeling.m2m newsgroup. As a matter of fact, ATL has moved from
> the GMT to the M2M project.
>
> I added the eclipse.modeling.m2m newsgroup in copy of my answer, so that
> you can directly reply to this message.
>
>
> To answer your question:
>
> You can automatize the process of extracting an Ecore metamodel to a KM3
> file using either of these two main options:
> - using an ant script (preferred method, see:
> http://wiki.eclipse.org/index.php/AM3_Ant_Tasks),
> - using Java code calling the KM3Projector class of the KM3 plugin.
>
> To do things that the EMF2KM3.atl (i.e., Ecore-to-KM3) transformation
> does not do yet (e.g., primitive types mapping), you can modify the
> EMF2KM3.atl file available from:
> http://www.eclipse.org/m2m/atl/atlTransformations/#EMF2KM3
>
>
> Do not hesitate to contribute your modifications using Bugzilla.
> Such a contribution to this very same transformation has already been
> made (see: https://bugs.eclipse.org/bugs/show_bug.cgi?id=156446).
>
>
> Regards,
>
> Frédéric Jouault
>
>
> Quentin Glineur wrote:
>> Hi,
>>
>> I am wondering if it is possible to parametrize the process of
>> extraction of an ecore metamodel to KM3 so that to obtain a "regular"
>> km3 file ? By "regular", I mean having types mapped (for example from
>> EString to String) and a package named "PimitiveTypes" with ocl
>> datatypes instead of a package named "ecore" with ecore datatypes.
>>
>> Best regards,
>>
>> Quentin
Re: [ATL] Datatype mapping during Ecore to KM3 extraction [message #36398 is a reply to message #36274] Wed, 09 May 2007 07:32 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eric.vepa.gmail.com

Hi Quentin,

Informations about AM3 ANT tasks are available here:

http://wiki.eclipse.org/index.php/AM3_Ant_Tasks


Quentin Glineur wrote:
> Hello,
>
> Going further in my work (my transformation seems to works in M2M with
> an ATL launch configuration), I have tried the ant task method as
> recommended but I have problems in writing the "build.xml".
>
> 1)How to adapt the launch configuration given for the EMF2KM3 example
> (especially how to properly write the "am3.loadModel" for both metamodel
> which are, in my case Ecore and KM3) ?
>
> 2)how to manage injectors and extractors through ant tasks ? More
> precisely, what are the requirements to get a km3 file as a result ? I
> am thinking about a km3 extractor but does it already exists or do I
> have to design one? Ad so far, how to make a right reference to it ?
> (giving solely one name in the "extractor" tag seems strange to me, so
> do I miss something ?).
>
> Best regards,
> Quentin.
>
> Frédéric Jouault a écrit :
>> Hello,
>>
>> Please, ask your future ATL-related questions on the
>> eclipse.modeling.m2m newsgroup. As a matter of fact, ATL has moved
>> from the GMT to the M2M project.
>>
>> I added the eclipse.modeling.m2m newsgroup in copy of my answer, so
>> that you can directly reply to this message.
>>
>>
>> To answer your question:
>>
>> You can automatize the process of extracting an Ecore metamodel to a
>> KM3 file using either of these two main options:
>> - using an ant script (preferred method, see:
>> http://wiki.eclipse.org/index.php/AM3_Ant_Tasks),
>> - using Java code calling the KM3Projector class of the KM3 plugin.
>>
>> To do things that the EMF2KM3.atl (i.e., Ecore-to-KM3) transformation
>> does not do yet (e.g., primitive types mapping), you can modify the
>> EMF2KM3.atl file available from:
>> http://www.eclipse.org/m2m/atl/atlTransformations/#EMF2KM3
>>
>>
>> Do not hesitate to contribute your modifications using Bugzilla.
>> Such a contribution to this very same transformation has already been
>> made (see: https://bugs.eclipse.org/bugs/show_bug.cgi?id=156446).
>>
>>
>> Regards,
>>
>> Frédéric Jouault
>>
>>
>> Quentin Glineur wrote:
>>> Hi,
>>>
>>> I am wondering if it is possible to parametrize the process of
>>> extraction of an ecore metamodel to KM3 so that to obtain a "regular"
>>> km3 file ? By "regular", I mean having types mapped (for example from
>>> EString to String) and a package named "PimitiveTypes" with ocl
>>> datatypes instead of a package named "ecore" with ecore datatypes.
>>>
>>> Best regards,
>>>
>>> Quentin


--
Éric Vépa
Re: [ATL] Datatype mapping during Ecore to KM3 extraction [message #36529 is a reply to message #36398] Wed, 09 May 2007 13:02 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: quentin.glineur.obeo.fr

Hi Éric,

In fact, my problem is that, despite the help of the examples of the
wiki article, I can't get my ant file working because of problems during
the "loadModel" stage.

Actually everything goes nice while using the a launch configuration
(Run as...) with metamodels set to Ecore (#EMF) and KM3 (by uri) but
things break down when adapting to the ant file process:

- I downloaded KM3.ecore and Ecore.ecore.
- their am3.loadModel seems to be OK since there is no problem reported
in the console.

But when dealing with with the input model, I get errors that seems to
be due to its syntax (problems with double slashes that make prune one
character). So I made a try by removing double slashes : no improvement.
The input model is one made by EMF means (pure Ecore).

Is there a trick with model handler in the launch configuration that
should be done in the ant file?

Thanks a lot

Quentin

Éric Vépa a écrit :
> Hi Quentin,
>
> Informations about AM3 ANT tasks are available here:
>
> http://wiki.eclipse.org/index.php/AM3_Ant_Tasks
>
>
> Quentin Glineur wrote:
>> Hello,
>>
>> Going further in my work (my transformation seems to works in M2M with
>> an ATL launch configuration), I have tried the ant task method as
>> recommended but I have problems in writing the "build.xml".
>>
>> 1)How to adapt the launch configuration given for the EMF2KM3 example
>> (especially how to properly write the "am3.loadModel" for both
>> metamodel which are, in my case Ecore and KM3) ?
>>
>> 2)how to manage injectors and extractors through ant tasks ? More
>> precisely, what are the requirements to get a km3 file as a result ? I
>> am thinking about a km3 extractor but does it already exists or do I
>> have to design one? Ad so far, how to make a right reference to it ?
>> (giving solely one name in the "extractor" tag seems strange to me, so
>> do I miss something ?).
>>
>> Best regards,
>> Quentin.
>>
>> Frédéric Jouault a écrit :
>>> Hello,
>>>
>>> Please, ask your future ATL-related questions on the
>>> eclipse.modeling.m2m newsgroup. As a matter of fact, ATL has moved
>>> from the GMT to the M2M project.
>>>
>>> I added the eclipse.modeling.m2m newsgroup in copy of my answer, so
>>> that you can directly reply to this message.
>>>
>>>
>>> To answer your question:
>>>
>>> You can automatize the process of extracting an Ecore metamodel to a
>>> KM3 file using either of these two main options:
>>> - using an ant script (preferred method, see:
>>> http://wiki.eclipse.org/index.php/AM3_Ant_Tasks),
>>> - using Java code calling the KM3Projector class of the KM3 plugin.
>>>
>>> To do things that the EMF2KM3.atl (i.e., Ecore-to-KM3) transformation
>>> does not do yet (e.g., primitive types mapping), you can modify the
>>> EMF2KM3.atl file available from:
>>> http://www.eclipse.org/m2m/atl/atlTransformations/#EMF2KM3
>>>
>>>
>>> Do not hesitate to contribute your modifications using Bugzilla.
>>> Such a contribution to this very same transformation has already been
>>> made (see: https://bugs.eclipse.org/bugs/show_bug.cgi?id=156446).
>>>
>>>
>>> Regards,
>>>
>>> Frédéric Jouault
>>>
>>>
>>> Quentin Glineur wrote:
>>>> Hi,
>>>>
>>>> I am wondering if it is possible to parametrize the process of
>>>> extraction of an ecore metamodel to KM3 so that to obtain a
>>>> "regular" km3 file ? By "regular", I mean having types mapped (for
>>>> example from EString to String) and a package named "PimitiveTypes"
>>>> with ocl datatypes instead of a package named "ecore" with ecore
>>>> datatypes.
>>>>
>>>> Best regards,
>>>>
>>>> Quentin
>
>
Re: [ATL] Datatype mapping during Ecore to KM3 extraction [message #36595 is a reply to message #36529] Wed, 09 May 2007 14:03 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eric.vepa.gmail.com

This is a multi-part message in MIME format.
--------------000600050203080109090002
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit

I join as attachments a build.xml and his configuration file which works
directly for the project taken from the Zoo
(http://www.eclipse.org/m2m/atl/atlTransformations/#EMF2KM3).
Just copy these files after importing the project (EMF2KM3 from the Zoo)
into your workspace.
You can delete or save the Sample-KM3.ecore before launching the ANT
script to ensure the generation is really performed :-).

Quentin Glineur wrote:
> Hi
Re: [ATL] Datatype mapping during Ecore to KM3 extraction [message #36664 is a reply to message #36595] Wed, 09 May 2007 16:45 Go to previous message
Eclipse UserFriend
Originally posted by: quentin.glineur.obeo.fr

OK, thanks to your example file, I managed to make it work. I was
missing the knowledge about the nsUri attribute which completely solved
my problem.

This option confers a relevant declaration. ;-)

Thanks a lot...

Quentin

Éric Vépa a écrit :
> I join as attachments a build.xml and his configuration file which works
> directly for the project taken from the Zoo
> (http://www.eclipse.org/m2m/atl/atlTransformations/#EMF2KM3).
> Just copy these files after importing the project (EMF2KM3 from the Zoo)
> into your workspace.
> You can delete or save the Sample-KM3.ecore before launching the ANT
> script to ensure the generation is really performed :-).
>
> Quentin Glineur wrote:
>> Hi Éric,
>>
>> In fact, my problem is that, despite the help of the examples of the
>> wiki article, I can't get my ant file working because of problems
>> during the "loadModel" stage.
>>
>> Actually everything goes nice while using the a launch configuration
>> (Run as...) with metamodels set to Ecore (#EMF) and KM3 (by uri) but
>> things break down when adapting to the ant file process:
>>
>> - I downloaded KM3.ecore and Ecore.ecore.
>> - their am3.loadModel seems to be OK since there is no problem
>> reported in the console.
>>
>> But when dealing with with the input model, I get errors that seems to
>> be due to its syntax (problems with double slashes that make prune one
>> character). So I made a try by removing double slashes : no improvement.
>> The input model is one made by EMF means (pure Ecore).
>>
>> Is there a trick with model handler in the launch configuration that
>> should be done in the ant file?
>>
>> Thanks a lot
>>
>> Quentin
>>
>> Éric Vépa a écrit :
>>> Hi Quentin,
>>>
>>> Informations about AM3 ANT tasks are available here:
>>>
>>> http://wiki.eclipse.org/index.php/AM3_Ant_Tasks
>>>
>>>
>>> Quentin Glineur wrote:
>>>> Hello,
>>>>
>>>> Going further in my work (my transformation seems to works in M2M
>>>> with an ATL launch configuration), I have tried the ant task method
>>>> as recommended but I have problems in writing the "build.xml".
>>>>
>>>> 1)How to adapt the launch configuration given for the EMF2KM3
>>>> example (especially how to properly write the "am3.loadModel" for
>>>> both metamodel which are, in my case Ecore and KM3) ?
>>>>
>>>> 2)how to manage injectors and extractors through ant tasks ? More
>>>> precisely, what are the requirements to get a km3 file as a result ?
>>>> I am thinking about a km3 extractor but does it already exists or do
>>>> I have to design one? Ad so far, how to make a right reference to it
>>>> ? (giving solely one name in the "extractor" tag seems strange to
>>>> me, so do I miss something ?).
>>>>
>>>> Best regards,
>>>> Quentin.
>>>>
>>>> Frédéric Jouault a écrit :
>>>>> Hello,
>>>>>
>>>>> Please, ask your future ATL-related questions on the
>>>>> eclipse.modeling.m2m newsgroup. As a matter of fact, ATL has moved
>>>>> from the GMT to the M2M project.
>>>>>
>>>>> I added the eclipse.modeling.m2m newsgroup in copy of my answer, so
>>>>> that you can directly reply to this message.
>>>>>
>>>>>
>>>>> To answer your question:
>>>>>
>>>>> You can automatize the process of extracting an Ecore metamodel to
>>>>> a KM3 file using either of these two main options:
>>>>> - using an ant script (preferred method, see:
>>>>> http://wiki.eclipse.org/index.php/AM3_Ant_Tasks),
>>>>> - using Java code calling the KM3Projector class of the KM3 plugin.
>>>>>
>>>>> To do things that the EMF2KM3.atl (i.e., Ecore-to-KM3)
>>>>> transformation does not do yet (e.g., primitive types mapping), you
>>>>> can modify the EMF2KM3.atl file available from:
>>>>> http://www.eclipse.org/m2m/atl/atlTransformations/#EMF2KM3
>>>>>
>>>>>
>>>>> Do not hesitate to contribute your modifications using Bugzilla.
>>>>> Such a contribution to this very same transformation has already
>>>>> been made (see: https://bugs.eclipse.org/bugs/show_bug.cgi?id=156446).
>>>>>
>>>>>
>>>>> Regards,
>>>>>
>>>>> Frédéric Jouault
>>>>>
>>>>>
>>>>> Quentin Glineur wrote:
>>>>>> Hi,
>>>>>>
>>>>>> I am wondering if it is possible to parametrize the process of
>>>>>> extraction of an ecore metamodel to KM3 so that to obtain a
>>>>>> "regular" km3 file ? By "regular", I mean having types mapped (for
>>>>>> example from EString to String) and a package named
>>>>>> "PimitiveTypes" with ocl datatypes instead of a package named
>>>>>> "ecore" with ecore datatypes.
>>>>>>
>>>>>> Best regards,
>>>>>>
>>>>>> Quentin
>>>
>>>
>
>
>
> ------------------------------------------------------------ ------------
>
> <project name="EMF2KM3" default="transfo">
> <property name="projectPath" value="/EMF2KM3/" />
> <property name="sourceMetamodel" value="EMF" />
> <property name="targetMetamodel" value="KM3" />
> <property name="inputModelsPath" value="${projectPath}" />
> <property name="outputModelsPath" value="${projectPath}" />
> <property name="transfosPath" value="${projectPath}" />
>
> <target name="transfo" depends="loadModels">
> <basename property="name" file="Sample" suffix=".ecore" />
> <property name="sourceModel" value="${name}.ecore" />
> <property name="targetModel" value="${name}-${targetMetamodel}.ecore" />
>
> <echo message="Transforming ${name} from ${sourceMetamodel} metamodel to ${targetMetamodel} metamodel" />
> <am3.loadModel name="${sourceModel}" metamodel="%EMF" path="${inputModelsPath}${sourceModel}" />
> <am3.atl path="${transfosPath}${sourceMetamodel}2${targetMetamodel}.atl ">
> <inModel name="MOF" model="%EMF" />
> <inModel name="IN" model="${sourceModel}" />
> <inModel name="${targetMetamodel}" model="${targetMetamodel}" />
> <outModel name="OUT" model="${targetModel}" metamodel="${targetMetamodel}" />
> </am3.atl>
> <am3.saveModel model="${targetModel}" path="${outputModelsPath}${targetModel}" />
> </target>
>
> <target name="loadModels">
> <am3.loadModel name="${targetMetamodel}" metamodel="MOF" nsUri="http://www.eclipse.org/gmt/2005/KM3" />
> </target>
> </project>
>
>
> ------------------------------------------------------------ ------------
>
> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
> <launchConfiguration type="org.eclipse.ant.AntLaunchConfigurationType">
> <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
> <listEntry value="/EMF2KM3/build.xml"/>
> </listAttribute>
> <stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="EMF2KM3"/>
> <intAttribute key="org.eclipse.ui.externaltoolsATTR_SORT_TARGETS" value="1"/>
> <stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
> <stringAttribute key="process_factory_id" value="org.eclipse.ant.ui.remoteAntProcessFactory"/>
> <stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${workspace}"/>
> <booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
> <booleanAttribute key="org.eclipse.ant.ui.DEFAULT_VM_INSTALL" value="false"/>
> <stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/EMF2KM3/build.xml}"/>
> <stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
> <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
> <listEntry value="1"/>
> </listAttribute>
> </launchConfiguration>
Previous Topic:MOF2UML inheritance
Next Topic:ATL bundle
Goto Forum:
  


Current Time: Fri Apr 19 18:05:24 GMT 2024

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

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

Back to the top