Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » OMG XMI to Eclipse UML or to Ecore - best option?(OMG XMI to Eclipse UML or to Ecore - best option?)
OMG XMI to Eclipse UML or to Ecore - best option? [message #1785610] Tue, 17 April 2018 13:09 Go to next message
Bruce Trask is currently offline Bruce TraskFriend
Messages: 58
Registered: July 2009
Member
Hello,

I have an OMG XMI file from https://www.omg.org/spec/SBVR/20160601/SBVR-XMI-Metamodel.xml .

If I want to make it into a Eclipse UML2 (XMI) file (.uml) or into an Ecore (XMI) file what are my best options?

Do I need to write a QVT transformation from OMG UML XMI to Eclipse UML XMI and then to ecore XMI? Or is there some other way such as open the OMG XMI in Papyrus and export as Ecore or Eclipse UML (if that is possible)?

Regards,
Bruce

[Updated on: Tue, 17 April 2018 13:11]

Report message to a moderator

Re: OMG XMI to Eclipse UML or to Ecore - best option? [message #1785611 is a reply to message #1785610] Tue, 17 April 2018 13:26 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

On a really good day you can open with the UML Model Editor and save as *.uml.

On a good day you can manually rename to a *.xmi file.

On a less good day you need to rename to *.uml, and to use a text editor to adjust the namespaces to match another *.uml file.

Regards

Ed Willink
Re: OMG XMI to Eclipse UML or to Ecore - best option? [message #1785638 is a reply to message #1785611] Tue, 17 April 2018 16:53 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

From the changed question on the Papyrus newsgroup...

The actual problem was the failure to load a CMOF file with an unexpected version combination. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=533703

The actual fix is to use a text editor to adjust the versions/namespaces to match a supported *.cmof file.

Regards

Ed Willink
Re: OMG XMI to Eclipse UML or to Ecore - best option? [message #1785663 is a reply to message #1785638] Wed, 18 April 2018 07:45 Go to previous messageGo to next message
Bruce Trask is currently offline Bruce TraskFriend
Messages: 58
Registered: July 2009
Member
Hi Ed,

Thanks.

My question now is what are my options to convert the cmof XMI file I know am able to load in the UML editor, into Eclipse UML XMI (so that I can then do a convert to Ecore)? On the loaded XMI it still has cmof tags and so the "Convert to:" does not recognize the package element and so become enabled. In other words, I would like to go from CMOF XMI to Eclipse UML XMI to Ecore XMI. Should I just go QVT or is there an easier way?

Regards,
Bruce

[Updated on: Wed, 18 April 2018 07:48]

Report message to a moderator

Re: OMG XMI to Eclipse UML or to Ecore - best option? [message #1785665 is a reply to message #1785663] Wed, 18 April 2018 07:57 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

Open in the UML Model Editor. File->Save As... and specify something.uml

Regards

Ed Willink
Re: OMG XMI to Eclipse UML or to Ecore - best option? [message #1785667 is a reply to message #1785665] Wed, 18 April 2018 08:03 Go to previous messageGo to next message
Bruce Trask is currently offline Bruce TraskFriend
Messages: 58
Registered: July 2009
Member
Hi Ed,

Ok. Thanks. I just tried that. Got an interesting result:

the resulting .uml file looks like modisco got in there:

<?xml version="1.0" encoding="UTF-8"?>
<modisco.xml:Root xmi:version="20131001" xmlns:xmi="http://www.omg.org/spec/XMI/20131001" xmlns:modisco.xml="http://www.eclipse.org/MoDisco/Xml/0.1.incubation/XML" xmi:id="_n_ADwELeEeiKM9CtD28VzA" name="xmi:XMI">
<children xmi:type="modisco.xml:Attribute" xmi:id="_n_ADwULeEeiKM9CtD28VzA" name="xmi:version" value="2.0"/>
<children xmi:type="modisco.xml:Text" xmi:id="_n_ADwkLeEeiKM9CtD28VzA" name="&#xA; "/>
<children xmi:type="modisco.xml:Element" xmi:id="_n_ADw0LeEeiKM9CtD28VzA" name="cmof:Package">
<children xmi:type="modisco.xml:Attribute" xmi:id="_n_ADxELeEeiKM9CtD28VzA" name="xmi:id" value="sbvrVocabulary"/>
<children xmi:type="modisco.xml:Attribute" xmi:id="_n_ADxULeEeiKM9CtD28VzA" name="name" value="SBVR"/>
<children xmi:type="modisco.xml:Attribute" xmi:id="_n_ADxkLeEeiKM9CtD28VzA" name="uri" value="http://www.omg.org/spec/SBVR/20160601"/>
<children xmi:type="modisco.xml:Text" xmi:id="_n_ADx0LeEeiKM9CtD28VzA" name="&#xA; "/>
<children xmi:type="modisco.xml:Element" xmi:id="_n_ADyELeEeiKM9CtD28VzA" name="annotatedElement">
<children xmi:type="modisco.xml:Attribute" xmi:id="_n_ADyULeEeiKM9CtD28VzA" name="xmi:idref" value="eee_1045467100313_135436_1"/>
</children>
....

Do I need to uninstall modisco?

Regards,
Bruce
Re: OMG XMI to Eclipse UML or to Ecore - best option? [message #1785669 is a reply to message #1785638] Wed, 18 April 2018 08:11 Go to previous messageGo to next message
Bruce Trask is currently offline Bruce TraskFriend
Messages: 58
Registered: July 2009
Member
Hi Ed,

Following Kenn's point in https://bugs.eclipse.org/bugs/show_bug.cgi?id=533703 to rename the file as .xmi gives me some trouble when I open with the UML editor.

I right click on the SBVR-XMI-Metamodel.xmi file and open with UML Editor and get the follwing problems:

org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://schema.omg.org/spec/MOF/2.0/cmof.xml' not found. (platform:/resource/TestSBVR/model/SBVR-XMI-Metamodel.xmi, 3, 97)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.getPackageForURI(XMLHandler.java:2643)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.getFactoryForPrefix(XMLHandler.java:2476)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType(XMLHandler.java:1353)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XMLHandler.java:1522)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XMLHandler.java:1044)
at org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMIHandler.java:82)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:1026)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:720)
at org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHand
...

This worked for you?

Regards,
Bruce
Re: OMG XMI to Eclipse UML or to Ecore - best option? [message #1785670 is a reply to message #1785667] Wed, 18 April 2018 08:16 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

You probably have multiple options for Open With... Make sure you use the UML Model Editor. I suspect that Modisco is attempting to do model recovery on a generic extension.

If you need to uninstall Modisco, then raise a Modisco Bugzilla. If with hindsight the Modisco editor is too prominent in the list of editors, maybe something can be done. There is now a "default" that can be set and is now used to ensure that the Sample Ecore Editor dominates the OCLinEcore Editor. Perhaps the same declaration is needed to ensure the UML Model Editor dominates the Modisco or TextUML editors. Could work for *.uml/*.cmof but for *.xml/*.xmi the anarchy may bes unavoidable.

Regards

Ed Willink
Re: OMG XMI to Eclipse UML or to Ecore - best option? [message #1785671 is a reply to message #1785670] Wed, 18 April 2018 08:21 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

*.xmi worked fine for me this morning, but I'm pretty sure it didn't yesterday. This probably means something has remained open.

The UML/Ecore Model Editors use an EditingDomain so that multiple editors can share the same edited model. Perhaps we both have a bad editor still open when trying the next permutation.

Next time *.xmi does not work for you close all editors/debuggers/... and open the *.xmi again. If that still fails restart Eclipse... If there is something genuinely bad we need a repro.

Regards

Ed Willink
Re: OMG XMI to Eclipse UML or to Ecore - best option? [message #1785755 is a reply to message #1785671] Thu, 19 April 2018 11:10 Go to previous messageGo to next message
Bruce Trask is currently offline Bruce TraskFriend
Messages: 58
Registered: July 2009
Member
Hello,

I can get the .xmi version to load into UML2 Model Editor and then Save As... .uml file and that works fine and then I can open that with UML2 Model Editor and select package and convert to Ecore. That works.

Just curious, when I use the extension .cmof, the load into the UML Model Editor complains of packagenotfound:
org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://schema.omg.org/spec/MOF/2.0/cmof.xml' not found. (platform:/resource/TestSBVR/model/SBVR-XMI-Metamodel.cmof, 3, 97)

I used the debugger enough to find out that the packageregistry for the XML resource is empty. What plugin in supposed to register something for .cmof files?

Regards,
Bruce
Re: OMG XMI to Eclipse UML or to Ecore - best option? [message #1785760 is a reply to message #1785755] Thu, 19 April 2018 12:01 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

That looks like the repro I was looking for but couldn't reproduce. Please double check that it fails in a clean escape, then attach the exact file.

Regards

Ed Willink
Re: OMG XMI to Eclipse UML or to Ecore - best option? [message #1785801 is a reply to message #1785760] Fri, 20 April 2018 07:17 Go to previous message
Bruce Trask is currently offline Bruce TraskFriend
Messages: 58
Registered: July 2009
Member
Hi,

Yes. I think this is a good repro of the problem.

I download a clean stock eclipse modeling download package
eclipse-modeling-oxygen-M2-macosx-cocoa-x86_64.tar.gz

Created a simple project and add the attached cmof file to it.

Right click on that file and Open With... UML Model Editor

I see a failure to open with a PackageNotFoundException with Package with
uri http://schema.omg.org/spec/MOF/2.0/cmof.xml not found.

Regards,
Bruce

[Updated on: Wed, 25 April 2018 06:51]

Report message to a moderator

Previous Topic:Custom field on Property object in metamodel
Next Topic:XML/XMI import/export issues?
Goto Forum:
  


Current Time: Thu Mar 28 19:44:43 GMT 2024

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

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

Back to the top