XML Metadata Interchange. Appendices. [Samples]


XML Metadata Interchange. Appendices. Proposal to the OMG OA&DTF RFP 3: Stream-based Model Interchange Format (SMIF). Reference: OMG Document ad/98-07-03, July 6, 1998. This document (90 pages) represents three appendices. Appendix A provides the UML 1.1 DTD (a DTD generated by hand that represents the UML metamodel). Appendix B contains a DTD generated by hand that represents the MOF model which is described in Section 3 MOF Model and Interfaces of the MOF 1.1 specification. The third Appendix provides two extremely simple UML models and their resultant XML encoding. The first is an example of a model containing a class which contains an attribute. It is encoded in XMI using the UML DTD. The second is a Business Model - developed as the source for a simple XML document produced according to XMI. The XML resulting from this model is shown. The document OMG Document ad/98-07-03 is available in Postscript and PDF formats.

See the main database entry: XML Metadata Interchange Format (XMI) Open Management Group (OMG).



C.2 Model1 Model

<?xml version="1.0"?>
<!DOCTYPE XMI SYSTEM "uml.dtd">
<XMI xmi-version="1.0">
<XMI.header>
<XMI.metamodel name="uml" version="1.1" />
</XMI.header>
<XMI.content>
<Model XMI.id="i00000001">
<name>model1</name>
<visibility XMI.value="public"/>
<isAbstract XMI.value="false"/>
<isLeaf XMI.value="true"/>
<isRoot XMI.value="true"/>
<ownedElement>
<Class XMI.id="i00000002">
<name>class1</name>
<visibility XMI.value="public"/>
<isAbstract XMI.value="false"/>
<isLeaf XMI.value="true"/>
<isRoot XMI.value="true"/>
<isActive XMI.value="true"/>
<feature>
<Attribute XMI.id="i00000003">
<name>attribute1</name>
<visibility XMI.value="public"/>
<ownerScope XMI.value="classifier"/>
<changeable XMI.value="none"/>
<multiplicity>1</multiplicity>
<initialValue>0</initialValue>
<owner>
<XMI.reference href="|i00000002" expected-Type="class1"/>
</owner>
<type>integer</type>
</Attribute>
</feature>
</Class>
</ownedElement>
</Model>
</XMI.content>
</XMI>



Figure C-2 Simple UML Model Business

<?XML version = "1.0"?>
<!DOCTYPE System SYSTEM "file:unisys-uml.dtd">
<System elementVisibility = 'public' InventedStart= '{' InventedEnd = '}' id = 'G.6'>
<!-- name: {Rose 98 System} -->
<Model elementVisibility = 'public' id = 'G.1'>
<name>BusinessModel</name>
<Enumeration elementVisibility = 'public' id = 'G.7'>
<name>boolean</name>
<EnumerationLiteral>
<name>false</name>
</EnumerationLiteral>
<EnumerationLiteral>
<name>true</name>
</EnumerationLiteral>
</Enumeration>
<DataType elementVisibility = 'public' id = 'G.8'>
<name>byte</name>
</DataType>
<DataType elementVisibility = 'public' id = 'G.9'>
<name>currency</name>
</DataType>
<DataType elementVisibility = 'public' id = 'G.10'>
<name>date</name>
</DataType>
<DataType elementVisibility = 'public' id = 'G.11'>
<name>double</name>
</DataType>
<DataType elementVisibility = 'public' id = 'G.12'>
<name>integer</name>
</DataType>
<DataType elementVisibility = 'public' id = 'G.13'>
<name>long</name>
</DataType>
<DataType elementVisibility = 'public' id = 'G.14'>
<name>object</name>
</DataType>
<DataType elementVisibility = 'public' id = 'G.15'>
<name>single</name>
</DataType>
<DataType elementVisibility = 'public' id = 'G.16'>
<name>string</name>
</DataType>
<DataType elementVisibility = 'public' id = 'G.17'>
<name>variant</name>
</DataType>
<Package id = 'S.10006'>
<name>Business</name>
</Package>
<Class id = 'S.10001'>
<name>Customer</name>
<isAbstract Boolean = 'false'/>
<isLeaf Boolean = 'true'/>
<isRoot Boolean = 'true'/>
<associationEndRef reference = 'G.5'/> <!-- holder{359BFCB10337} -->
<feature>
<Attribute id = 'S.10002' elementVisibility = 'private'>
<name>customerId</name>
<ownerScope ScopeKind = 'instance'/>
<type reference = 'G.16'/> <!-- string -->
</Attribute>
</feature>
</Class>
<Class id = 'S.10003'>
<name>Account</name>
<isAbstract Boolean = 'false'/>
<isLeaf Boolean = 'true'/>
<isRoot Boolean = 'true'/>
<associationEndRef reference = 'G.4'/> <!-- currentAccount{359BFCB1032D} -->
<feature>
<Attribute id = 'S.10004' elementVisibility = 'private'>
<name>accountNumber</name>
<ownerScope ScopeKind = 'instance'/>
<type reference = 'S.10005'/> <!-- AccNumType -->
</Attribute>
</feature>
</Class>
<Class id = 'S.10005'>
<name>AccNumType</name>
<stereotypeRef reference = 'G.2'/> <!-- DataType -->
<isAbstract Boolean = 'false'/>
<isLeaf Boolean = 'true'/>
<isRoot Boolean = 'true'/>
</Class>
<Association id = 'G.3'>
<name>Maintains{359BFCAF0302}</name>
<connection>
<AssociationEnd id = 'G.4'>
<name>currentAccount{359BFCB1032D}</name>
<multiplicity>1..*</multiplicity>
<endpointType reference = 'S.10003'/> <!-- Logical View::Account -->
<isNavigable Boolean = 'true'/>
<aggregation AggregationKind = 'none'/>
</AssociationEnd>
<AssociationEnd id = 'G.5'>
<name>holder{359BFCB10337}</name>
<multiplicity>1..1</multiplicity>
<endpointType reference = 'S.10001'/> <!-- Logical View::Customer -->
<isNavigable Boolean = 'false'/>
<aggregation AggregationKind = 'none'/>
</AssociationEnd>
</connection>
</Association>
<Stereotype id = 'G.2'>
<name>DataType</name>
<baseClass>Class</baseClass>
<extendedElement reference = 'S.10005'/>
</Stereotype>
</Model>
</System>