Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Resolving ecore cross references for ecore files created from xcore.
Resolving ecore cross references for ecore files created from xcore. [message #1220974] Mon, 16 December 2013 07:05 Go to next message
Martin Taal is currently offline Martin Taal
Messages: 5326
Registered: July 2009
Senior Member
Hi,
Now I have another question related to xcore. In the Texo code I get an epackage from xcore (using an
EMF(Xcore)Resource), I then store it in an ecore file. When a xcore model refers to another xcore model, the resulting
ecore will refer to the other ecore. I noticed that the references in ecore use this type of uri:
org.eclipse.emf.texo.test.model.samples.sport.society#/EPackage/Society
for example:
<eClassifiers xsi:type="ecore:EClass" name="Club"
eSuperTypes="org.eclipse.emf.texo.test.model.samples.sport.society#/EPackage/Society">

when I read the ecore files using a resourceset the resolving of this reference fails here:
position = Integer.parseInt(uriFragmentRootSegment);
ResourceImpl line 713
It assumes that the segment fragment is a number, while in my case it has the value EPackage.

How can I tell ecore to store the references in a different way using a number? Or the other way around how can I tell
EMF to resolve these references in a different way?

gr. Martin

--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: Resolving ecore cross references for ecore files created from xcore. [message #1220995 is a reply to message #1220974] Mon, 16 December 2013 10:02 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 25925
Registered: July 2009
Senior Member
Martin,

Comments below.

On 16/12/2013 1:05 PM, Martin Taal wrote:
> Hi,
> Now I have another question related to xcore. In the Texo code I get
> an epackage from xcore (using an EMF(Xcore)Resource), I then store it
> in an ecore file.
Do you do that for all the Ecore model involved before saving any of them?
> When a xcore model refers to another xcore model, the resulting ecore
> will refer to the other ecore. I noticed that the references in ecore
> use this type of uri:
> org.eclipse.emf.texo.test.model.samples.sport.society#/EPackage/Society
> for example:
> <eClassifiers xsi:type="ecore:EClass" name="Club"
> eSuperTypes="org.eclipse.emf.texo.test.model.samples.sport.society#/EPackage/Society">
>
> when I read the ecore files using a resourceset the resolving of this
> reference fails here:
> position = Integer.parseInt(uriFragmentRootSegment);
> ResourceImpl line 713
> It assumes that the segment fragment is a number, while in my case it
> has the value EPackage.
Yes, it uses a symbolic approach rather than an index, but of course
only an XcoreResourceImpl recognizes that...
>
>
> How can I tell ecore to store the references in a different way using
> a number?
It's determined by the resource implementation in which the referenced
model is located...
> Or the other way around how can I tell EMF to resolve these references
> in a different way?
If you're going to move objects around, you have to be consistent and do
it for all the resources in the resource set, including, and in
particular, the resources being referenced if those references are going
to be moved as well...
>
> gr. Martin
>
Re: Resolving ecore cross references for ecore files created from xcore. [message #1221129 is a reply to message #1220995] Mon, 16 December 2013 19:20 Go to previous message
Martin Taal is currently offline Martin Taal
Messages: 5326
Registered: July 2009
Senior Member
Hi Ed,
Thanks, this pointed me in the right direction. I indeed do this for all ecore models. I got it working by moving the
epackage from the xcoreresource (and then not saving the xcoreresource to not let it be changed) to a XMIresource, the
uri's got generated in the standard way then. Maybe there is a nicer solution though...

gr. Martin

On 12/16/2013 04:02 PM, Ed Merks wrote:
> Martin,
>
> Comments below.
>
> On 16/12/2013 1:05 PM, Martin Taal wrote:
>> Hi,
>> Now I have another question related to xcore. In the Texo code I get an epackage from xcore (using an
>> EMF(Xcore)Resource), I then store it in an ecore file.
> Do you do that for all the Ecore model involved before saving any of them?
>> When a xcore model refers to another xcore model, the resulting ecore will refer to the other ecore. I noticed that
>> the references in ecore use this type of uri:
>> org.eclipse.emf.texo.test.model.samples.sport.society#/EPackage/Society
>> for example:
>> <eClassifiers xsi:type="ecore:EClass" name="Club"
>> eSuperTypes="org.eclipse.emf.texo.test.model.samples.sport.society#/EPackage/Society">
>>
>> when I read the ecore files using a resourceset the resolving of this reference fails here:
>> position = Integer.parseInt(uriFragmentRootSegment);
>> ResourceImpl line 713
>> It assumes that the segment fragment is a number, while in my case it has the value EPackage.
> Yes, it uses a symbolic approach rather than an index, but of course only an XcoreResourceImpl recognizes that...
>>
>>
>> How can I tell ecore to store the references in a different way using a number?
> It's determined by the resource implementation in which the referenced model is located...
>> Or the other way around how can I tell EMF to resolve these references in a different way?
> If you're going to move objects around, you have to be consistent and do it for all the resources in the resource set,
> including, and in particular, the resources being referenced if those references are going to be moved as well...
>>
>> gr. Martin
>>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Previous Topic:Automatically generate EMF, Help!
Next Topic:how to create a database connection and perform through emf_rcp
Goto Forum:
  


Current Time: Mon Jul 28 08:26:48 EDT 2014

Powered by FUDForum. Page generated in 0.01899 seconds