View UML Abstract Metamodel XMI file in Eclipse [message #1826867] |
Sun, 03 May 2020 08:25  |
Eclipse User |
|
|
|
Hi,
In order to better understand the relations between elements of the UML metamodel, I have downloaded the abstract syntax metamodel from OMG for latest UML specification (UML 2.5.1).
I have successfully imported the UML.xmi file into MagicDraw, which is a commercial tool, however, I could not succeed using either Papyrus or Eclipse Modeling Tools IDE.
There were past topics about opening xmi files, I have reviewed them all. The only solution which kind of works for me is to rename the UML.xmi file as UML.uml and then open with the UML diagram editor. Then, I can open the file, but the way the elements are viewed looks like a bit problematic.
I have attached a screenshots of the views I get in both tools.
Is this normal behavior? Or am I missing something? Is there any way that I can get a nice view of the metamodel in Eclipse, just like the one in MagicDraw?
Regards,
Alper Kocatas
|
|
|
|
Re: View UML Abstract Metamodel XMI file in Eclipse [message #1826911 is a reply to message #1826869] |
Mon, 04 May 2020 10:04   |
Eclipse User |
|
|
|
Hi,
A while ago one of my students did exactly the same thing as in the original post, he downloaded the UML 2.5.1 machine readable metamodel specification at
https://www.omg.org/spec/UML/20161101/UML.xmi
An then tried to load it with the UML2 editor and Papyrus, just by renaming it into UML.uml and got the same errors.
If I remember well, to be able to load it, apart from changing the namespace URI to http://www.eclipse.org/uml2/5.0.0/UML, as Ed suggested, he also needed to change all the property definitions that referenced primitive types (as they pointed to the PrimitivesTypes.xmi in the OMG site)
I will try to find the patched metamodel in my mails, and post it here for others
Regards
[Updated on: Mon, 04 May 2020 10:08] by Moderator
|
|
|
|
|
|
|
Re: View UML Abstract Metamodel XMI file in Eclipse [message #1826976 is a reply to message #1826962] |
Tue, 05 May 2020 10:45   |
Eclipse User |
|
|
|
Hi Ed,
Yes the XMI specification has never been clear about how the XMI model (documentation, extension, differences) relates to the canonical xsd schema https://www.omg.org/spec/XMI/20110501/XMI-Canonical.xsd.
There is this cryptic passage in the XMI 2.5.1 specification that leaves you wondering whether "documentation" in lower-case should be valid or not.
Quote:
7.5.3 XMI
The root level XML element for XMI documents containing only XMI data may be the XMI element, but it must be the
XMI element if there are multiple elements. Its declaration is:
<xsd:complexType name="XMI">
<xsd:choice minOccurs="0" maxOccurs="unbounded">
<xsd:any processContents="strict"/>
</xsd:choice>
</xsd:complexType>
<xsd:element name="documentation" type="Documentation"/>
<xsd:element name="difference" type="Difference"/>
<xsd:element name="extension" type="Extension"/>
<xsd:element name="XMI" type="XMI"/>
Note that in the schema that the elements for documentation, difference and extension may not validly be included in the
xsd:choice for XMI since that already has xsd:any. However are the elements that must be used within the XMI elements.
The Documentation, Difference, and Extension elements (starting with uppercase), defined in the following sub clauses,
may only be used if they are root elements, not nested underneath XMI, and qualified with the XMI namespace: for
example xmi:Documentation.
|
|
|
|
|
|
|
Re: View UML Abstract Metamodel XMI file in Eclipse [message #1827142 is a reply to message #1827131] |
Fri, 08 May 2020 00:59  |
Eclipse User |
|
|
|
Hi
It should only be necessary to fix the documentation element (and two broken internal OCL expressions).
The problem with the documentation element is very subtle so its not surprising that tools are imperfected.
For a long time the relevant OMG authors used RSA which irritated me because it is Eclipse OCL under the hood but from a previous age.
Regards
Ed Willink
|
|
|
Powered by
FUDForum. Page generated in 0.04405 seconds