(since v2.4.0)
1. Introduction
This target derives CDB feature and attribute dictionaries from an application schema.
2. 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.
3. Configuration
3.1. Class
The class for the target implementation is de.interactive_instruments.ShapeChange.Target.CDB.CDB
3.2. Conversion Rules
3.2.1. 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" />
3.2.2. 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.
3.3. Parameters
3.4. 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:
1
2
3
4
5
6
7
8
<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.
3.4.1. 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).
3.4.2. 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.
3.4.3. targetType
Required / Optional: Required
Explanation: Name of the value type to use in CDB attribute definitions.
3.4.4. 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.
3.5. 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.
4. Configuration Example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<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>