Schema Transformation
Schema Transformation is a Session Task that reads input data classes and creates new objects in the output classes. This is achieved by copying the objects from the input classes, so the session will contain both the source and the target objects at the same time.
Schema transformation is designed for more advanced changes of schema, other than simple renaming. For more information on renaming schema, refer to Schema Mapping.
Note: Some conversions, such as using logic to analyse a value and split it across two attributes, will not be possible using Schema Transformation. For this, consider running Actions before or after the Schema Transformation task to operate on the data, using custom attributes added to the source or target data stores to temporarily hold these values.
Prerequisites
The Schema Transformation task requires the following:
-
A Source data store to read the objects from. This must be open in the session.
-
A Mapping data store containing the transformation definition. See Configuring a Mapping data store below for more.
-
A Target data store to write objects to. This must be open in the session.
Note: The class names from the Source data store must be different to the class names in the Target data store. If any class names are the same then change the name of the classes in the Input Mappings and use the changed name in the contents of the Mapping Data Store.
Configuring a Mapping data store
A Mapping data store can be configured using any data store format readable by 1Integrate, but are normally stored in a CSV
file or a database table.
A mapping data store requires a strict structure of up to three tables with specific attributes which are listed below. These names can be set to the correct values in the input mapping.
-
ClassAttributeMapping
This is the main definition of how to create objects in target classes by copying feature attributes from the source classes.
-
CodeListMapping
Use this table, in addition to the Class Attribute Mapping, to convert specific attribute values in source codelists to attribute values in the target codelists. Codelist Mappings, are intended to be complete and can ‘replace’ the definition in the Class Attribute mappings rather than override specific values.
-
DerivedAttributeMapping
In addition to the above, use Derived Attribute Mapping to set values on target classes optionally depending on the source. For example, to set a type attribute based on the source class or to set an attribute to a constant regardless of the source. The Derived Attribute Mapping values are for specific targeted overrides that layer on top of class attribute mapping, as opposed to a replacement for them.
Note: CodeListMapping and DerivedAttributeMapping must use Source/Target class pairings present in ClassAttributeMapping
Mapping data store requirements
Mapping Examples
ClassAttributeMapping
CodeListMapping
DerivedAttributeMapping
Using Schema Transformation in a Session
Schema transformation tasks are carried out as part of session.
-
Open a Session and select an Open Data Store task for both the Source and Target for the transformation.
Note: You can also use the Open Schema task in place of Open Data to open the target data store. This is useful to ensure that no target objects are accidentally loaded in the session.
-
Add a Schema Transformation task to add it to your session.
-
In the pop-up, select the three Data stores you will be using for the transformation.
You will need to select a Source, Target and Mapping Data Store, as in the example below:
The Select Data Stores... with data store examples selected
-
(Optional) In the session, add check rules tasks for the transformed data. Typically you will also add a Copy-To or Commit task for the Target Data Store, in order to write the transformed data out.
-
Run the session and your transformation will be applied.