Issue 17495: Section B6 - identification algorithm isn't terribly clear (canonical-xmi-ftf) Source: Oracle (Mr. Dave Hawkins, dave.hawkins(at)oracle.com) Nature: Uncategorized Issue Severity: Summary: The identification algorithm isn't terribly clear and has several variants that could be simplified into a single approach. It references UML qualified names, which doesn't make sense as this algorithm should work for a general MOF metamodel. Overloading '-' for separating objects and numeric discriminators is unwise as it means uniqueness checks must go beyond the peer elements. Alternative algorithm 1) The base name for an object is its name*. If there is no name, the base name is the name of the owning property or "_" for a top level object. 2) Any base name characters that are not (NCNameChar - '-') should be replaced with '_'. If a top level object does not start with (Letter | '_') a '_' should be prefixed. 3) If the object has no name or the base name is a duplicate of an earlier (by export order) peer base name append a numeric qualifier: a) append '_' if the last character is not already one b) append a sequence number, starting with 1 when the object has no name and 2 if it does. It is possible that an earlier peer name contains an '_n' suffix that creates a name collision. In this case increment the sequence number until no collision exists. 4) The id for a root object is the base name. The id for a nested object is parent id + '-' + base name. *There is no universal name property. So a tag should be introduced to identify valid name properties. Resolution: Revised Text: Actions taken: July 13, 2012: received issue Discussion: End of Annotations:===== s is issue # 17495 From: Dave Hawkins Section B6 - identification algorithm isn't terribly clear The identification algorithm isn't terribly clear and has several variants that could be simplified into a single approach. It references UML qualified names, which doesn't make sense as this algorithm should work for a general MOF metamodel. Overloading '-' for separating objects and numeric discriminators is unwise as it means uniqueness checks must go beyond the peer elements. Alternative algorithm 1) The base name for an object is its name*. If there is no name, the base name is the name of the owning property or "_" for a top level object. 2) Any base name characters that are not (NCNameChar - '-') should be replaced with '_'. If a top level object does not start with (Letter | '_') a '_' should be prefixed. 3) If the object has no name or the base name is a duplicate of an earlier (by export order) peer base name append a numeric qualifier: a) append '_' if the last character is not already one b) append a sequence number, starting with 1 when the object has no name and 2 if it does. It is possible that an earlier peer name contains an '_n' suffix that creates a name collision. In this case increment the sequence number until no collision exists. 4) The id for a root object is the base name. The id for a nested object is parent id + '-' + base name. *There is no universal name property. So a tag should be introduced to identify valid name properties.