Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » ecore2ecore instances problem
ecore2ecore instances problem [message #392723] Mon, 09 May 2005 08:11 Go to next message
Eclipse UserFriend
Originally posted by: dorothyww.hotmail.com

Hi, all,

I have established mappings between 2 ecore models. But I do not know how
to use it to migrate data from old ecore model to new ecore model. That
is, now I have the following items:

1. an .ecore2ecore file, containing the mapping details between ecore
model A->ecore model B
2. instances of ecore model A

I want to: get corresponding instances of ecore model B

Do I have to write a parser(java API) to map input details to output
details manually, or is there something I can refer to so that instances
of ecore model A will be automatically mapped to instances of ecore model
B? If yes, how to?

Thanks!
Re: ecore2ecore instances problem [message #392729 is a reply to message #392723] Mon, 09 May 2005 11:18 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Hi,

The only built-in thing we are providing is that you can right click on
the .ecore2ecore file and invoke "Generate Ecore2XML" which can be used
to parse an instance of A directly into an instance of B. Kenn still
needs to document this stuff.

You may find other work such as Merlin or the model transformation work
useful to look at; links for them are at EMF Corner.


cww wrote:

> Hi, all,
>
> I have established mappings between 2 ecore models. But I do not know
> how to use it to migrate data from old ecore model to new ecore model.
> That is, now I have the following items:
>
> 1. an .ecore2ecore file, containing the mapping details between ecore
> model A->ecore model B
> 2. instances of ecore model A
>
> I want to: get corresponding instances of ecore model B
>
> Do I have to write a parser(java API) to map input details to output
> details manually, or is there something I can refer to so that
> instances of ecore model A will be automatically mapped to instances
> of ecore model B? If yes, how to?
>
> Thanks!
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: ecore2ecore instances problem [message #392780 is a reply to message #392729] Thu, 12 May 2005 02:08 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dorothyww.hotmail.com

Hi,
Can you tell me something on how to parse an instance of A directly into
an instance of B? As my project is urgent and I can not wait for several
months for Kenn's document...

Or can you tell me whether there's some classes in Ecore2XML that can be
used to parse an instance, similar to MappingEngineFactory or
IMappingSession in MTF?

Thank you very much!
Re: ecore2ecore instances problem [message #392782 is a reply to message #392729] Thu, 12 May 2005 07:17 Go to previous messageGo to next message
Philipp Seuring is currently offline Philipp SeuringFriend
Messages: 32
Registered: July 2009
Member
Hi Ed,

I can not find the the built in "Generate Ecore2XML" menue option. I tried
out in Package Explorer and the Navigator and looked in all the Ecore to
Ecore related menues.

Can you give me a hint?

Regards Philipp

"Ed Merks" <merks@ca.ibm.com> schrieb im Newsbeitrag
news:d5nhat$lr6$1@news.eclipse.org...
> Hi,
>
> The only built-in thing we are providing is that you can right click on
> the .ecore2ecore file and invoke "Generate Ecore2XML" which can be used to
> parse an instance of A directly into an instance of B. Kenn still needs
> to document this stuff.
> You may find other work such as Merlin or the model transformation work
> useful to look at; links for them are at EMF Corner.
>
>
> cww wrote:
>
>> Hi, all,
>>
>> I have established mappings between 2 ecore models. But I do not know how
>> to use it to migrate data from old ecore model to new ecore model. That
>> is, now I have the following items:
>>
>> 1. an .ecore2ecore file, containing the mapping details between ecore
>> model A->ecore model B
>> 2. instances of ecore model A
>>
>> I want to: get corresponding instances of ecore model B
>>
>> Do I have to write a parser(java API) to map input details to output
>> details manually, or is there something I can refer to so that instances
>> of ecore model A will be automatically mapped to instances of ecore model
>> B? If yes, how to?
>>
>> Thanks!
>>
Re: ecore2ecore instances problem [message #392783 is a reply to message #392782] Thu, 12 May 2005 07:54 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dorothyww.hotmail.com

I found ecore2xml plugin: org.eclipse.emf.mapping.ecore2xml in emf's 2.1.0
version

you may also check it:-)
Re: ecore2ecore instances problem [message #392784 is a reply to message #392783] Thu, 12 May 2005 09:14 Go to previous messageGo to next message
Philipp Seuring is currently offline Philipp SeuringFriend
Messages: 32
Registered: July 2009
Member
Thank you,

needed to update my eclipse versions. Now I don't now how to invoke the
mapping of the instace files (what I understood is your problem too). If you
find any possiblity please let my know.

Philipp

"cww" <dorothyww@hotmail.com> schrieb im Newsbeitrag
news:46fa545fdac8c26a6c0baa92c6f3183b$1@www.eclipse.org...
>I found ecore2xml plugin: org.eclipse.emf.mapping.ecore2xml in emf's 2.1.0
>version
>
> you may also check it:-)
>
Re: ecore2ecore instances problem [message #392787 is a reply to message #392784] Thu, 12 May 2005 10:22 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------000401030405040001050305
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Guys,

I haven't used this yet either, so rather than perhaps explain
incorrectly, I'll wait for Kenn to help out...


Philipp Seuring wrote:

>Thank you,
>
>needed to update my eclipse versions. Now I don't now how to invoke the
>mapping of the instace files (what I understood is your problem too). If you
>find any possiblity please let my know.
>
>Philipp
>
>"cww" <dorothyww@hotmail.com> schrieb im Newsbeitrag
>news:46fa545fdac8c26a6c0baa92c6f3183b$1@www.eclipse.org...
>
>
>>I found ecore2xml plugin: org.eclipse.emf.mapping.ecore2xml in emf's 2.1.0
>>version
>>
>>you may also check it:-)
>>
>>
>>
>
>
>
>


--------------000401030405040001050305
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Guys,<br>
<br>
I haven't used this yet either, so rather than perhaps explain
incorrectly, I'll wait for Kenn to help out...<br>
<br>
<br>
Philipp Seuring wrote:
<blockquote cite="midd5v79u$j5g$1@news.eclipse.org" type="cite">
<pre wrap="">Thank you,

needed to update my eclipse versions. Now I don't now how to invoke the
mapping of the instace files (what I understood is your problem too). If you
find any possiblity please let my know.

Philipp

"cww" <a class="moz-txt-link-rfc2396E" href="mailto:dorothyww@hotmail.com">&lt;dorothyww@hotmail.com&gt;</a> schrieb im Newsbeitrag
<a class="moz-txt-link-freetext" href="news:46fa545fdac8c26a6c0baa92c6f3183b$1@www.eclipse.org">news:46fa545fdac8c26a6c0baa92c6f3183b$1@www.eclipse.org</a>...
</pre>
<blockquote type="cite">
<pre wrap="">I found ecore2xml plugin: org.eclipse.emf.mapping.ecore2xml in emf's 2.1.0
version

you may also check it:-)

</pre>
</blockquote>
<pre wrap=""><!---->

</pre>
</blockquote>
<br>
</body>
</html>

--------------000401030405040001050305--


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: ecore2ecore instances problem [message #392793 is a reply to message #392784] Thu, 12 May 2005 13:47 Go to previous messageGo to next message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1620
Registered: July 2009
Senior Member
Note that Ecore2XML is not meant to be used as a generic transformation
mechanism, but rather as a way to migrate data between two similar Ecore
models (e.g. two different versions of the same Ecore model). The basic idea
is that you can capture the mapping between the XML representation of one
model (version) and the Ecore representation of another model (version).
Ecore2XMLExtendedMetaData can be used to automatically map XML elements and
attributes to the classes and features of target Ecore representations based
on Ecore2XML mappings. Once your resource has been loaded, you can then make
use of a resource handler (post-processor) to take care of any additional
tranformations (migrations) that couldn't be described using the Ecore2XML
mapping.

For more information, the best I can do for now is point you to an example.
Take a look at the org.eclipse.uml2.examples.emof2ecore example (available
in CVS or as part of the UML2 examples feature), which demonstrates how a
simple transformation could be done between EMOF and Ecore...

Kenn

"Philipp Seuring" <philipp.seuring@lirmm.fr> wrote in message
news:d5v79u$j5g$1@news.eclipse.org...
> Thank you,
>
> needed to update my eclipse versions. Now I don't now how to invoke the
> mapping of the instace files (what I understood is your problem too). If
you
> find any possiblity please let my know.
>
> Philipp
>
> "cww" <dorothyww@hotmail.com> schrieb im Newsbeitrag
> news:46fa545fdac8c26a6c0baa92c6f3183b$1@www.eclipse.org...
> >I found ecore2xml plugin: org.eclipse.emf.mapping.ecore2xml in emf's
2.1.0
> >version
> >
> > you may also check it:-)
> >
>
>
Re: ecore2ecore instances problem [message #392818 is a reply to message #392793] Fri, 13 May 2005 08:27 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dorothyww.hotmail.com

Hi, Kenn,

I have taken a glance at the emof2ecore example, and have some problems,
needing helps...

I want to run this example, so I wrote a simple program to test it:
( I want to trace usage of Ecore2XMLExtendedMetaData)
//////////////////////////////////////////////////////////// ///
public static void main(String[] args){
EMOF2EcoreResourceFactoryImpl factory = new
EMOF2EcoreResourceFactoryImpl();
Resource resource = factory.createResource(URI.createFileURI(new
File("????????????????????").getAbsolutePath()));

}
//////////////////////////////////////////////////////////// ///

My problem is:
1. can you give me a sample input file to replace the "?????????????????"
in the above code? (I have no knowledge of EMOF, so it's too difficult for
me now to edit a sample file:-( )

2. still unclear about usage of Ecore2XMLExtendedMetaData, is there any
document except javadoc?


Thank you !!

cww


Kenn Hussey wrote:

> Note that Ecore2XML is not meant to be used as a generic transformation
> mechanism, but rather as a way to migrate data between two similar Ecore
> models (e.g. two different versions of the same Ecore model). The basic idea
> is that you can capture the mapping between the XML representation of one
> model (version) and the Ecore representation of another model (version).
> Ecore2XMLExtendedMetaData can be used to automatically map XML elements and
> attributes to the classes and features of target Ecore representations based
> on Ecore2XML mappings. Once your resource has been loaded, you can then make
> use of a resource handler (post-processor) to take care of any additional
> tranformations (migrations) that couldn't be described using the Ecore2XML
> mapping.

> For more information, the best I can do for now is point you to an example.
> Take a look at the org.eclipse.uml2.examples.emof2ecore example (available
> in CVS or as part of the UML2 examples feature), which demonstrates how a
> simple transformation could be done between EMOF and Ecore...

> Kenn

> "Philipp Seuring" <philipp.seuring@lirmm.fr> wrote in message
> news:d5v79u$j5g$1@news.eclipse.org...
>> Thank you,
>>
>> needed to update my eclipse versions. Now I don't now how to invoke the
>> mapping of the instace files (what I understood is your problem too). If
> you
>> find any possiblity please let my know.
>>
>> Philipp
>>
>> "cww" <dorothyww@hotmail.com> schrieb im Newsbeitrag
>> news:46fa545fdac8c26a6c0baa92c6f3183b$1@www.eclipse.org...
>> >I found ecore2xml plugin: org.eclipse.emf.mapping.ecore2xml in emf's
> 2.1.0
>> >version
>> >
>> > you may also check it:-)
>> >
>>
>>
Re: ecore2ecore instances problem [message #392822 is a reply to message #392818] Fri, 13 May 2005 09:50 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Philipp,

If your resource will have cross file references, you must load it into
a resource set so that the referenced resources can be demand loaded.
When running from main, you need to make sure you've looked at the FAQ
about running standalone since plugin.xml registrations won't happen
when running standalone. Folks often ask multiple times about
documentation; if we have it, you'll find it on the Documentation page
of the web site, and if its not there, it doesn't exist. You can
produce EMOF (.emof) file by editing a .ecore file and doing "Save as"
whatever.emof; this will serialize the Ecore as EMOF.


cww wrote:

> Hi, Kenn,
>
> I have taken a glance at the emof2ecore example, and have some
> problems, needing helps...
>
> I want to run this example, so I wrote a simple program to test it:
> ( I want to trace usage of Ecore2XMLExtendedMetaData)
> //////////////////////////////////////////////////////////// ///
> public static void main(String[] args){
> EMOF2EcoreResourceFactoryImpl factory = new
> EMOF2EcoreResourceFactoryImpl();
> Resource resource =
> factory.createResource(URI.createFileURI(new
> File("????????????????????").getAbsolutePath()));
>
> }
> //////////////////////////////////////////////////////////// ///
>
> My problem is:
> 1. can you give me a sample input file to replace the
> "?????????????????" in the above code? (I have no knowledge of EMOF,
> so it's too difficult for me now to edit a sample file:-( )
>
> 2. still unclear about usage of Ecore2XMLExtendedMetaData, is there
> any document except javadoc?
>
> Thank you !!
>
> cww
>
>
> Kenn Hussey wrote:
>
>> Note that Ecore2XML is not meant to be used as a generic transformation
>> mechanism, but rather as a way to migrate data between two similar Ecore
>> models (e.g. two different versions of the same Ecore model). The
>> basic idea
>> is that you can capture the mapping between the XML representation of
>> one
>> model (version) and the Ecore representation of another model (version).
>> Ecore2XMLExtendedMetaData can be used to automatically map XML
>> elements and
>> attributes to the classes and features of target Ecore
>> representations based
>> on Ecore2XML mappings. Once your resource has been loaded, you can
>> then make
>> use of a resource handler (post-processor) to take care of any
>> additional
>> tranformations (migrations) that couldn't be described using the
>> Ecore2XML
>> mapping.
>
>
>> For more information, the best I can do for now is point you to an
>> example.
>> Take a look at the org.eclipse.uml2.examples.emof2ecore example
>> (available
>> in CVS or as part of the UML2 examples feature), which demonstrates
>> how a
>> simple transformation could be done between EMOF and Ecore...
>
>
>> Kenn
>
>
>> "Philipp Seuring" <philipp.seuring@lirmm.fr> wrote in message
>> news:d5v79u$j5g$1@news.eclipse.org...
>>
>>> Thank you,
>>>
>>> needed to update my eclipse versions. Now I don't now how to invoke the
>>> mapping of the instace files (what I understood is your problem
>>> too). If
>>
>> you
>>
>>> find any possiblity please let my know.
>>>
>>> Philipp
>>>
>>> "cww" <dorothyww@hotmail.com> schrieb im Newsbeitrag
>>> news:46fa545fdac8c26a6c0baa92c6f3183b$1@www.eclipse.org...
>>> >I found ecore2xml plugin: org.eclipse.emf.mapping.ecore2xml in emf's
>>
>> 2.1.0
>>
>>> >version
>>> >
>>> > you may also check it:-)
>>> >
>>>
>>>
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:How I can enable "Open as EMF XMI"?
Next Topic:GenModel markImportLocation
Goto Forum:
  


Current Time: Tue Apr 23 12:21:14 GMT 2024

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

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

Back to the top