Type Converter

Introduction

(since v2.3.0)

This transformation converts the types of the model. For example, it can convert enumerations to code lists.

Configuration

The following sections specifiy the configuration options for this transformation.

Class

The class for this transformer implementation is de.interactive_instruments.ShapeChange.Transformation.TypeConversion.TypeConverter

Rules

rule-trf-dissolveAssociations

(since v2.4.0)

Dissolves associations that are navigable from types in the schemas selected for processing. Navigable roles of such associations are transformed into attributes. A suffix can be added to the names of these attributes, via parameter attributeNameSuffix. The type of these attributes is set to the type defined by parameter attributeType.

Associations can be excluded from this transformation by:

If an association that is dissolved has an association class, a warning is logged and the class is removed.

rule-trf-dissolveAssociations-excludeManyToManyRelationships

(since v2.4.0)

If this rule is included together with rule-trf-dissolveAssociations, an association is not dissolved if it represents a many-to-many relationship between two types (i.e., all navigable roles have max multiplicity greater than 1).

rule-trf-dissolveAssociations-keepType

(since v2.4.0)

If this rule is included together with rule-trf-dissolveAssociations, then the type of resulting attributes is kept as-is, i.e. parameter attributeType will have no effect.

rule-trf-dissolveAssociations-removeTransformedAttributeIfMultiple

(since v2.4.0)

If this rule is included together with rule-trf-dissolveAssociations, then attributes that result from dissolving an association and have maximum multiplicity greater than 1 are removed.

rule-trf-enumeration-to-codelist

Converts enumerations to code lists. For each converted enumeration, tagged value ‘asDictionary’ is set to ‘false’.

Enumerations can be excluded from this conversion if their name matches the regular expression given via parameter toCodelistExclusionRegex or if they have tagged value “toCodelist”=’false’.

NOTE: This rule converts all enumerations within the model to code lists. If a restriction is desired, for example to enumerations that belong to the schemas selected for processing, or to specifically identified application schemas (e.g. identified by name or target namespace regex), the implementation would need to be enhanced (for example through new parameters).

Constraints are not updated.

rule-trf-objectTypesToFeatureTypes

(since v2.4.0)

Convert all object types from schemas selected for processing to feature types. All subtypes of these types are also converted to feature types.

rule-trf-toFeatureType

(since v2.4.0)

Convert types either identified via parameter toFeatureTypeNameRegex or with tagged value ‘toFeatureType=true’ to feature types. The name of the tagged value can be configured via parameter toFeatureTypeTaggedValueName. All subtypes of these types are also converted to feature types.

Parameters

attributeNameSuffix

(since v2.4.0)

Alias: none

Required / Optional: optional

Type: String

Default Value: the empty string

Explanation: Define a suffix to be added to the names of attributes that have been transformed from association roles.

Applies to Rule(s): rule-trf-dissolveAssociations

attributeType

(since v2.4.0)

Alias: none

Required / Optional: optional

Type: String

Default Value: “CharacterString”

Explanation: Define the type to set for attributes that have been transformed from association roles.

Applies to Rule(s): rule-trf-dissolveAssociations

toCodelistExclusionRegex

(since v2.4.0)

Alias: none

Required / Optional: optional

Type: string with regular expression (using the syntax supported by Java)

Default Value: none

Explanation: Regular expression to identify enumerations (in the whole model) to NOT convert to code lists under rule-trf-enumeration-to-codelist. Identification is based on a match on the name of the type.

Applies to Rule(s): rule-trf-enumeration-to-codelist

toFeatureTypeNameRegex

(since v2.4.0)

Alias: none

Required / Optional: optional

Type: string with regular expression (using the syntax supported by Java)

Default Value: none

Explanation: Regular expression to identify types from the schemas selected for processing to convert to feature types with rule-trf-toFeatureType. Identification is based on a match on the name of the type. There is no default value.

Applies to Rule(s): rule-trf-toFeatureType

toFeatureTypeTaggedValueName

(since v2.4.0)

Alias: none

Required / Optional: optional

Type: String

Default Value: “toFeatureType”

Explanation: Identify the name of the tagged value that is used to tag types that shall be converted to feature types under rule-trf-toFeatureType.

Applies to Rule(s): rule-trf-toFeatureType

Map Entries

None at present

Advanced Process Configuration

None at present

Sample Configuration

<Transformer
 class="de.interactive_instruments.ShapeChange.Transformation.TypeConversion.TypeConverter"
 input="INPUT" id="trf" mode="enabled">
 <rules>
  <ProcessRuleSet name="convert">
   <rule name="rule-trf-enumeration-to-codelist"/>
  </ProcessRuleSet>
 </rules>
</Transformer>
Top