CDB
(since v2.4.0)
Introduction
This target derives CDB feature and attribute dictionaries from an application schema.
Description
This target creates a CDB feature dictionary as well as a CDB attribute dictionary from the feature types in the schemas selected for processing.
The process of mapping an application schema into these two dictionaries has been developed in OGC Testbed 13, and is documented in the OGC NAS Profiling Engineering Report (OGC document number 17-020r1), chapter 8.
Configuration
Class
The class for the target implementation is de.interactive_instruments.ShapeChange.Target.CDB.CDB
Conversion Rules
rule-cdb-all-notEncoded
(since v2.4.0)
This conversion rule suppresses the conversion of any model elements (more specifically: application schemas and classes) for which the “cdbEncodingRule” tag is set to “notEncoded”.
NOTE: The encoding rule “notEncoded” is defined in the standard rules, which can be included in the target configuration via:
<xi:include href=”https://shapechange.net/resources/config/StandardRules.xml” />
rule-cdb-all-valueTypeTextForUnionRepresentingFeatureSet
(since v2.4.0)
If a property has a union that represents a feature type set as type, this rule ensures that “Text” is used as value type for the corresponding CDB attribute. The rule also ensures that no complaint (via log messages) is made when such a union or property is encountered.
Parameters
version
(since v2.4.0)
Type: string
Default Value: Comma separated list of versions from all schemas selected for processing that have at least one feature type.
Behavior: The version to assign to the CDB feature and attribute dictionaries.
unitsToIgnore
(since v2.4.0)
Type: comma separated list of strings
Default Value: none
Behavior: Define values of tag recommendedMeasure that shall be ignored. Example: “unitless”.
Map Entries
<mapEntries> contain individual <MapEntry> elements, which for this target contain information for mapping specific types (classes) from the UML model to types supported by CDB.
Examples:
<mapEntries> <MapEntry type="Numeric" targetType="Numeric" rule="*" param="numericFormat{Floating-Point}"/> <MapEntry type="Real" targetType="Numeric" rule="*" param="numericFormat{Floating-Point}"/> <MapEntry type="Integer" targetType="Numeric" rule="*" param="numericFormat{Integer}"/> <MapEntry type="Boolean" targetType="Boolean" rule="*"/> <MapEntry type="CharacterString" targetType="Text" rule="*"/> <MapEntry type="GM_Point" targetType="Text" rule="*"/> </mapEntries>
A <MapEntry> element contains the attributes described in the following sections.
type
Required / Optional: Required
Explanation: The unqualified UML type/class name to be mapped. Should be unique within the model (if it is not unique, this can lead to unexpected results).
rule
Required / Optional: Required
Explanation: The encoding rule to which this mapping applies. May be “*” to indicate that the mapping applies to all encoding rules.
targetType
Required / Optional: Required
Explanation: Name of the value type to use in CDB attribute definitions.
param
Required / Optional: Optional
Explanation: Defines one or more parameters for the mapping.
Each parameter has a name. A list of parameters is separated by commas. Each parameter can also have characteristics defined for it, providing even further information for the conversion. Characteristics for a parameter are provided within curly braces. A characteristic is either provided by identifier only, or by a key-value pair, with the key being the identifier of the characteristic.
Examples:
- numericFormat{Floating-Point}
- numericFormat{Integer}
Supported parameters, their interpretation as well as characteristics are described in the following sections.
Parameter: numericFormat
(since v2.4.0)
Explanation: Name of the parameter that defines the numeric format of the target type.
Characteristics:
- Floating-Point – for floating point formatted types
- Integer – for integer types
Advanced Process Configuration
The <advancedProcessConfigurations> element inside of the <Target> element is used to define standard units to use in the CDB attribute dictionary. A <CDBUnitDefinition> element is added for each such unit.
The information items defined by a <CDBUnitDefinition> element are:
- code (optional) – This (positive) integer value defines the unit code. If the code is not defined, ShapeChange generates codes for all units in a CDB attribute dictionary that do not have pre-defined codes.
- symbol (required) – Symbol to be used for the unit.
- name (required) – Name of the unit. Used by ShapeChange to find a unit that matches the recommended measure of a property.
- alias (optional, multiple values allowed) – Alias name for the unit. Used by ShapeChange to find a unit that matches the recommended measure of a property.
- description (optional) – Human readable description of the unit.
Configuration Example
<Target class="de.interactive_instruments.ShapeChange.Target.CDB.CDB" mode="enabled" inputs="TRF_TAGGED_VALUES"> <advancedProcessConfigurations> <CDBUnitDefinition code="1" symbol="m"> <name>meter</name> <alias>metre</alias> <description>To measure a length.</description> </CDBUnitDefinition> <CDBUnitDefinition code="2" symbol="deg"> <name>degree</name> <description>To measure an angle.</description> </CDBUnitDefinition> <CDBUnitDefinition code="3" symbol="rad"> <name>radian</name> <description>To measure an angle.</description> </CDBUnitDefinition> <CDBUnitDefinition code="4" symbol="kph"> <name>Kilometer per hour</name> <description>To measure a speed.</description> </CDBUnitDefinition> <CDBUnitDefinition code="5" symbol="g"> <name>gram</name> <description>To measure a mass.</description> </CDBUnitDefinition> <CDBUnitDefinition code="6" symbol="s"> <name>second</name> <description>To measure time.</description> </CDBUnitDefinition> <CDBUnitDefinition code="7" symbol="%"> <name>Percentage</name> <description>A value between 0 and 100.</description> </CDBUnitDefinition> </advancedProcessConfigurations> <targetParameter name="outputDirectory" value="results/cdb"/> <targetParameter name="outputFilename" value="Test"/> <targetParameter name="sortedOutput" value="true"/> <targetParameter name="defaultEncodingRule" value="cdb"/> <targetParameter name="unitsToIgnore" value="unitless"/> <rules> <EncodingRule name="cdb" extends="*"> <rule name="rule-cdb-all-valueTypeTextForUnionRepresentingFeatureSet"/> </EncodingRule> </rules> <mapEntries> <MapEntry type="Numeric" targetType="Numeric" rule="*" param="numericFormat{Floating-Point}"/> <MapEntry type="Real" targetType="Numeric" rule="*" param="numericFormat{Floating-Point}"/> <MapEntry type="Measure" targetType="Numeric" rule="*" param="numericFormat{Floating-Point}"/> <MapEntry type="Integer" targetType="Numeric" rule="*" param="numericFormat{Integer}"/> <MapEntry type="Boolean" targetType="Boolean" rule="*"/> <MapEntry type="CharacterString" targetType="Text" rule="*"/> <MapEntry type="Character" targetType="Text" rule="*"/> <MapEntry type="Date" targetType="Text" rule="*"/> <MapEntry type="Any" targetType="Text" rule="*"/> <MapEntry type="GM_Point" targetType="Text" rule="*"/> <MapEntry type="GM_Surface" targetType="Text" rule="*"/> <MapEntry type="GM_Curve" targetType="Text" rule="*"/> <MapEntry type="CI_Address" targetType="Text" rule="*"/> </mapEntries> </Target>