Replies: 4 comments 5 replies
-
|
That's a lot of questions. You can look at other subclasses such as |
Beta Was this translation helpful? Give feedback.
-
|
Hi Ed
Yes, the method XMIResourceImpl.useIDs() returns true.
As I understand it, XMLResourceImpl.useUUIDs() must return true if I want to use UUIDs instead of integer numbers in the XMI files. XMIResourceImpl doesn’t have useUUIDs() and XMLResourceImpl.useUUIDs() returns false.
So I have the change useUUIDs() to return true, use it to override XMLResourceImpl.useUUIDs() in a new class MyXMIResourceImpl, create a new factory MyXMIResourceFactoryImpl for it and finally register the new factory in the plugin.xml.
If you see an issue with this please let me know.
Thanks for looking into to this / Lars-Ola
Från: Ed Merks ***@***.***>
Skickat: den 28 mars 2026 12:14
Till: eclipse-emf/org.eclipse.emf ***@***.***>
Kopia: Lars-Ola Osterlund ***@***.***>; Author ***@***.***>
Ämne: Re: [eclipse-emf/org.eclipse.emf] How to change IDs in XMI data files from integers to UUIDs (Discussion #104)
It already returns true as the default behavior for XMI.
https://github.com/eclipse-emf/org.eclipse.emf/blob/95f7c311a6a3e821e1d593886dea7e4d342fc70c/plugins/org.eclipse.emf.ecore.xmi/src/org/eclipse/emf/ecore/xmi/impl/XMIResourceImpl.java#L92
—
Reply to this email directly, view it on GitHub <#104?email_source=notifications&email_token=AN4NIQ3K3AP5VNUO32L7YTT4S6XV7A5CNFSNUABIM5UWIORPF5TWS5BNNB2WEL2ENFZWG5LTONUW63SDN5WW2ZLOOQXTCNRTGU2TGNBTUZZGKYLTN5XKMYLVORUG64VFMV3GK3TUVRTG633UMVZF6Y3MNFRWW#discussioncomment-16355343> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/AN4NIQ73MGNV2OC3VIBOOJT4S6XV7AVCNFSM6AAAAACXCICHKKVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTMMZVGUZTIMY> .
You are receiving this because you authored the thread. <https://github.com/notifications/beacon/AN4NIQYEVRX5MFHR4WBA4A34S6XV7BFCNFSM6AAAAACXCICHKKWGG33NNVSW45C7OR4XAZNRIRUXGY3VONZWS33OINXW23LFNZ2KUY3PNVWWK3TUL5UWJTQA7GIA7JTSMVQXG33OUZQXK5DIN5ZA.gif> Message ID: ***@***.*** ***@***.***> >
|
Beta Was this translation helpful? Give feedback.
-
|
Oh, sorry to disturb your vacation. Yes, I realize I will have to update the EMF platform and rebuild it, a huge topic on its own. I will investigate it a bit but maybe it is better if you could this for me.
Have a nice holiday / Lars-Ola
Från: Ed Merks ***@***.***>
Skickat: den 28 mars 2026 15:48
Till: eclipse-emf/org.eclipse.emf ***@***.***>
Kopia: Lars-Ola Osterlund ***@***.***>; Author ***@***.***>
Ämne: Re: [eclipse-emf/org.eclipse.emf] How to change IDs in XMI data files from integers to UUIDs (Discussion #104)
I'm answering with my iPhone with bad internet while on vacation. From what you describe, you have quite some specialization to do in a framework that is quite complex.
—
Reply to this email directly, view it on GitHub <#104?email_source=notifications&email_token=AN4NIQ363UHFQZRHCOA2G4T4S7Q3BA5CNFSNUABIM5UWIORPF5TWS5BNNB2WEL2ENFZWG5LTONUW63SDN5WW2ZLOOQXTCNRTGU3TAMJRUZZGKYLTN5XKMYLVORUG64VFMV3GK3TUVRTG633UMVZF6Y3MNFRWW#discussioncomment-16357011> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/AN4NIQ4L43QS6JV7KCTGOQD4S7Q3BAVCNFSM6AAAAACXCICHKKVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTMMZVG4YDCMI> .
You are receiving this because you authored the thread. <https://github.com/notifications/beacon/AN4NIQ7RXBRTK45ZE2Q5YYL4S7Q3BBFCNFSM6AAAAACXCICHKKWGG33NNVSW45C7OR4XAZNRIRUXGY3VONZWS33OINXW23LFNZ2KUY3PNVWWK3TUL5UWJTQA7GLJHJTSMVQXG33OUZQXK5DIN5ZA.gif> Message ID: ***@***.*** ***@***.***> >
|
Beta Was this translation helpful? Give feedback.
-
|
I used the bowling tutotial to understand how the xmi load and save works. With help from Claude Code i figured it out. The useUUID() method need not be changed. I just needed to add xmi:id attributes with UUIDs in the xmi data files and updated the Ecore correspondingly. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
XMI data files, by default, have a format for references to other objects as "//@anyObject.x" where x is an integer. My original data is on RDF format so the object ID is stored in the rdf:about attribute and the references are stored in the rdf:resource attributes.
This far I have figured out that the class "org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl" has a method "useUUIDs()" that returns a hardcoded "false" so I assume I need to change it to "true". I have read that the object IDs will then be stored in the xmi:id attribute and the references will be stored as href attributes. So I will then put my rdf:abouts in the xmi:id and the rdf:resources in the href. Will EMF extend the Ecore information model for all classes with an ID attribute for UUIDs? I already have such an attribute so how do I tell the loader and saver to use it for the xmi:id? The loader will have to translate all the hrefs to internal object references and the saver will have to look up the referenced object and use their xmi:id (wherever it is stored) to put them in a href. From some of my findings EMF is said to generate to UUIDs, as I already have them I don't want this. Last but not least I need to override useUUIDs() to deliver "true". But what about all the classes that call useUUIDs() in XMLResourceImpl, do I have to override them as well to refert to my new class?
I am new to looking into the EMF details at this level so this is tricky for me and I would appreciate some help. / Lars-Ola
Beta Was this translation helpful? Give feedback.
All reactions