Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » what is the root for all UML models?
icon5.gif  what is the root for all UML models? [message #1065278] Tue, 25 June 2013 08:28 Go to next message
Félix SILINOU KAMDEM is currently offline Félix SILINOU KAMDEM
Messages: 96
Registered: April 2013
Member
Hello,

what is the root for all UML models?

[Updated on: Tue, 25 June 2013 09:25]

Report message to a moderator

Re: what is the root for all UML models? [message #1065427 is a reply to message #1065278] Tue, 25 June 2013 16:29 Go to previous messageGo to next message
Rafael Chaves is currently offline Rafael Chaves
Messages: 161
Registered: July 2009
Senior Member
It could be uml:Package or uml:Model or uml:Profile, depending on the kind of top level package it has.

The serialization format is a different question: if your model has no stereotypes applied, it will be uml:Package, uml:Model etc:

<?xml version="1.0" encoding="UTF-8"?>
<uml:Package xmlns:uml="http://www.eclipse.org/uml2/4.0.0/UML" xmlns:xmi="http://www.omg.org/spec/XMI/20110701" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmi:version="20110701" xmi:id="_0" name="customers" URI="I-sandbox-test/customers">
   <packageImport xmi:id="_packageImport.0" />
   <packagedElement xmi:type="uml:Class" xmi:id="Customer" name="Customer">
   </packagedElement>
   <profileApplication xmi:id="_profileApplication.0">
      <eAnnotations xmi:id="_profileApplication.0-_http2F2Fwww.eclipse.org2Fuml22F2.0.02FUML" source="http://www.eclipse.org/uml2/2.0.0/UML">
         <references xmi:type="ecore:EPackage" href="platform:/plugin/com.abstratt.kirra.mdd.core/models/kirra.uml#_http2F2Fwww.eclipse.org2Fuml22F2.0.02FUML-kirra" />
      </eAnnotations>
      <appliedProfile href="platform:/plugin/com.abstratt.kirra.mdd.core/models/kirra.uml#_0" />
   </profileApplication>
</uml:Package>



If it has stereotypes applied, then the stereotype applications will be top-level as well, and since XML admits only one root element, a xmi:XMI element becomes the XML root element, to wrap the proper root elements:

<?xml version="1.0" encoding="UTF-8"?>
<xmi:XMI xmlns:xmi="http://www.omg.org/spec/XMI/20110701" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:kirra="models/kirra" xmlns:uml="http://www.eclipse.org/uml2/4.0.0/UML" xmi:version="20110701" xsi:schemaLocation="models/kirra platform:/plugin/com.abstratt.kirra.mdd.core/models/kirra.uml#_http2F2Fwww.eclipse.org2Fuml22F2.0.02FUML-kirra">
   <uml:Package xmi:id="_0" name="customers" URI="I-sandbox-test/customers">
      <packageImport xmi:id="_packageImport.0" />
      <packagedElement xmi:type="uml:Class" xmi:id="Customer" name="Customer">
      </packagedElement>
      <profileApplication xmi:id="_profileApplication.0">
         <eAnnotations xmi:id="_profileApplication.0-_http2F2Fwww.eclipse.org2Fuml22F2.0.02FUML" source="http://www.eclipse.org/uml2/2.0.0/UML">
            <references xmi:type="ecore:EPackage" href="platform:/plugin/com.abstratt.kirra.mdd.core/models/kirra.uml#_http2F2Fwww.eclipse.org2Fuml22F2.0.02FUML-kirra" />
         </eAnnotations>
         <appliedProfile href="platform:/plugin/com.abstratt.kirra.mdd.core/models/kirra.uml#_0" />
      </profileApplication>
   </uml:Package>
   <kirra:Entity xmi:id="_1" base_Class="Customer" />
</xmi:XMI>


I am not 100% positive, but it may be possible to serialize multiple top-level packages in a file, and that would require a root wrapper element as well.

Also, UML2 supports different serialization formats/versions of XMI that may behave differently.

Rafael
http://abstratt.com

[Updated on: Tue, 25 June 2013 16:35]

Report message to a moderator

Re: what is the root for all UML models? [message #1065435 is a reply to message #1065427] Tue, 25 June 2013 16:45 Go to previous message
Félix SILINOU KAMDEM is currently offline Félix SILINOU KAMDEM
Messages: 96
Registered: April 2013
Member
In my case it's UML:Model.

Thank you for all.
Previous Topic:How to get "tagged values" from an attribute of class in UML2.0
Next Topic:Reference beetween Package and class
Goto Forum:
  


Current Time: Wed Oct 01 22:39:59 GMT 2014

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

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