Skip to main content



      Home
Home » Modeling » EMF » Cross referencing model
Cross referencing model [message #1015013] Wed, 27 February 2013 03:13 Go to next message
Eclipse UserFriend
Hi,
I've two Ecore models: A.ecore and B.ecore
A.ecore references some elements in B.ecore

When I open A.ecore it automatically loads B.ecore as well, that's fine:
platform:/resource/org.eatop.eel.eastadl2110/model/A.ecore
platform:/resource/org.eatop.eel.eastadl2110/model/B.ecore


Okay, now I copy those two ecore files into another location (new-folder) of my workspace and try to open them again:

platform:/resource/new-folder/A.ecore
platform:/resource/org.eatop.eel.eastadl2110/model/B.ecore


The path of B.ecore didn't get updated?!, Hence A.ecore can't load the model elements in B.ecore.

Any ideas how to solve this?
Re: Cross referencing model [message #1015020 is a reply to message #1015013] Wed, 27 February 2013 03:28 Go to previous messageGo to next message
Eclipse UserFriend
Matthias,

Comments below.

On 27/02/2013 9:13 AM, Matthias N wrote:
> Hi,
> I've two Ecore models: A.ecore and B.ecore
> A.ecore references some elements in B.ecore
>
> When I open A.ecore it automatically loads B.ecore as well, that's fine:
>
> platform:/resource/org.eatop.eel.eastadl2110/model/A.ecore
> platform:/resource/org.eatop.eel.eastadl2110/model/B.ecore
>
>
> Okay, now I copy those two ecore files into another location
> (new-folder) of my workspace and try to open them again:
>
>
> platform:/resource/new-folder/A.ecore
> platform:/resource/org.eatop.eel.eastadl2110/model/B.ecore
It looks like A.ecore's serialization contains absolute URIs for its
references to B.ecore. That's not normally how EMF's tools serialize
models. Normally I would expect references to B.ecore to look like
"B.ecore#<fragment>" but probably you have
"platform:/resource/org.eatop.eel.eastadl2110/model/B.ecore#<fragment>".
Is that the case?
>
>
> The path of B.ecore didn't get updated?!, Hence A.ecore can't load the
> model elements in B.ecore.
>
> Any ideas how to solve this?
Which tool did you use to edit/create these two models? If you edit
A.ecore and B.ecore with the Sample Ecore Editor (make some change and
then change it back so you can actually save the result), what do the
URIs in the serialization look like?
Re: Cross referencing model [message #1015065 is a reply to message #1015020] Wed, 27 February 2013 05:55 Go to previous messageGo to next message
Eclipse UserFriend
Hi Ed,
we generate the Ecore models:

Below, there is a code snippet of A.ecore:
<eSuperTypes href="./A.ecore#//east_adl/infrastructure/elements/EAElement"/>
<eSuperTypes href="platform:/resource/org.eatop.eel.eastadl2110/model/B.ecore#//ginfrastructure/gelements/GEAPackage"/>        


I guess the URI of B.ecore should be sth like
./B.ecore#//
?

And yes, when I open A.ecore and edit it, save it again it works fine... But how can I tell EMF to serialize into relative URI?

[Updated on: Wed, 27 February 2013 06:04] by Moderator

Re: Cross referencing model [message #1015100 is a reply to message #1015065] Wed, 27 February 2013 08:20 Go to previous message
Eclipse UserFriend
Matthias,

Be sure that you use an absolute URI for each resource you create. That
will ensure that when you save them, references between them will be
relative URIs whenever possible.


On 27/02/2013 11:55 AM, Matthias N wrote:
> Hi Ed,
> we generate the Ecore models:
>
> Below, there is a code snippet of A.ecore:
>
> <eSuperTypes
> href="./A.ecore#//east_adl/infrastructure/elements/EAElement"/>
> <eSuperTypes
> href="platform:/resource/org.eatop.eel.eastadl2110/model/B.ecore#//ginfrastructure/gelements/GEAPackage"/>
>
>
> I guess the URI of B.ecore should be sth like
> /B.ecore#// ?
Previous Topic:[TENEO] Load Read-only database into XMI
Next Topic:A newbie question of EMF transaction
Goto Forum:
  


Current Time: Wed Jul 23 16:02:54 EDT 2025

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

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

Back to the top