XMI (XML Metadata Interchange)

XMI is a standard which defines how to serialise object instances. Although XML is a very good way to store information in a tree structured way, it is not object oriented. XMI extends XML to make it object oriented.

So XMI needs to define elements and attributes to hold the object instance in a standard way.

xmi object

Top Level Object

We can either include the root object in the body:

<xmi:XMI xmi:version="2.0" ...>
  <EuclideanSpace />
</xmi:XMI>

or with the version

<EuclideanSpace xmi:version="2.0" ...>

Identifying Objects

<EuclideanSpace xmi:id="_1" xmi:uuid="AB 123abcd" xmi:label="complex" / >

xmi:id

unique within document - used to specify relationships between objects.

xmi:uuid

globally unique (see DCE specification)

xmi:label

any other information

Attribute Values

Data Values

There are two forms for storing attribute values, we can store it in an attribute or an element.

attribute values

Reference Values

xmi refernce values

Again there are two forms for storing reference values.

xmi reference values

Using XMI to store UML Models

We can use XMI to store UML models. XMI is defined for storing object instances, however we can create instances of a meta model (possibly based on the Meta Object Facility (MOF) specification from the Object Management Group (OMG) ) .

The XMI schema also extends the XML schema so that definitions of objects can be stored. This provives a way to hold a UML model.

XMI Tags

XMI Tag  
xmiName  
serialise  
element  
attribute  
enforceMaximumMultipicity  
enforceMinimumMultipicity  
form  
remoteOnly  
href  
includeNils  
defaultValue  
fixedValue  
nsURI  
nsPrefix  
useSchemaExtensions  
contentType  
ordered  

 

An Example of an XMI file

I created the following very simple java classes:

package xmiexample;

public class dimension {
	double x,y,z;
	public dimension(x1,y1,z1) {
		x=x1;
		y=y1;
		z=z1;
	}
	public double getX(){
		return x;
	}
	public double getY(){
		return y;
	}
	public double getZ(){
		return z;
	}
}
package xmiexample;
public class box {
	dimension size;
	String name;
	public box() {
	}
	public String getName(){
		return name;
	}
	public double getX(){
		return size.getX();
	}
}

I imported these source files into argo and saved as argo.zargo file, I then used winzip to extract Untitled_.xml which is shown here:

<?xml version="1.0" encoding="UTF-8"?>
<XMI xmi.version="1.0">
<XMI.header>
<XMI.documentation>
<XMI.exporter>Novosoft UML Library</XMI.exporter>
<XMI.exporterVersion>0.4.19</XMI.exporterVersion>
</XMI.documentation>
<XMI.metamodel xmi.name="UML" xmi.version="1.3"/>
</XMI.header>
<XMI.content>
<Model_Management.Model xmi.id="xmi.1" xmi.uuid="127-0-0-1-4e9851:f08037e656:-8000">
<Foundation.Core.ModelElement.name>untitledModel</Foundation.Core.ModelElement.name>
<Foundation.Core.ModelElement.isSpecification xmi.value="false"/>
<Foundation.Core.GeneralizableElement.isRoot xmi.value="false"/>
<Foundation.Core.GeneralizableElement.isLeaf xmi.value="false"/>
<Foundation.Core.GeneralizableElement.isAbstract xmi.value="false"/>
<Foundation.Core.Namespace.ownedElement>
<Model_Management.Package xmi.id="xmi.2" xmi.uuid="java">
<Foundation.Core.ModelElement.name>java</Foundation.Core.ModelElement.name>
<Foundation.Core.ModelElement.isSpecification xmi.value="false"/>
<Foundation.Core.GeneralizableElement.isRoot xmi.value="false"/>
<Foundation.Core.GeneralizableElement.isLeaf xmi.value="false"/>
<Foundation.Core.GeneralizableElement.isAbstract xmi.value="false"/>
<Foundation.Core.ModelElement.namespace>
<Foundation.Core.Namespace xmi.idref="xmi.1"/>
</Foundation.Core.ModelElement.namespace>
<Foundation.Core.Namespace.ownedElement>
<Model_Management.Package xmi.id="xmi.3" xmi.uuid="java.lang">
<Foundation.Core.ModelElement.name>lang</Foundation.Core.ModelElement.name>
<Foundation.Core.ModelElement.isSpecification xmi.value="false"/>
<Foundation.Core.GeneralizableElement.isRoot xmi.value="false"/>
<Foundation.Core.GeneralizableElement.isLeaf xmi.value="false"/>
<Foundation.Core.GeneralizableElement.isAbstract xmi.value="false"/>
<Foundation.Core.ModelElement.namespace>
<Foundation.Core.Namespace xmi.idref="xmi.2"/>
</Foundation.Core.ModelElement.namespace>
<Foundation.Core.Namespace.ownedElement>
<Foundation.Core.Class xmi.id="xmi.4">
<Foundation.Core.ModelElement.name>String</Foundation.Core.ModelElement.name>
<Foundation.Core.ModelElement.isSpecification xmi.value="false"/>
<Foundation.Core.GeneralizableElement.isRoot xmi.value="false"/>
<Foundation.Core.GeneralizableElement.isLeaf xmi.value="false"/>
<Foundation.Core.GeneralizableElement.isAbstract xmi.value="false"/>
<Foundation.Core.Class.isActive xmi.value="false"/>
<Foundation.Core.ModelElement.namespace>
<Foundation.Core.Namespace xmi.idref="xmi.3"/>
</Foundation.Core.ModelElement.namespace>
</Foundation.Core.Class>
</Foundation.Core.Namespace.ownedElement>
</Model_Management.Package>
</Foundation.Core.Namespace.ownedElement>
</Model_Management.Package>
<Model_Management.Package xmi.id="xmi.5" xmi.uuid="xmiexample">
<Foundation.Core.ModelElement.name>xmiexample</Foundation.Core.ModelElement.name>
<Foundation.Core.ModelElement.isSpecification xmi.value="false"/>
<Foundation.Core.GeneralizableElement.isRoot xmi.value="false"/>
<Foundation.Core.GeneralizableElement.isLeaf xmi.value="false"/>
<Foundation.Core.GeneralizableElement.isAbstract xmi.value="false"/>
<Foundation.Core.ModelElement.namespace>
<Foundation.Core.Namespace xmi.idref="xmi.1"/>
</Foundation.Core.ModelElement.namespace>
<Foundation.Core.Namespace.ownedElement>
<Foundation.Core.Class xmi.id="xmi.6" xmi.uuid="127-0-0-1-4e9851:f08037e656:-7fff">
<Foundation.Core.ModelElement.name>box</Foundation.Core.ModelElement.name>
<Foundation.Core.ModelElement.visibility xmi.value="public"/>
<Foundation.Core.ModelElement.isSpecification xmi.value="false"/>
<Foundation.Core.GeneralizableElement.isRoot xmi.value="false"/>
<Foundation.Core.GeneralizableElement.isLeaf xmi.value="false"/>
<Foundation.Core.GeneralizableElement.isAbstract xmi.value="false"/>
<Foundation.Core.Class.isActive xmi.value="false"/>
<Foundation.Core.ModelElement.namespace>
<Foundation.Core.Namespace xmi.idref="xmi.5"/>
</Foundation.Core.ModelElement.namespace>
<Foundation.Core.Classifier.feature>
<Foundation.Core.Attribute xmi.id="xmi.7">
<Foundation.Core.ModelElement.name>name</Foundation.Core.ModelElement.name>
<Foundation.Core.ModelElement.isSpecification xmi.value="false"/>
<Foundation.Core.Feature.ownerScope xmi.value="instance"/>
<Foundation.Core.StructuralFeature.multiplicity>
<Foundation.Data_Types.Multiplicity xmi.id="xmi.8">
<Foundation.Data_Types.Multiplicity.range>
<Foundation.Data_Types.MultiplicityRange xmi.id="xmi.9">
<Foundation.Data_Types.MultiplicityRange.lower>1</Foundation.Data_Types.MultiplicityRange.lower>
<Foundation.Data_Types.MultiplicityRange.upper>1</Foundation.Data_Types.MultiplicityRange.upper>
</Foundation.Data_Types.MultiplicityRange>
</Foundation.Data_Types.Multiplicity.range>
</Foundation.Data_Types.Multiplicity>
</Foundation.Core.StructuralFeature.multiplicity>
<Foundation.Core.StructuralFeature.changeability xmi.value="changeable"/>
<Foundation.Core.Feature.owner>
<Foundation.Core.Classifier xmi.idref="xmi.6"/>
</Foundation.Core.Feature.owner>
<Foundation.Core.StructuralFeature.type>
<Foundation.Core.Classifier xmi.idref="xmi.4"/>
</Foundation.Core.StructuralFeature.type>
</Foundation.Core.Attribute>
<Foundation.Core.Operation xmi.id="xmi.10">
<Foundation.Core.ModelElement.name>box</Foundation.Core.ModelElement.name>
<Foundation.Core.ModelElement.visibility xmi.value="public"/>
<Foundation.Core.ModelElement.isSpecification xmi.value="false"/>
<Foundation.Core.Feature.ownerScope xmi.value="instance"/>
<Foundation.Core.BehavioralFeature.isQuery xmi.value="false"/>
<Foundation.Core.Operation.isRoot xmi.value="false"/>
<Foundation.Core.Operation.isLeaf xmi.value="false"/>
<Foundation.Core.Operation.isAbstract xmi.value="false"/>
<Foundation.Core.Feature.owner>
<Foundation.Core.Classifier xmi.idref="xmi.6"/>
</Foundation.Core.Feature.owner>
</Foundation.Core.Operation>
<Foundation.Core.Operation xmi.id="xmi.11">
<Foundation.Core.ModelElement.name>getName</Foundation.Core.ModelElement.name>
<Foundation.Core.ModelElement.visibility xmi.value="public"/>
<Foundation.Core.ModelElement.isSpecification xmi.value="false"/>
<Foundation.Core.Feature.ownerScope xmi.value="instance"/>
<Foundation.Core.BehavioralFeature.isQuery xmi.value="false"/>
<Foundation.Core.Operation.isRoot xmi.value="false"/>
<Foundation.Core.Operation.isLeaf xmi.value="false"/>
<Foundation.Core.Operation.isAbstract xmi.value="false"/>
<Foundation.Core.Feature.owner>
<Foundation.Core.Classifier xmi.idref="xmi.6"/>
</Foundation.Core.Feature.owner>
<Foundation.Core.Operation.method>
<Foundation.Core.Method xmi.idref="xmi.12"/>
</Foundation.Core.Operation.method>
<Foundation.Core.BehavioralFeature.parameter>
<Foundation.Core.Parameter xmi.id="xmi.13">
<Foundation.Core.ModelElement.name>return</Foundation.Core.ModelElement.name>
<Foundation.Core.ModelElement.isSpecification xmi.value="false"/>
<Foundation.Core.Parameter.kind xmi.value="return"/>
<Foundation.Core.Parameter.behavioralFeature>
<Foundation.Core.BehavioralFeature xmi.idref="xmi.11"/>
</Foundation.Core.Parameter.behavioralFeature>
<Foundation.Core.Parameter.type>
<Foundation.Core.Classifier xmi.idref="xmi.4"/>
</Foundation.Core.Parameter.type>
</Foundation.Core.Parameter>
</Foundation.Core.BehavioralFeature.parameter>
</Foundation.Core.Operation>
<Foundation.Core.Operation xmi.id="xmi.14">
<Foundation.Core.ModelElement.name>getX</Foundation.Core.ModelElement.name>
<Foundation.Core.ModelElement.visibility xmi.value="public"/>
<Foundation.Core.ModelElement.isSpecification xmi.value="false"/>
<Foundation.Core.Feature.ownerScope xmi.value="instance"/>
<Foundation.Core.BehavioralFeature.isQuery xmi.value="false"/>
<Foundation.Core.Operation.isRoot xmi.value="false"/>
<Foundation.Core.Operation.isLeaf xmi.value="false"/>
<Foundation.Core.Operation.isAbstract xmi.value="false"/>
<Foundation.Core.Feature.owner>
<Foundation.Core.Classifier xmi.idref="xmi.6"/>
</Foundation.Core.Feature.owner>
<Foundation.Core.Operation.method>
<Foundation.Core.Method xmi.idref="xmi.15"/>
</Foundation.Core.Operation.method>
<Foundation.Core.BehavioralFeature.parameter>
<Foundation.Core.Parameter xmi.id="xmi.16">
<Foundation.Core.ModelElement.name>return</Foundation.Core.ModelElement.name>
<Foundation.Core.ModelElement.isSpecification xmi.value="false"/>
<Foundation.Core.Parameter.kind xmi.value="return"/>
<Foundation.Core.Parameter.behavioralFeature>
<Foundation.Core.BehavioralFeature xmi.idref="xmi.14"/>
</Foundation.Core.Parameter.behavioralFeature>
<Foundation.Core.Parameter.type>
<Foundation.Core.Classifier xmi.idref="xmi.17"/>
</Foundation.Core.Parameter.type>
</Foundation.Core.Parameter>
</Foundation.Core.BehavioralFeature.parameter>
</Foundation.Core.Operation>
<Foundation.Core.Attribute xmi.id="xmi.18">
<Foundation.Core.ModelElement.name>size</Foundation.Core.ModelElement.name>
<Foundation.Core.ModelElement.isSpecification xmi.value="false"/>
<Foundation.Core.Feature.ownerScope xmi.value="instance"/>
<Foundation.Core.StructuralFeature.multiplicity>
<Foundation.Data_Types.Multiplicity xmi.idref="xmi.8"/>
</Foundation.Core.StructuralFeature.multiplicity>
<Foundation.Core.StructuralFeature.changeability xmi.value="changeable"/>
<Foundation.Core.Feature.owner>
<Foundation.Core.Classifier xmi.idref="xmi.6"/>
</Foundation.Core.Feature.owner>
<Foundation.Core.StructuralFeature.type>
<Foundation.Core.Classifier xmi.idref="xmi.19"/>
</Foundation.Core.StructuralFeature.type>
</Foundation.Core.Attribute>
<Foundation.Core.Method xmi.id="xmi.12">
<Foundation.Core.ModelElement.name>getName</Foundation.Core.ModelElement.name>
<Foundation.Core.ModelElement.visibility xmi.value="public"/>
<Foundation.Core.ModelElement.isSpecification xmi.value="false"/>
<Foundation.Core.Feature.ownerScope xmi.value="instance"/>
<Foundation.Core.BehavioralFeature.isQuery xmi.value="false"/>
<Foundation.Core.Method.body>
<Foundation.Data_Types.ProcedureExpression xmi.id="xmi.20">
<Foundation.Data_Types.Expression.language>Java</Foundation.Data_Types.Expression.language>
<Foundation.Data_Types.Expression.body>
return name;</Foundation.Data_Types.Expression.body>
</Foundation.Data_Types.ProcedureExpression>
</Foundation.Core.Method.body>
<Foundation.Core.Feature.owner>
<Foundation.Core.Classifier xmi.idref="xmi.6"/>
</Foundation.Core.Feature.owner>
<Foundation.Core.Method.specification>
<Foundation.Core.Operation xmi.idref="xmi.11"/>
</Foundation.Core.Method.specification>
</Foundation.Core.Method>
<Foundation.Core.Method xmi.id="xmi.15">
<Foundation.Core.ModelElement.name>getX</Foundation.Core.ModelElement.name>
<Foundation.Core.ModelElement.visibility xmi.value="public"/>
<Foundation.Core.ModelElement.isSpecification xmi.value="false"/>
<Foundation.Core.Feature.ownerScope xmi.value="instance"/>
<Foundation.Core.BehavioralFeature.isQuery xmi.value="false"/>
<Foundation.Core.Method.body>
<Foundation.Data_Types.ProcedureExpression xmi.id="xmi.21">
<Foundation.Data_Types.Expression.language>Java</Foundation.Data_Types.Expression.language>
<Foundation.Data_Types.Expression.body>
return size.getX();</Foundation.Data_Types.Expression.body>
</Foundation.Data_Types.ProcedureExpression>
</Foundation.Core.Method.body>
<Foundation.Core.Feature.owner>
<Foundation.Core.Classifier xmi.idref="xmi.6"/>
</Foundation.Core.Feature.owner>
<Foundation.Core.Method.specification>
<Foundation.Core.Operation xmi.idref="xmi.14"/>
</Foundation.Core.Method.specification>
</Foundation.Core.Method>
</Foundation.Core.Classifier.feature>
</Foundation.Core.Class>
<Foundation.Core.Class xmi.id="xmi.19">
<Foundation.Core.ModelElement.name>dimension</Foundation.Core.ModelElement.name>
<Foundation.Core.ModelElement.visibility xmi.value="public"/>
<Foundation.Core.ModelElement.isSpecification xmi.value="false"/>
<Foundation.Core.GeneralizableElement.isRoot xmi.value="false"/>
<Foundation.Core.GeneralizableElement.isLeaf xmi.value="false"/>
<Foundation.Core.GeneralizableElement.isAbstract xmi.value="false"/>
<Foundation.Core.Class.isActive xmi.value="false"/>
<Foundation.Core.ModelElement.namespace>
<Foundation.Core.Namespace xmi.idref="xmi.5"/>
</Foundation.Core.ModelElement.namespace>
<Foundation.Core.Classifier.feature>
<Foundation.Core.Attribute xmi.id="xmi.22">
<Foundation.Core.ModelElement.name>x</Foundation.Core.ModelElement.name>
<Foundation.Core.ModelElement.isSpecification xmi.value="false"/>
<Foundation.Core.Feature.ownerScope xmi.value="instance"/>
<Foundation.Core.StructuralFeature.multiplicity>
<Foundation.Data_Types.Multiplicity xmi.idref="xmi.8"/>
</Foundation.Core.StructuralFeature.multiplicity>
<Foundation.Core.StructuralFeature.changeability xmi.value="changeable"/>
<Foundation.Core.Feature.owner>
<Foundation.Core.Classifier xmi.idref="xmi.19"/>
</Foundation.Core.Feature.owner>
<Foundation.Core.StructuralFeature.type>
<Foundation.Core.Classifier xmi.idref="xmi.17"/>
</Foundation.Core.StructuralFeature.type>
</Foundation.Core.Attribute>
<Foundation.Core.Attribute xmi.id="xmi.23">
<Foundation.Core.ModelElement.name>y</Foundation.Core.ModelElement.name>
<Foundation.Core.ModelElement.isSpecification xmi.value="false"/>
<Foundation.Core.Feature.ownerScope xmi.value="instance"/>
<Foundation.Core.StructuralFeature.multiplicity>
<Foundation.Data_Types.Multiplicity xmi.idref="xmi.8"/>
</Foundation.Core.StructuralFeature.multiplicity>
<Foundation.Core.StructuralFeature.changeability xmi.value="changeable"/>
<Foundation.Core.Feature.owner>
<Foundation.Core.Classifier xmi.idref="xmi.19"/>
</Foundation.Core.Feature.owner>
<Foundation.Core.StructuralFeature.type>
<Foundation.Core.Classifier xmi.idref="xmi.17"/>
</Foundation.Core.StructuralFeature.type>
</Foundation.Core.Attribute>
<Foundation.Core.Attribute xmi.id="xmi.24">
<Foundation.Core.ModelElement.name>z</Foundation.Core.ModelElement.name>
<Foundation.Core.ModelElement.isSpecification xmi.value="false"/>
<Foundation.Core.Feature.ownerScope xmi.value="instance"/>
<Foundation.Core.StructuralFeature.multiplicity>
<Foundation.Data_Types.Multiplicity xmi.idref="xmi.8"/>
</Foundation.Core.StructuralFeature.multiplicity>
<Foundation.Core.StructuralFeature.changeability xmi.value="changeable"/>
<Foundation.Core.Feature.owner>
<Foundation.Core.Classifier xmi.idref="xmi.19"/>
</Foundation.Core.Feature.owner>
<Foundation.Core.StructuralFeature.type>
<Foundation.Core.Classifier xmi.idref="xmi.17"/>
</Foundation.Core.StructuralFeature.type>
</Foundation.Core.Attribute>
</Foundation.Core.Classifier.feature>
</Foundation.Core.Class>
</Foundation.Core.Namespace.ownedElement>
</Model_Management.Package>
<Foundation.Extension_Mechanisms.Stereotype xmi.id="xmi.25">
<Foundation.Core.ModelElement.name>create</Foundation.Core.ModelElement.name>
<Foundation.Core.ModelElement.isSpecification xmi.value="false"/>
<Foundation.Core.GeneralizableElement.isRoot xmi.value="false"/>
<Foundation.Core.GeneralizableElement.isLeaf xmi.value="false"/>
<Foundation.Core.GeneralizableElement.isAbstract xmi.value="false"/>
<Foundation.Core.ModelElement.namespace>
<Foundation.Core.Namespace xmi.idref="xmi.1"/>
</Foundation.Core.ModelElement.namespace>
<Foundation.Extension_Mechanisms.Stereotype.extendedElement>
<Foundation.Core.ModelElement xmi.idref="xmi.10"/>
</Foundation.Extension_Mechanisms.Stereotype.extendedElement>
</Foundation.Extension_Mechanisms.Stereotype>
<Foundation.Core.DataType xmi.id="xmi.17">
<Foundation.Core.ModelElement.name>double</Foundation.Core.ModelElement.name>
<Foundation.Core.ModelElement.isSpecification xmi.value="false"/>
<Foundation.Core.GeneralizableElement.isRoot xmi.value="false"/>
<Foundation.Core.GeneralizableElement.isLeaf xmi.value="false"/>
<Foundation.Core.GeneralizableElement.isAbstract xmi.value="false"/>
<Foundation.Core.ModelElement.namespace>
<Foundation.Core.Namespace xmi.idref="xmi.1"/>
</Foundation.Core.ModelElement.namespace>
</Foundation.Core.DataType>
</Foundation.Core.Namespace.ownedElement>
</Model_Management.Model>
</XMI.content>
</XMI>


metadata block
see also:

 

Correspondence about this page

This site may have errors. Don't use for critical systems.

Copyright (c) 1998-2023 Martin John Baker - All rights reserved - privacy policy.