Issue 18970: Canonical XMI needs to ensure predictable XMI:ID for all instances of EMOF and CMOF metaclasses (canonical-xmi-ftf) Source: NASA (Dr. Nicolas F. Rouquette, nicolas.f.rouquette(at)jpl.nasa.gov) Nature: Uncategorized Issue Severity: Summary: Canonical XMI B.6 Identification needs to be strengthened to guarantee predictable XMI:ID for all metaclasses in the scope of an EMOF/CMOF metamodel except for Comments. Comments in EMOF/CMOF metamodels must be restricted to annotate elements in the same EMOF/CMOF metamodel as the Comment. The XMI:IDs for UML 2.4 and 2.5 come from the Eclipse UMLUtil class (see http://download.eclipse.org/modeling/mdt/uml2/javadoc/4.1.0/org/eclipse/uml2/uml/util/UMLUtil.html) This utility class provides the functionality of the Canonical XMI identification scheme in section B.6 However, for UML 2.5, this scheme had to be overridden for the generation of XMI:ID of Generalization relationships. Since UML's Generalizations are not ordered (UML's Classifier::generalization : Generalization[*] is not ordered), their XMI:ID is not predictable. The workaround involved extracting from the OMG UML 2.4 XMI a table mapping each Generalization's XMI:ID to the pair of XMI:ID for its general and specific Classifiers. The XMI:ID for Generalizations in UML 2.5 was set by looking up in this table the XMI:ID of the Generalization general & specific Classifiers. If there was an entry in that table, the table's XMI:ID was used; otherwise the XMI:ID was generated using the Eclipse UMLUtil. The problem is not unique to Generalizations; it affects several metaclasses allowed in CMOF. To ensure predictable XMI:ID for ALL allowed EMOF/CMOF metaclasses, the algorithm in B.6 must be modified to produce XMI:IDs in several phases: Phase 1 = Apply B6 to all allowed metaclasses except for any of the following kind: DirectedRelationship BehavioralFeature ValueSpecification InstanceSpecification UMLDiagramElement (for UML2.5's UMLDI) This allows generating XMI:ID for metaclasses that have an intrinsic ID due to their qualified name only; i.e: Package and Classifier (Class, Association, DataType, PrimitiveType) Phase2 = Phase1 + BehavioralFeature; i.e., Operation, Parameter Phase3 = Phase2 + DirectedRelationship; I.e: ElementImport, Generalization, PackageImport, PackageMerge Phase4 = Phase3 + InstanceSpecification + ValueSpecification; I.e.: EnumerationLiteral; InstanceValue, InstanceSpecification (for models of EMOF/CMOF metamodels), LiteralBoolean, LiteralInteger, LiteralNull, LiteralReal, LiteralString, LiteralUnlimitedNatural, OpaqueExpression Phase5 = Phase4 + UMLDiagramElement; I.e. All concrete subclasses of UMLDiagramElement; see UML2.5, Annex B This 5-phase approach has been used for generating the official XMI for OMG's UML 2.5 and DD 1.0.1 — see https://dev.enterprisecomponent.com/repository/repos/UML-Spec-Simplification/trunk/pluglets/Normalize.java Resolution: Revised Text: Actions taken: October 2, 2013: received issue Discussion: End of Annotations:===== m: "Rouquette, Nicolas F (313K)" To: "issues@omg.org" CC: "canonical-xmi-ftf@omg.org" , "mof2xmi-rtf@omg.org" , Kenn Hussey , Lonnie VanZandt Subject: Canonical XMI needs to ensure predictable XMI:ID for all instances of EMOF and CMOF metaclasses. Thread-Topic: Canonical XMI needs to ensure predictable XMI:ID for all instances of EMOF and CMOF metaclasses. Thread-Index: AQHOv42dkRYSjczAJ0GUFc8CBT/u6g== Date: Wed, 2 Oct 2013 16:36:58 +0000 Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-MacOutlook/14.3.4.130416 x-originating-ip: [128.149.137.114] X-Source-Sender: nicolas.f.rouquette@jpl.nasa.gov X-AUTH: Authorized X-Virus-Scanned: amavisd-new at omg.org Canonical XMI B.6 Identification needs to be strengthened to guarantee predictable XMI:ID for all metaclasses in the scope of an EMOF/CMOF metamodel except for Comments. Comments in EMOF/CMOF metamodels must be restricted to annotate elements in the same EMOF/CMOF metamodel as the Comment. The XMI:IDs for UML 2.4 and 2.5 come from the Eclipse UMLUtil class (see http://download.eclipse.org/modeling/mdt/uml2/javadoc/4.1.0/org/eclipse/uml2/uml/util/UMLUtil.html) This utility class provides the functionality of the Canonical XMI identification scheme in section B.6 However, for UML 2.5, this scheme had to be overridden for the generation of XMI:ID of Generalization relationships. Since UML's Generalizations are not ordered (UML's Classifier::generalization : Generalization[*] is not ordered), their XMI:ID is not predictable. The workaround involved extracting from the OMG UML 2.4 XMI a table mapping each Generalization's XMI:ID to the pair of XMI:ID for its general and specific Classifiers. The XMI:ID for Generalizations in UML 2.5 was set by looking up in this table the XMI:ID of the Generalization general & specific Classifiers. If there was an entry in that table, the table's XMI:ID was used; otherwise the XMI:ID was generated using the Eclipse UMLUtil. The problem is not unique to Generalizations; it affects several metaclasses allowed in CMOF. To ensure predictable XMI:ID for ALL allowed EMOF/CMOF metaclasses, the algorithm in B.6 must be modified to produce XMI:IDs in several phases: Phase 1 = Apply B6 to all allowed metaclasses except for any of the following kind: DirectedRelationship BehavioralFeature ValueSpecification InstanceSpecification UMLDiagramElement (for UML2.5's UMLDI) This allows generating XMI:ID for metaclasses that have an intrinsic ID due to their qualified name only; i.e: Package and Classifier (Class, Association, DataType, PrimitiveType) Phase2 = Phase1 + BehavioralFeature; i.e., Operation, Parameter Phase3 = Phase2 + DirectedRelationship; I.e: ElementImport, Generalization, PackageImport, PackageMerge Phase4 = Phase3 + InstanceSpecification + ValueSpecification; I.e.: EnumerationLiteral; InstanceValue, InstanceSpecification (for models of EMOF/CMOF metamodels), LiteralBoolean, LiteralInteger, LiteralNull, LiteralReal, LiteralString, LiteralUnlimitedNatural, OpaqueExpression Phase5 = Phase4 + UMLDiagramElement; I.e. All concrete subclasses of UMLDiagramElement; see UML2.5, Annex B This 5-phase approach has been used for generating the official XMI for OMG's UML 2.5 and DD 1.0.1 . see https://dev.enterprisecomponent.com/repository/repos/UML-Spec-Simplification/trunk/pluglets/Normalize.java Nicolas.