Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » XMI UML Profile to Ecore
XMI UML Profile to Ecore [message #791096] Sun, 05 February 2012 09:06 Go to next message
Michael Bob is currently offline Michael BobFriend
Messages: 29
Registered: February 2012
Junior Member
Hello,

I have the following problem:

I want to use the UML2 ecore model part of Eclipse UML2 for generating and querying UML models. Furthermore, I have an XMI file describing an UML profile.

Now my question is: I have the UML2 ecore file. How can I import the UML profile based on XMI in order to generate a UML profile that can be combined with the UML2 ecore model?

Regards,

Michael
Re: XMI UML Profile to Ecore [message #791114 is a reply to message #791096] Sun, 05 February 2012 09:44 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi Michael

I don't understand your emphasis on XMI files; all Ecore, UML, ... files
are XMI.

From my limited observation, the UML2 tooling is designed to work on
UML files and when you have finished your UML preparations you can
export to Ecore to have something to instantiate.

I would therefore look to perform your preparations in the UML domain,
perhaps using the tools directly accessible from the UML Model Editor,
or perhaps by performing equivalent Java calls in your code.

Regards

Ed Willink


On 05/02/2012 09:07, Michael Gebhart wrote:
> Hello,
>
> I have the following problem:
>
> I want to use the UML2 ecore model part of Eclipse UML2 for generating
> and querying UML models. Furthermore, I have an XMI file describing an
> UML profile.
>
> Now my question is: I have the UML2 ecore file. How can I import the
> UML profile based on XMI in order to generate a UML profile that can
> be combined with the UML2 ecore model?
>
> Regards,
>
> Michael
Re: XMI UML Profile to Ecore [message #791132 is a reply to message #791114] Sun, 05 February 2012 10:28 Go to previous messageGo to next message
Michael Bob is currently offline Michael BobFriend
Messages: 29
Registered: February 2012
Junior Member
Hi Ed,

thanks for your answer. You are right, the models in Eclipse are XMI. However, I have the problem: When developing a UML profile with e.g. Papyrus it works. I can load the resource and apply the profile.

However, on one OMG page I found the profile for SoaML: omg.org /spec/SoaML/20091101/SoaMLProfile.xmi

I can open the file in Papyrus (EMF Tools). I can even define a profile and I can apply it.

However, compared to the profile created in Papyrus I cannot apply stereotypes. Obviously the tool does not find the stereotypes within the SoaML XMI even though it looks very similar to my own profile. One big difference are elements like:
          <xmi:Extension extender="[can't post links'">
            <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_jWaD_U_gEeGtD9xJ-qsapA" source="[can't post links]" references="_bO2ggc0cEd6AF7oF64guDA"/>
          </xmi:Extension>


Maybe xmi:Extension is something that does not work with UML2?

What I am wondering: Why does OMG use Ecore within its XMI files? Smile Thought they use MOF.

Regards,

Michael
Re: XMI UML Profile to Ecore [message #791150 is a reply to message #791132] Sun, 05 February 2012 10:46 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi Michael

OMG don't use Ecore; except that rather a lot of practical tooling does
and so sometimes the Ecore slips out; it's supposed to be eliminated.
The new UML specification models are prepared with RAS (Eclipse OCL) and
then transformed to comply with XMI specifications. If nothing else,
this allows UML version Y to prepared with a tool supporting version X.

Unfortunately you couldn't post the link. The MDT/UML2 project has
recently (Juno M2 to M5) added support for UML 2.4.1 which has resulted
in many additional namespaces. As an early user of this support, I
encountered a few xmi:Extension anomalies. It is really rather difficult
to get everything correctly initialized. You may find
/org.eclipse.ocl.examples.pivot/src/org/eclipse/ocl/examples/pivot/uml/UMLUtils.java
provides some inspiration.

I suspect that SoaML may not be using a namespace supported by your
version of MDT/UML2.

You may find it easiest just to adjust the Soa profile to be
namespace-similar to the one that works for Papyrus.

Regards

Ed Willink



On 05/02/2012 10:28, Michael Gebhart wrote:
> Hi Ed,
>
> thanks for your answer. You are right, the models in Eclipse are XMI.
> However, I have the problem: When developing a UML profile with e.g.
> Papyrus it works. I can load the resource and apply the profile.
> However, on one OMG page I found the profile for SoaML: omg.org
> /spec/SoaML/20091101/SoaMLProfile.xmi
>
> I can open the file in Papyrus (EMF Tools). I can even define a
> profile and I can apply it.
>
> However, compared to the profile created in Papyrus I cannot apply
> stereotypes. Obviously the tool does not find the stereotypes within
> the SoaML XMI even though it looks very similar to my own profile. One
> big difference are elements like:
>
> <xmi:Extension extender="[can't post links'">
> <eAnnotations xmi:type="ecore:EAnnotation"
> xmi:id="_jWaD_U_gEeGtD9xJ-qsapA" source="[can't post links]"
> references="_bO2ggc0cEd6AF7oF64guDA"/>
> </xmi:Extension>
>
> Maybe xmi:Extension is something that does not work with UML2?
>
> What I am wondering: Why does OMG use Ecore within its XMI files? :)
> Thought they use MOF.
>
> Regards,
>
> Michael
Re: XMI UML Profile to Ecore [message #791309 is a reply to message #791150] Sun, 05 February 2012 16:19 Go to previous messageGo to next message
Michael Bob is currently offline Michael BobFriend
Messages: 29
Registered: February 2012
Junior Member
Hi Ed,

thanks again. This is very interesting news. What is RAS? Or better asked: How can Eclipse OCL help to formalize UML specification? Don't see the relationship.

I am 3 posts away from posting URLs Smile I am wondering because the XMI that I can download from the OMG page contains Ecore elements. I don't know anything comparable to formalize the UML superstructure.

I have seen that I use Papyrus based on Eclipse 3.5. Maybe the issues will be solved with a newer version. Furthermore, I will try to adapt the namespaces, thanks.

Regards

Michael
Re: XMI UML Profile to Ecore [message #791326 is a reply to message #791309] Sun, 05 February 2012 16:54 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

> thanks again. This is very interesting news. What is RAS?
A typo for Rational Software Architect.
> Or better asked: How can Eclipse OCL help to formalize UML
> specification? Don't see the relationship.
RSA provides a UML diagram drawing tool.

The UML specification has 500-odd OCL constraints, which in the next
version, are tool-checked!

The final models should validate against the specified OCL.
>
> I have seen that I use Papyrus based on Eclipse 3.5. Maybe the issues
> will be solved with a newer version. Furthermore, I will try to adapt
> the namespaces, thanks.
>
3.5 is seriously old.

Regards

Ed Willink
Re: XMI UML Profile to Ecore [message #791334 is a reply to message #791309] Sun, 05 February 2012 17:11 Go to previous messageGo to next message
Michael Bob is currently offline Michael BobFriend
Messages: 29
Registered: February 2012
Junior Member
Hi again,

thanks. It works now. I have changed the namespaced according to those used in Papyrus. Nevertheless, this makes the compatibility of models hard to realize. I had to remove all xsi:extensions because these were not supported.

I will post the differences in the next post. Then I have 5 posts, so I can use URLs.

Regards,

Michael
Re: XMI UML Profile to Ecore [message #791335 is a reply to message #791334] Sun, 05 February 2012 17:11 Go to previous messageGo to next message
Michael Bob is currently offline Michael BobFriend
Messages: 29
Registered: February 2012
Junior Member
Ok... one post more...
Re: XMI UML Profile to Ecore [message #791338 is a reply to message #791335] Sun, 05 February 2012 17:14 Go to previous messageGo to next message
Michael Bob is currently offline Michael BobFriend
Messages: 29
Registered: February 2012
Junior Member
Ok, here are the differences: Original XMI file from http://www.omg.org/spec/SoaML/20091101/SoaMLProfile.xmi:

<uml:Profile xmi:version="2.1" xmlns:xmi="http://schema.omg.org/spec/XMI/2.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:uml="http://schema.omg.org/spec/UML/2.2" xsi:schemaLocation="http://schema.omg.org/spec/UML/2.2 http://www.eclipse.org/uml2/3.0.0/UML" xmi:id="_bO2YlM0cEd6AF7oF64guDA" name="SoaML">


Changed to:

<uml:Profile xmi:version="2.1" xmlns:xmi="http://schema.omg.org/spec/XMI/2.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:uml="http://www.eclipse.org/uml2/3.0.0/UML" xmi:id="_bO2YlM0cEd6AF7oF64guDA" name="SoaML">


Also changed:

http://schema.omg.org/spec/UML/2.2/uml.xml

to:

pathmap://UML_METAMODELS/UML.metamodel.uml#

Regards,

Michael
Re: XMI UML Profile to Ecore [message #791381 is a reply to message #791338] Sun, 05 February 2012 18:35 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

The first change seems to just depend on how xsi:schemaLocation works.

The second on whether http://schema.omg.org/spec/UML/2.2/uml.xml is
registered.

There is a symbolic definition of
http://schema.omg.org/spec/UML/2.2/uml.xml in the latest code, so I
suggest at least trying with Indigo, and raising Bugzillas.

Regards

Ed Willink

On 05/02/2012 17:14, Michael Gebhart wrote:
> Ok, here are the differences: Original XMI file from
> http://www.omg.org/spec/SoaML/20091101/SoaMLProfile.xmi:
>
>
> <uml:Profile xmi:version="2.1"
> xmlns:xmi="http://schema.omg.org/spec/XMI/2.1"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
> xmlns:uml="http://schema.omg.org/spec/UML/2.2"
> xsi:schemaLocation="http://schema.omg.org/spec/UML/2.2
> http://www.eclipse.org/uml2/3.0.0/UML"
> xmi:id="_bO2YlM0cEd6AF7oF64guDA" name="SoaML">
>
> Changed to:
>
> <uml:Profile xmi:version="2.1"
> xmlns:xmi="http://schema.omg.org/spec/XMI/2.1"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
> xmlns:uml="http://www.eclipse.org/uml2/3.0.0/UML"
> xmi:id="_bO2YlM0cEd6AF7oF64guDA" name="SoaML">
>
> Also changed:
>
> http://schema.omg.org/spec/UML/2.2/uml.xml
>
> to:
> pathmap://UML_METAMODELS/UML.metamodel.uml#
>
> Regards,
>
> Michael
Re: XMI UML Profile to Ecore [message #792092 is a reply to message #791381] Mon, 06 February 2012 15:46 Go to previous messageGo to next message
Michael Bob is currently offline Michael BobFriend
Messages: 29
Registered: February 2012
Junior Member
Hi Ed,

thanks. I am using Indigo so this did not help.


> The first change seems to just depend on how xsi:schemaLocation works.

The second on whether http://schema.omg.org/spec/UML/2.2/uml.xml is
registered.

How can I fix it?

Regards,

Michael
Re: XMI UML Profile to Ecore [message #792180 is a reply to message #792092] Mon, 06 February 2012 17:52 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi Michael

When it doesn't work you have to debug and sometimes that takes me a
long time. Hopefully at the end you can submit a fix so that the next
user suffers less.

Regards

Ed Willink


On 06/02/2012 15:46, Michael Gebhart wrote:
> Hi Ed,
>
> thanks. I am using Indigo so this did not help.
>
>
>> The first change seems to just depend on how xsi:schemaLocation works.
>
> The second on whether http://schema.omg.org/spec/UML/2.2/uml.xml is
> registered.
>
> How can I fix it?
>
> Regards,
>
> Michael
Previous Topic:Experiences with model size and performance
Next Topic:How to access stereotypes of uml elements?
Goto Forum:
  


Current Time: Wed Apr 24 23:16:57 GMT 2024

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

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

Back to the top