ecore2ecore instances problem [message #392723] |
Mon, 09 May 2005 08:11 |
Eclipse User |
|
|
|
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 #392780 is a reply to message #392729] |
Thu, 12 May 2005 02:08 |
Eclipse User |
|
|
|
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 #392818 is a reply to message #392793] |
Fri, 13 May 2005 08:27 |
Eclipse User |
|
|
|
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 |
Ed Merks 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/
|
|
|
Powered by
FUDForum. Page generated in 0.02886 seconds