Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » View UML Abstract Metamodel XMI file in Eclipse(Use Eclipse modeling tools to view/browse UML Abstract Syntax Metamodel )
View UML Abstract Metamodel XMI file in Eclipse [message #1826867] Sun, 03 May 2020 12:25 Go to next message
Alper Tolga Kocatas is currently offline Alper Tolga KocatasFriend
Messages: 2
Registered: May 2020
Junior Member
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 #1826869 is a reply to message #1826867] Sun, 03 May 2020 15:42 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

The UML project only supports the exact URIs for which it was built. These are probably for exactly UML 2.5. My attempts at making it externsible for development/later versions have been rebuffed.

OMG churns URIs amost as if they wanted to guarantee that tool interoperability fails.

If your *.xmi is erxactly UML 2.5 it might work.

Much better to change to *.uml AND change to the http://www.eclipse.org/uml2/5.0.0/UML URI. It looks as if you only made the first change.

In general take a working *.uml file and make your file look the same.

If you post your UML 2.5.1 file it could be investigated.

Regards

Ed Willink
Re: View UML Abstract Metamodel XMI file in Eclipse [message #1826911 is a reply to message #1826869] Mon, 04 May 2020 14:04 Go to previous messageGo to next message
German Vega is currently offline German VegaFriend
Messages: 104
Registered: December 2015
Location: Grenoble, France
Senior Member
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 14:08]

Report message to a moderator

Re: View UML Abstract Metamodel XMI file in Eclipse [message #1826917 is a reply to message #1826911] Mon, 04 May 2020 14:27 Go to previous messageGo to next message
German Vega is currently offline German VegaFriend
Messages: 104
Registered: December 2015
Location: Grenoble, France
Senior Member
Hi again,

Ok, here it is, you will find attached the UML 5.2.1 metamodel modified to be able to load it with eclipse UML2 editor or Papyrus.

@Ed, for your information, the modifications are the following:


  • The namespaces changed from
    <xmi:XMI xmlns:uml="http://www.omg.org/spec/UML/20131001"
             xmlns:xmi="http://www.omg.org/spec/XMI/20131001"
             xmlns:mofext="http://www.omg.org/spec/MOF/20131001">
    


    to
    <xmi:XMI xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML"
             xmlns:xmi="http://www.omg.org/spec/XMI/20131001"
             xmlns:mofext="http://www.omg.org/spec/MOF/20131001">
    

  • For all all the property declarations with a primitive type (in this example a Boolean) replaced

     <type href="http://www.omg.org/spec/UML/20131001/PrimitiveTypes.xmi#Boolean"/>
     


    by

    <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Boolean"/>
    



There are still some elements that are not loaded : the <documentation> at the beginning that I am not sure to which namespace belongs (at it is not qualified) and the <mofext:Tag> at the end.

I do not know if there is a better way, but this still works, I just load it with an Eclipse Modelling 2020-03 version
Re: View UML Abstract Metamodel XMI file in Eclipse [message #1826927 is a reply to message #1826917] Mon, 04 May 2020 17:35 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

You should be able to just change to the http://www.eclipse.org/uml2/5.0.0/Types nsURI, which should be a xmlns if the original serialization had taken on board the UML 2.5 change.

IIRC my last attempt to provide an add-on registration installer to allow unmodified *.xmi loading work foundered on OMG's failure to publish http://www.omg.org/spec/MOF/20131001. I see that my winge has now been resolved so I may take another look at this.

Regards

Ed Willink
Re: View UML Abstract Metamodel XMI file in Eclipse [message #1826946 is a reply to message #1826927] Tue, 05 May 2020 06:29 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

The actual problem is in the preamble of the UML 2.5.1 model..

<documentation>
<shortDescription>UML.xmi: XMI representation of the metamodel for UML 2.5.1.</shortDescription>
</documentation>

is not well-formed since there is no xmlns for the blank namespace. If you delete it all goes a lot better.

If someone posts a UML 2.5.1 serialization, I can investigate further.

Regards

Ed Willink
Re: View UML Abstract Metamodel XMI file in Eclipse [message #1826962 is a reply to message #1826946] Tue, 05 May 2020 11:41 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

Yes the problem is in the UML 2.5.1 header, but the new header complies with a breaking change between XMI 2.4.1 and XMI 2.5.1 in which the element spelling was changed from "Documentation" to "documentation". Eclipse hasn't been trying very hard to chase OMG pedantries, especially when there is a two year delay in publication of secondary standards. XML 2.5 never appeared seems missing so it was anyone's guess what http://www.omg.org/spec/XMI/20131001 would be when eventually published as XMI 2.5.1 in 2015 by which time Eclipse UML had already supported it as the same as XMI 2.4.1.

Regards

Ed Willink

Re: View UML Abstract Metamodel XMI file in Eclipse [message #1826976 is a reply to message #1826962] Tue, 05 May 2020 14:45 Go to previous messageGo to next message
German Vega is currently offline German VegaFriend
Messages: 104
Registered: December 2015
Location: Grenoble, France
Senior Member
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 #1826985 is a reply to message #1826976] Tue, 05 May 2020 17:40 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

Thanks, but no thanks.

Intuitively, XMI defines a documentation element so obviously it can be used, and UML 2.5.1 does.

Pedantically there seems to be plenty for EMF/UML projects to use to justify no change; understandable since they have zero funding and diminishing enthusiasm.

Practically it all seems to dive into the ExtendedMetaData that I never understand, but if I can figure out what's going wrong maybe there is a solution.

Fundamentally Eclipse could change. OMG cannot, the UML 2.5.1 UML.xmi is out there. All that could happen is an emergency UML 2.5.2 could be issued, but all the UML 2.5.1 tools will take five years to catch up regardless.

(I've raised an issue for two syntax errors in the OCL embedded with UML 2.5.1.)

Regards

Ed Willink

Re: View UML Abstract Metamodel XMI file in Eclipse [message #1826986 is a reply to message #1826985] Tue, 05 May 2020 17:53 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

After reading four times the XMI 2.5.1 snippet seems clear; it must be xmi:Documentation. I've updated the report to demand an emergency UML 2.5.2.

I thought the original problem was a UML 2.5.1 serialization of a user model. Until someone provides one, I have no way of attempting to make sure Eclipse can accommodate it today. But maybe its just the broken UML 2.5.1 UML.xmi, for which the fix is to change the "documentation" element to "xmi:Documentation" (or just delete it). AFAICT the UML.xmi is otherwise a clean UML 2.5 serialization of the UML 2.5.1 metamodel.

Regards

Ed Willink
Re: View UML Abstract Metamodel XMI file in Eclipse [message #1827118 is a reply to message #1826986] Thu, 07 May 2020 14:06 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

The restriction kind of makes sense. Suppose I declared a blank xmlns that had a documentation element. THis would bea ambiguous xm::Documentation of my:documentation. So all xmi:XMI children must be xmlns qualified.

Regards

Ed
Re: View UML Abstract Metamodel XMI file in Eclipse [message #1827131 is a reply to message #1827118] Thu, 07 May 2020 19:55 Go to previous messageGo to next message
Alper Tolga Kocatas is currently offline Alper Tolga KocatasFriend
Messages: 2
Registered: May 2020
Junior Member
Hi, @Ed, @German,
Thanks a lot for your responses. I have managed to load the UML.xmi from OMG using the find/replace suggestions and commenting out the documentation block at the beginning and moftext tag at the end of the document. Afterwards, the UML.xmi can be directly opened with UML Model Editor.

Isn't it interesting that MagicDraw can load the document without any complaints? I have checked the loaded model there and could not find the text stated in the <documentation> tag in the beginning. Therefore, it looks like MagicDraw just ignored it without any complaints. As for the primitive types, it looks like it has resolved them.

By the way, I also wonder which tool OMG is using to manage these meta-models. I could not find any information on that. Do you have an idea?

Regards,
Alper

Re: View UML Abstract Metamodel XMI file in Eclipse [message #1827142 is a reply to message #1827131] Fri, 08 May 2020 04:59 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
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
Previous Topic:XMI File generated from Erwin as UML Export - How to read?
Next Topic:Reading and applying profile geneated through MagicDraw
Goto Forum:
  


Current Time: Sat Apr 20 01:37:07 GMT 2024

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

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

Back to the top