logo back up home forward   further reading more topics »

XMI (XML Metadata Interchange)

  1. XMI
    1. JMI

XMI provides a way to store instances of objects to an XML document, this allows objects to be serialised. XML is not object oriented, so XMI needs to define elements and attributes to hold the object in a standard way.

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.

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

Book Shop - Further reading.

Where I can, I have put links to Amazon for books that are relevant to the subject, click on the appropriate country flag to get more details of the book or to buy it from them.

cover Mastering XMI - I found this book a bit heavy going, it seems to spend a lot of time talking about the importance of standards, introducing XML, UML and OMG. However I found it hard to pick up the essence of XMI, why is it important and how does it work. The book concentrates a lot on IBM programs such as WebSphere, XML4J and XMI framework (not much on JMI) as you would expect from a book written by IBMers.

Uml Power Tools:Building Uml Add-Ons...

Commercial Software Shop

Where I can, I have put links to Amazon for commercial software, not directly related to this site, but related to the subject being discussed, click on the appropriate country flag to get more details of the software or to buy it from them.

 

Can this page be improved?

Please send me any improvements to here. I would appreciate ideas to make the pages more useful including error correction, ideas for new pages, improvements to wording. It helps if you quote the full URL of the page.

 

progam

I am working on a project which uses these principles, if you would like to help me with this you are welcome to join in, here:

for kontent: http://sourceforge.net/projects/kontent/

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

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