|
|
|
Re: How to get meta-model of UML design model [message #598595 is a reply to message #598589] |
Sun, 28 February 2010 11:47 |
Ed Merks Messages: 33218 Registered: July 2009 |
Senior Member |
|
|
This is a multi-part message in MIME format.
--------------020800060507070905010602
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Yu-Hsin,
There is no reasonable XML Schema for the UML2 serialization; XML schema
doesn't support multiple inheritance yet the UML2 model relies heavily
on it. UML2 and the diagrams themselves, i.e., the Notation model, both
use XMI serialization which is driven directly from their respective
Ecore models. I can't imagine how you would get any value from trying
to process the XML directly. It's still not even clear what exactly
you're trying to do. Likely you should be extending UML using profiles
and should look at the documentation here:
<http://wiki.eclipse.org/index.php/MDT-UML2>
http://wiki.eclipse.org/index.php/MDT-UML2
Yu-Hsin Lin wrote:
> Thanks for your reply :)
> Sorry, what I described above is too complicated and vague.
> Actually, I just wanna to get the XML schema of Papyrus.
> Since I'm a newbie to Eclipse and Papyrus, I have no idea to find it.
>
> When I draw UML diagrams on Papyrus, it will generate XML files after
> saving it.
> And what I want is to get the rules how UML metamodels transform into
> XML format.
> Where can I get this information?
>
> Thanks in advance!
> Yu-Hsin
--------------020800060507070905010602
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Yu-Hsin,<br>
<br>
There is no reasonable XML Schema for the UML2 serialization; XML
schema doesn't support multiple inheritance yet the UML2 model relies
heavily on it. UML2 and the diagrams themselves, i.e., the Notation
model, both use XMI serialization which is driven directly from their
respective Ecore models. I can't imagine how you would get any value
from trying to process the XML directly. It's still not even clear
what exactly you're trying to do. Likely you should be extending UML
using profiles and should look at the documentation here:<a
href="http://wiki.eclipse.org/index.php/MDT-UML2"><br>
</a>
<blockquote><a href="http://wiki.eclipse.org/index.php/MDT-UML2">http://wiki.eclipse.org/index.php/MDT-UML2</a><br>
</blockquote>
<br>
<br>
Yu-Hsin Lin wrote:
<blockquote cite="mid:hmda41$3rl$1@build.eclipse.org" type="cite">Thanks
for your reply :) <br>
Sorry, what I described above is too complicated and vague.
<br>
Actually, I just wanna to get the XML schema of Papyrus.
<br>
Since I'm a newbie to Eclipse and Papyrus, I have no idea to find it.
<br>
<br>
When I draw UML diagrams on Papyrus, it will generate XML files after
saving it.
<br>
And what I want is to get the rules how UML metamodels transform into
XML format.
<br>
Where can I get this information?
<br>
<br>
Thanks in advance!
<br>
Yu-Hsin
<br>
</blockquote>
</body>
</html>
--------------020800060507070905010602--
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
|
|
|
Re: How to get meta-model of UML design model [message #598618 is a reply to message #598603] |
Mon, 01 March 2010 11:50 |
Ed Merks Messages: 33218 Registered: July 2009 |
Senior Member |
|
|
Yu-Hsin,
Comments below.
Yu-Hsin Lin wrote:
> Hi,
>
> Please allow me to take a simple example to descibe my problem.
>
> If I draw a class called "MyClass" on Papyrus, then the content of
> .uml file should be:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <uml:Model xmi:version="2.1" xmlns:xmi="..." xmlns:ecore="..."
> xmlns:uml="..." xmi:id="..." name="UMLModel">
> <packageImport xmi:id="...">
> <importedPackage xmi:type="uml:Model" href="..."/>
> </packageImport>
> <packagedElement xmi:type="uml:Class" xmi:id="..." name="MyClass"/>
> <profileApplication xmi:id="...">
> <eAnnotations xmi:id="..." source="...">
> <references xmi:type="ecore:EPackage" href="..."/>
> </eAnnotations>
> <appliedProfile href="..."/>
> </profileApplication>
> </uml:Model>
>
> The basic structure of above xml file is supposed to be as follows:
>
> <packageImport>
> <importedPackage xmi:type="uml:Model">
> </packageImport>
> <packagedElement xmi:type="uml:Class" name="MyClass"/>
> <profileApplication>
> <eAnnotations>
> <references xmi:type="ecore:EPackage" />
> </eAnnotations>
> <appliedProfile />
> </profileApplication>
>
>
> So, I just want to get the rules or definitions that how Papyrus
> translates into XML format when users draw some metamodels on this
> kind of MDT.
> It is certainly a stupid problem :blush:, but has bothered me for a
> long time.
Yes, if you look at the Ecore model for UML (the one whose nsURI matches
the namespace in xmlns:uml="..." ) all is evident there. I.e., you'll
find an EClass called Model; that's the name of the root element.
Model inherits from Package, which inherits from Namespace,
PackageableElement, and TemplateableElement. Namespace has a feature
called packageImport so you'll expect to see elements called
packageImport. Package has a profileApplication feature, so you should
expect that too. All UML Elements extend EModelElement from Ecore
itself, which supports an eAnnotations feature, so you see that as well.
So you see that despite Vlad nonsense commentary about the impossibility
to determine the serialization rules, they're very simply defined by the
(meta)model of UML itself, i.e., by the Ecore model of UML. Note that
Ecore is isomorphic to the OMG's EMOF model; Ecore predates EMOF. At
the root, the name of the EClass is used, and below that, all element
and attribute names correspond to feature names within the class of the
instance. This is the basis for any XMI serialization, so if you want
to understand the rules, look closely at the OMG's XMI specification
which defines how any instance of an EMOF model is serialized. We'll
wait patiently for someone like Vlad to come up with a smarter way,
i.e., to reinvent XMI and to convince the OMG that his solution is
superior to the established standard. However, you have to wonder,
given the fact that he's reusing UML and EMF in Omondo and hence that
he's relying on the same mechanism as Papyrus for serialization, why he
spouts the nonsense that he does. No doubt he has little better to do.
> Thanks in advance!
> Yu-Hsin
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Re: How to get meta-model of UML design model [message #598625 is a reply to message #598613] |
Mon, 01 March 2010 11:55 |
Ed Merks Messages: 33218 Registered: July 2009 |
Senior Member |
|
|
Yu-Hsin,
As I mentioned already, you can't properly describe the serialization of
UML with an XML Schema. You need to think of the Ecore/EMOF model as a
simple and more powerful XML Schema.
Unfortunately Vlad is not here on this forum to help nor to answer your
questions. He's here for the sole purpose of getting people to use
Omondo, so you should expect him to tell you that everything you want to
do is impossible unless you use Omondo, and then it will be simple. It's
best to ignore him.
Yu-Hsin Lin wrote:
> It seems that Papyrus uses Ecore and EMF for serialization. (I'm not
> sure.)
> Since it's impossible to get the XML schema of Papyrus, is it feasible
> to trace the source code of Ecore and EMF? (Java code?)
>
> Yu-Hsin
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.05476 seconds