exff V0.1 EXPRESS to UML Mapping

exff V0.1 EXPRESS to UML Mapping

ISO 10303-25 2003 Draft TS EXPRESS to UML mapping going through standardization within ISO available from OMG as an ISO SC4/OMG liaison document.

This document specifies the mapping from EXPRESS to UML that the exff infrastructure implements. The purpose of exff Release 0.1 is simply to show feasibility. This has the implication that EXRESS schemas that do not strictly follow the Release 0.1 guidelines will not map properly and no checking or error messages will be generated. This also has the implication that care is not taken to support the round trip mapping from EXPRESS to UML and back to EXPRESS. Future releases of exff will provide that capability.

Any EXPRESS declaration not discussed in this document is not considered in the mapping.

The most recent update to this document occurred on 2004-04-02.

Relationship to ISO 10303-25

ISO 10303-25 EXPRESS to XMI Bindingexff

The ISO standard has completed its ballots and will be registered as an ISO Technical Specification 2Q2004. Future releases of exff will fully support Part 25.

EXPRESS schema mappings

For upward compatibility and other reasons, some aspects of the mapping can be controlled by the user. This is done by editing the e2u_parameters.xsl file. The following are configurable:

  • whether to create UML Attributes that represent the EXPRESS enumeration literals;
  • whether to add OCL constraints to the UML model to represent some of the constraints not mappable to UML. At the moment, only EXPRESS redeclared attributes that specialize the domain to be a SUBTYPE of some supertype are supported.
  • whether to map EXPRESS simple types into native UML Primitive Datatypes or UML Classes;
  • whether to map the relationship between EXPRESS SELECT types and the select list items as UML Generalizations or as UML aggregation associations as specified in ISO 10303-25.

The mapping only supports single EXPRESS schemas in that with no USE FROM or REFERENCE FROM declarations are considered. However, input of more than one EXPRESS schema at a time is supported and each will be mapped into a separate UML Package. If multiple schemas are input, the mapping requires unique EXPRESS entity type names across the scope of all schemas being input.

The EXPRESS schema is mapped to a UML Package within a UML Model named "data specification view". The name of the UML Package is set to be the name of the EXPRESS schema.

All other UML ModelElements mapped from EXPRESS declarations with that schema are created within the namespace of the UML Package mapped from the EXPRESS schema.

EXPRESS simple data type mappings

UML Class mapping

A UML Class with the same name as an EXPRESS simple data type (string, real, logical, integer, boolean and binary) are created as part of each mapping. EXPRESS simple type number maps to real. Reference to any of these EXPRESS simple data types are mapped into references to the corresponding UML Class. The namespace for these UML Classes is the UML Model containing the UML Package mapped from the EXPRESS schema.

NOTE - One reason to choose this mapping is that not all UML tools allow the specialization of UML Datatypes. However, this relationship is required as EXPRESS defined types that have EXPRESS simple types as their underlying type are mapped to be specializations of that simple type.

UML Datatype mapping

Each EXPRESS simple data type is mapped into a UML Datatype where possible as follows:

  • EXPRESS string maps to UML String
  • EXPRESS integer maps to UML Integer
  • EXPRESS Boolean maps to UML Boolean
  • EXPRESS logical maps to a UML Class named logical
  • EXPRESS real maps to UML Double
  • EXPRESS number maps to UML Double
  • EXPRESS binary maps to a UML Class named binary

Reference to any of these EXPRESS simple data types are mapped into references to the corresponding UML Datatype or Class. The namespace for these UML Datatypes and Classes is the UML Model containing the UML Package mapped from the EXPRESS schema.

EXPRESS defined data type mappings

EXPRESS SELECT types

Each EXPRESS SELECT type is mapped into a UML Class. The name of the UML Class is the name of the EXPRESS SELECT type. The mapping of the relationship between that UML Class and the representations of its select list items is configurable to be UML Generalization or UML aggregation association as follows:

  • a UML Generalization is defined, where the more general UML Class is the on representing the EXPRESS SELECT type, for the UML representation of each select list item;
  • a UML aggregation association is defined, where the UML Class representing the EXPRESS SELECT type is the aggregator, for the UML representation of each select list item. The name of these UML aggregations associations is always 'selection_of'. This implements the ISO 10303-25 EXPRESS to UML mapping.

EXPRESS defined type with simple underlying types

Each EXPRESS defined type whose underlying type is an EXPRESS simple type, is mapped into a UML Class. The name of the UML Class is the name of the EXPRESS defined type. A UML Generalization relaionship is created between that UML Class and the UML representation of the EXPRESS simple type. The representation of the EXPRESS simple type is the more general UML ModelElement.

EXPRESS entity data type mappings

Each EXPRESS entity data type is mapped to a UML Class. The name of the UML Class is the name of the EXPRESS entity data type.

Any EXPRESS subtype declarations are mapped to UML Generalization relationships between UML Classes mapped from the EXPRESS entity data types. Multiple inheritance is supported.

If an EXPRESS ABSTRACT SUPERTYPE constraint is applied to the EXPRESS entity data type, the UML Class isAbstract attribute is set to 'true' for the UML Class mapped from the EXPRESS entity data type.

No other SUPERTYPE or SUBTYPE_CONSTRAINT declarations are mapped. It should be noted that the default relationship between UML Specializations is mutually exclusive while the default relationship between EXPRESS subtypes is not mutually exclusive.

EXPRESS explicit attribute mappings

As EXPRESS has no construct similar to a UML Association, some EXPRESS explicit attributes map to UML Attributes while others map to UML Associations.

EXPRESS attribute to UML Attribute

Each EXPRESS explicit attribute with a simple data type as its base type is mapped to UML Attribute defined within the UML Class mapped from the containing EXPRESS entity data type. The name of the UML Attribute is set to be the name of the EXPRESS explicit attribute. The type of the UML Attribute is set to be the UML Class or UML Datatype representing the EXPRESS simple data type.

UML Association mappings

Each EXPRESS explicit attribute with a single or SET OF entity data type(s) as its base type is mapped to UML Association defined at the same level as UML Class mapped from the containing EXPRESS entity data type. One UML AssociationEnd is set to be the UML Class mapped from the containing EXPRESS entity data type (call this this source end) and the other UML AssociationEnd is set to refer to the UML Class mapped from the EXPRESS entity data type that is the base type of the explicit attribute (call this the target end).

In both cases, the name of the UML Association is set to be the name of the EXPRESS explicit attribute and the name of the UML AssociationEnd at the target end of the relationship is set to be the name of the EXPRESS explicit attribute.

If the base type of the EXPRESS explicit attribute is a single entity data type, the UML Multiplicity is set to be 1..1 at the targer end and 0..* at the source end.

The navigability of the UML Association is set to go from the UML Class representing the EXPRESS entity type within which the explicit attribute is defined to the UML Class representing the domain of the attribute.

If the EXPRESS explicit attribute is a redeclared attribute and its domain is a subtype of the entity type that is the domain of the explicit attribute in its original declaration, an OCL constraint may be added to the mapping that represents that redeclaration. Whether the OCL constraint is added is configurable. The UML Constraint is defined as follows:

  • the constraint name will be redeclared<entity><attribute>
  • the contraint body is context <entity> inv redeclared<entity><attribute> : self . <attribute> -> forAll (oclIsTypeOf( <subtype> ))
  • where <entity> is the name of the EXPRESS entity type, <attribute> is the name of the redeclared EXPRESS explicit attribute and <subtype> is the name of the subtype that is the specialized domain of the redeclared explicit attribute.