XML Metadata Interchange
XML Metadata Interchange (XMI) is an open standard developed and maintained by the Object Management Group (OMG) for representing, exchanging, and integrating metadata information using Extensible Markup Language (XML) syntax.[1] It enables the serialization of object models into XML documents and the deserialization back into model representations, facilitating seamless interoperability among diverse modeling tools, repositories, application development environments, and data warehouses.[1] Primarily designed for metadata derived from metamodels in the Meta-Object Facility (MOF) and models in the Unified Modeling Language (UML), XMI supports the interchange of structured information in fields such as software engineering and model-driven architecture.[2] The specification originated from an OMG request for proposals in the late 1990s to address the lack of a common format for metadata exchange in object technology.[3] Version 1.0 was adopted in February 1999, introducing foundational rules for XML serialization of MOF-based models.[3] Over time, XMI evolved to incorporate XML Schema support, enhanced serialization mechanisms, and alignment with MOF 2.0, with key releases including version 2.0 in May 2003, version 2.1 in December 2007, version 2.4.2 in March 2014, and the current version 2.5.1 in June 2015.[4] These updates have standardized aspects such as the representation of objects via XML elements and attributes, linkage mechanisms, and validation through canonical schemas like XMI-Canonical.xsd.[4] XMI's core features include automated generation of XML schemas from MOF metamodels, handling of model extensions and differences (such as additions, deletions, and replacements), and provisions for tool-specific annotations without compromising interchangeability.[2] Widely adopted in model-driven engineering, it underpins the export and import of UML diagrams, class models, and other artifacts in tools from vendors like IBM and Eclipse, promoting collaborative development and integration across platforms.[5] The standard has also been formalized internationally, with versions aligned to ISO/IEC 19503:2005 for XMI 2.0 and ISO/IEC 19509:2014 for subsequent iterations, ensuring global consistency in metadata handling.[6]Introduction
Definition and Purpose
XML Metadata Interchange (XMI) is a standard developed by the Object Management Group (OMG) for representing and exchanging metadata information using Extensible Markup Language (XML).[7] As an open specification, it provides a mechanism to serialize metadata models into XML documents that can be readily parsed and processed by diverse software tools.[7] The primary purpose of XMI is to enable the serialization, interchange, and storage of metadata models—particularly those defined by the Meta-Object Facility (MOF)—between different applications without loss of semantic information.[7] By defining rules for mapping MOF-based metamodels to XML structures, XMI ensures that tools can consistently share and interpret metadata, such as model elements, relationships, and attributes, in a platform-independent manner.[7] The Meta-Object Facility (MOF) serves as the foundational metamodeling language underlying XMI's approach.[7] XMI's scope encompasses any metadata whose metamodel can be expressed in MOF, making it applicable to a range of domains including UML models for software design, enterprise architectures for business process modeling, and data warehouse metadata via the Common Warehouse Metamodel (CWM).[7] This broad applicability supports interoperability in model-driven engineering environments where precise metadata exchange is essential.[7] XMI was formalized in the late 1990s to address the growing need for a vendor-neutral format in object-oriented modeling, allowing disparate tools to collaborate on complex metadata without proprietary constraints.[8] Early adoption focused on bridging UML-based tools, reflecting the era's emphasis on standardized object technologies within the OMG ecosystem.[8]Key Features
XML Metadata Interchange (XMI) leverages XML as its foundational format to represent metadata, utilizing XML elements and attributes to encode model elements, links, and properties in a structured manner.[9] This approach allows for the serialization of complex relationships and hierarchies inherent in metamodels, ensuring that data such as classes, associations, and attributes are captured precisely within XML documents.[10] By defining specific XML schemas, XMI facilitates the validation and parsing of these representations, promoting consistency across different systems.[11] A core aspect of XMI is its compliance with the Meta-Object Facility (MOF), which establishes a four-layer metamodel architecture.[12] In this structure, the M3 layer consists of the MOF itself as the meta-metamodel; the M2 layer includes metamodels such as UML; the M1 layer represents user-defined models; and the M0 layer captures the actual data instances.[13] This layered compliance enables XMI to handle metadata at varying abstraction levels, ensuring that serialized content aligns with MOF's self-describing nature and supports the interchange of models derived from MOF-compliant languages.[14] XMI provides robust interchange capabilities, allowing for the complete export and import of models between tools and repositories.[7] These mechanisms extend to visual representations through the Diagram Interchange (DI) extension, which integrates with XMI to serialize diagram layouts, nodes, and edges alongside structural model data. This facilitates seamless transfer of both semantic and graphical information, particularly in UML-based modeling environments where XMI serves as a primary format for model exchange.[15] The extensibility of XMI is achieved through the generation of custom XML schemas directly from MOF metamodels, permitting adaptations for specific domains while maintaining compatibility.[16] These schemas can incorporate extensions for additional properties or constraints, supporting forward compatibility as metamodels evolve without breaking existing implementations.[11] Such flexibility ensures that XMI remains adaptable to new metadata requirements derived from MOF. XMI version 1.1 and subsequent versions introduced enhancements for improved readability, including support for XML namespaces and streamlined serialization rules that reduce verbosity and document size.[14] These changes make the resulting XML more concise and human-interpretable, facilitating easier debugging and manual review compared to earlier iterations.[17]Development and Standards
Historical Evolution
The origins of XML Metadata Interchange (XMI) trace back to the late 1990s, when the Object Management Group (OMG) issued a Request for Proposals (RFP) for a standardized metadata interchange format in December 1997 to address the need for exchanging models between UML-based tools and MOF-compliant repositories.[18] Initial submissions, including the XMI proposal, were received in July 1998, followed by revisions in October 1998 and proof-of-concept demonstrations in November 1998.[18] The specification was adopted as XMI 1.0 by the OMG in February 1999, specifically to support model interchange requirements arising from UML 1.1, enabling the serialization of UML models using XML Document Type Definitions (DTDs).[19] This initial version focused on unifying UML, MOF, and XML for metadata management and publishing.[18] Early refinements to XMI addressed usability and alignment with evolving UML standards. XMI 1.1, adopted in June 2000, introduced improvements in DTD generation for better readability and incorporated XML namespaces, which were not available during the development of version 1.0.[20] It also enhanced support for UML 1.3 models. XMI 1.2, released in April 2002, further aligned the format with UML 1.4, refining serialization rules and extending applicability to other MOF-based metamodels beyond just UML.[21] These versions maintained reliance on DTDs for validation while expanding interoperability in modeling toolchains. A major evolution occurred with XMI 2.0, adopted in May 2003, which shifted from DTDs to XML Schema for serialization, providing stronger validation capabilities and better integration with emerging XML technologies.[21] This change was driven by the maturation of XML Schema as a W3C recommendation and the need to support more complex metadata structures in UML 2.0 and MOF 2.0 environments.[21] Subsequent refinements focused on compatibility and enhancements for newer standards. XMI 2.1, adopted in September 2005, improved serialization mechanisms to better accommodate MOF 2.0 metamodels, including support for profiles and constraints.[22] XMI 2.1.1, released in December 2007, addressed minor issues such as namespace handling and backward compatibility with earlier versions.[23] More recent versions emphasized alignment with updated UML and diagram interchange needs. XMI 2.4, adopted in March 2011, incorporated support for UML 2.3, including enhancements for diagram definitions via the Diagram Interchange (DI) standard.[4] Incremental updates followed: XMI 2.4.1 in May 2013 and XMI 2.4.2 in March 2014, which refined XML Schema mappings and resolved interoperability issues in tool exchanges.[23][4] XMI 2.5.1, adopted in June 2015, added further alignment with UML 2.5 and MOF 2.5, emphasizing extensibility for domain-specific languages.[1] XMI's standardization extended to the international level with its adoption as ISO/IEC 19503 in November 2005, corresponding to version 2.0 and focusing on XML-based metadata exchange for lifecycle tools. A subsequent ISO standard, ISO/IEC 19509:2014, corresponds to XMI 2.4.2, ensuring global recognition for XMI in model-driven engineering practices.[24][25] As of 2025, XMI 2.5.1 remains the current version with no further major updates.[1]Relation to OMG Frameworks
XML Metadata Interchange (XMI) is fundamentally dependent on the Meta-Object Facility (MOF), an OMG standard that defines a four-layer metamodeling architecture, where XMI serializes models at the M2 (metamodel) and M1 (model instance) layers by leveraging MOF's abstract syntax to automatically generate corresponding XML schemas for validation and interchange.[7] XMI aligns closely with the Unified Modeling Language (UML), serving as the default interchange format for UML 2.x models and enabling seamless tool-to-tool exchange of UML diagrams and specifications through standardized XML representations.[7] Beyond UML, XMI integrates with other OMG specifications, such as the Common Warehouse Metamodel (CWM), where it facilitates the exchange of data warehouse metadata defined via MOF, and the Software Process Engineering Metamodel (SPEM), supporting the interchange of process models through dedicated XMI schemata aligned with SPEM's compliance points.[26][27] The evolution of XMI in its 2.x versions mirrors advancements in MOF 2.0 and later, incorporating support for UML profiles and constraints via extension tags that enhance model expressiveness and interoperability within the OMG ecosystem.[7] Within the Model-Driven Architecture (MDA), XMI plays a pivotal role by providing an XML-based mechanism for transforming platform-independent models (PIMs) into platform-specific models (PSMs), thereby promoting standardized metadata exchange across development lifecycles.[7]Technical Framework
Core Architecture
The core architecture of XML Metadata Interchange (XMI) is built upon the Meta Object Facility (MOF) metamodeling framework, which establishes a standardized approach for representing and interchanging metadata across different abstraction levels.[28] This architecture enables the serialization of models defined in MOF-compliant metamodels into XML documents, ensuring consistency and interoperability in metadata exchange.[7] Central to XMI's design is the four-layer metamodel hierarchy derived from MOF. The top layer, M3, consists of the meta-metamodel, which is the MOF model itself and defines the language for specifying metamodels.[28] The M2 layer contains domain-specific metamodels, such as UML, that specify the structure and semantics of models in a particular modeling domain.[28] At the M1 layer, user-defined models conform to the M2 metamodels, representing specific instances of the domain concepts.[28] Finally, the M0 layer holds runtime data instances that conform to the M1 models, capturing real-world objects or entities.[28] This hierarchy provides a rigorous foundation for modeling metadata at varying levels of abstraction, with XMI facilitating the exchange between layers through XML representations.[7] Model elements in XMI are mapped to XML structures to preserve the semantics of the underlying MOF-based models. Classes are represented as XML elements named after the class, incorporating all properties including those inherited from superclasses.[7] Attributes are serialized either as XML attributes or nested elements using the property's short name, depending on the attribute's type and configuration.[7] Associations between model elements are handled through dedicated XML elements that denote links, capturing multiplicity and navigation properties.[7] Generalizations are managed via inheritance mechanisms, where subclasses extend base classes, often indicated by thexmi:type attribute to specify the exact metamodel class without requiring schema extensions in all cases.[7] This mapping ensures that the structural relationships defined in the metamodel are faithfully reproduced in the XML output.
To maintain referential integrity across model elements, XMI employs XML's built-in mechanisms for links and references. Each model element is assigned a unique identifier using the xmi:id attribute, which serves as a key within the document scope.[7] References to these elements, such as in associations or compositions, utilize xmi:idref attributes to point to the target xmi:id, enabling efficient intra-document linking without duplication.[7] For cross-document references, the href attribute incorporates URIs combined with fragment identifiers (e.g., URI#id_value), supporting distributed model exchanges while preserving relationships.[7]
Namespace management in XMI is crucial for disambiguating metamodel elements from instance data and avoiding naming conflicts across different metamodels. XML namespaces are declared using standard xmlns attributes, with URIs such as http://www.omg.org/spec/XMI/20110701 identifying the XMI namespace itself.[7] Metamodel-specific namespaces are prefixed on the root xmi:XMI element and subsequent tags, ensuring that elements from the M2 layer (e.g., UML classes) are distinctly separated from M1 instance data.[7] This approach allows multiple metamodels to coexist in a single XML document without overlap, facilitating modular and extensible metadata interchange.[7]
XMI defines conformance levels to accommodate varying requirements for model serialization, balancing completeness with efficiency. The full conformance level supports comprehensive serialization, including schema validation and full inheritance handling, suitable for complex models requiring strict adherence to metamodel definitions.[7] In contrast, the simplified conformance level omits optional schema extensions and ordering constraints, enabling faster processing and reduced document size for less intricate exchanges.[7] These levels ensure that XMI implementations can be tailored to specific use cases while maintaining core interoperability.[7] XMI binds these architectural elements to XML Schema as the primary mechanism for defining valid document structures.[7]
Serialization Mechanisms
XML Metadata Interchange (XMI) provides standardized rules for serializing Meta-Object Facility (MOF)-based models into XML documents, enabling the exchange of metadata across tools and platforms. The mapping process transforms metamodel elements into XML structures: classes from the metamodel become XML elements named after the class, while properties are serialized as either XML attributes or child elements depending on their type and configuration. For instance, single-valued properties typed as DataTypes can be represented both as attributes and elements, whereas multi-valued properties are serialized exclusively as elements to accommodate sequences or sets.[7] Multiplicities in the metamodel are handled through XML Schema constraints, where lower and upper bounds translate tominOccurs and maxOccurs attributes, ensuring that the serialized content respects the model's cardinality rules, such as sequences for ordered associations or sets for unordered ones.[7] Associations between objects are linked using attributes like xmi:id for unique identification and href or idref for references, supporting both intra-file and inter-file connections. An example serialization of a UML class might appear as <uml:Class name="Customer" xmi:id="_1">, with nested elements for attributes like <ownedAttribute name="orders" xmi:type="uml:Property"/>.[7]
Schema generation in XMI involves the automatic derivation of XML Schemas from MOF metamodels, following Extended Backus-Naur Form (EBNF) production rules that define element types, attribute declarations, and content models. Tools adhering to the specification, such as those implementing the rules in Section 8 of the XMI 2.5.1 standard, generate schemas that enforce namespace-qualified names and validate the structure of serialized instances.[7] This process supports both tagged and untagged content models: tagged formats use explicit org.omg.xmi annotations (e.g., org.omg.xmi.attribute or org.omg.xmi.element) to control serialization choices, while untagged formats rely on default behaviors for broader compatibility.[7]
The XMI document structure includes an optional XMI.header within the root <xmi:XMI> element, which captures metadata such as the XMI version, exporter details, and documentation, typically in the format <XMI.header exporter="ToolName" exporterVersion="1.0"/>.[7] Extension points allow for the integration of non-XMI XML content or custom tags, embedded via <xmi:Extension> elements with attributes like extender and extenderID, processed in "lax" mode to permit tool-specific extensions such as diagram representations through XMI-DI without violating core fidelity.[7]
Validation of XMI documents ensures round-trip fidelity, meaning the original model can be accurately reconstructed from the XML. This is achieved through XML Schema constraints that check required elements, attributes, and multiplicities, supplemented by optional semantic validation and digital signatures for integrity.[7] For example, schemas derived with org.omg.xmi.enforceMaximumMultiplicity true will restrict sequences to the metamodel's bounds, preventing invalid expansions during interchange.[7]