Configuring the SchemaMapper Transformer

Liz Sanderson
Liz Sanderson
  • Updated

FME Version

Introduction 

The first step in any Schema mapping process is to determine the desired output. Decide whether the SchemaMapper will be mapping Feature Types and attributes, or adding new attributes to the destination schema (or a combination of these). Once the structure has been decided, an external lookup table can be created and connected to the SchemaMapper transformer within FME Workbench.

 

Structure of the Lookup Table

The lookup table can be stored in many different formats, including: comma-separated value files; spreadsheets (Excel or Google); or as tables in a database. Below is an example of a spreadsheet-based lookup table:

C3DIiMhnNU2NFlDeG66eHKq91U9AcO0Oki3gLNUr51wymy_Idi24HIT6bxpDXdEmXZuw1mwNBNj495cW-1cswDVCyn0oIpEHq4S99OvmvjEpVp2MJNEyVwR05GIreoO0LeCu4B8

Notice that there are two columns and the first row contains headers.

Column Headers: are created by the user and should be named in a meaningful way as they will be referenced within the SchemaMapper transformer. These are also referred to as field names or attribute names.

Table Data: is defined by the source dataset or created by the user (when specifying destination schema). Data can be comprised of attribute names, attribute values and feature type names.

Column Pairs: Notice that the example above contains two columns. Since Schema Mapping is the act of connecting the source schema to the destination schema, there will be pairs of columns in the lookup table that define source and destination schemas within the transformer. For example, the lookup table below contains two columns: a source Feature Type column which is paired with a desired destination Feature Type column.

 

ujcga7iHzfqNHqqVaWqzfkGUwIf37gwTu1w-FIIPtPaV7qaN6opfgLj0qukhwbmeSg6KYB0jt4Ldg3y2TpSs3ap2B18Em1mDp8aYSQzvNrMRMl5rv2qaj_EigOx_TOFIok2_rxk

 

Another pairing type occurs when you have a source attribute name in one column paired with its attribute value in another. This pairing type is used for filtering and is discussed in parts 3 , 4 and 5 of the SchemaMapper tutorial.

Once the external lookup table has been created, the SchemaMapper transformer can be utilized.

Note: a simple lookup table can be generated from a source dataset which can function as a starting point for the mapping process. For more on this, please see the following article: SchemaMapper: Generating a Lookup Table from Source Data
 

Setting up the SchemaMapper Transformer

The SchemaMapper transformer has two components, a reader which is used to open the lookup table and an action dialog to define the schema mapping rules. The reader is straightforward and resembles the usual reader for text files or databases.

This image shows the SchemaMapper reading from a lookup table created in a .csv format:

S3kh_l_HrrcJZwTR0kvJjNsFb8xpNEftUW4NYBBzXXfQXNTFp7HkjV9_szahYk0sXWqX72SYBD2hThx4wNcsVVnfKCYYA1LJbMsTTAha63M2LuhSNmEYPxa80WZ3slbkFs4eMbE


This image shows the reader parameters for this specific lookup table. Notice that column headers are selected from the lookup table which define the source and destination feature types:

nkBS7A2EfV5sAgj6Bxtr8WMG4QFbDdqtnQ0yLjXfjf4fjl6pLfgi7NL1ujYjoSTqrsZupx9aHBMjvz2Z2in_kLBtG8eedNHWoSKisIfs7A1nyKGY_hZZri24grrAoxcbM5SKa-I

 

Using descriptive column headers will make actions easier to create and the workflow easier to understand.

The action dialog is the second component of the SchemaMapper. This dialog is used to define rules for schema mapping using information stored within the lookup table. Specifically, field names from Line 1 of the lookup table have been recognized and tell the SchemaMapper how to take action.

Once an action is created, it will be displayed in the action dialog. Each SchemaMapper transformer can contain multiple actions. In the example below, the image contains a SchemaMapper which is set up to map both feature types and attributes:

NAr2ToFWH6WsXza2ykJOUPrrTB06J957gPMtCZi5rgftW9bctkMAfLYutQGzVQj-WEF4EAMJTWZCIcDhpl2fMB-MumVpgb33JV2PlWL3gc0l4BsuPVBARswchMMGpnm5GkAObN0

 

Each subsequent section in this guide will showcase a specific function of the SchemaMapper transformer with an increase in complexity along the way.

 

Additional Resources

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.