Syntax FACTORY_DEF SchemaMappingFactory [FACTORY_NAME ] [INPUT FEATURE_TYPE [ ]* []*]* [DB_TYPE ] [DB_DATASET ] [DB_TABLE ] [DB_DIRECTIVES [ ]*] [FILTER_COLUMNS [ ]*] [INDEX_MAPPING_COLUMNS ] [ATTR_MAPPING_COLUMNS [ ]*] [ROW_ID_ATTR ] [OUTPUT (MAPPED|UNMAPPED) FEATURE_TYPE [ ]* []*]* Overview This factory is used to modify the schema (data model) of incoming features, based on an external lookup table (schema mapping table). The schema mapping table defines: A series of conditions that are to be met (specified by the FILTER_COLUMNS clause) A series of actions that will be executed when conditions are met (specified by the INDEX_MAPPING_COLUMNS and ATTR_MAPPING_COLUMNS clauses) The factory processes each incoming feature in the following manner: 1. The feature is matched against each row of the schema mapping table, where rows in which the filter does not match the feature are removed. 2. If an index mapping is not defined, skip this step. For each row, those with index values matching that of the feature are processed. The index attribute is mapped to the specified target value, and all attribute maps will be executed. 3. For each row, all attribute maps are executed. The factory loads the schema mapping table by the directives prefixed by DB_. In the standard manner, the DB_TYPE clause specifies the format type, the DB_DATASET clause specifies the dataset location, the DB_TABLE clause specifies the table(s) or feature(s) to read from the dataset, and the DB_DIRECTIVES clause specifies format-related parameters. The FILTER_COLUMNS clause specifies the columns used to create the mapping condition. The columns should be specified in pairs, where the first () is the column containing the attribute to test, and the second () is the column containing the value to test against. If the attribute value is blank for a particular row, then one of two behaviours may occur. By default, the filter is ignored. On the other hand, if one wishes to match a blank attribute value, add the control character ASCII 16 (DLE), or '\x10', to the end of . The INDEX_MAPPING_COLUMNS clause specifies an index mapping. For each incoming feature, an index mapping is performed if both: 1. The feature matches the filter condition of the given row 2. The feature's index source attribute value matches that of the given row An index mapping produces a new index attribute with the name specified by and the value specified by the column specified by . A common use case for index mapping is the mapping of feature types. In this case, the INDEX_MAPPING_COLUMNS clause should be specified in the following manner: [INDEX_MAPPING_COLUMNS fme_feature_type fme_feature_type] The ATTR_MAPPING_COLUMNS clause specifies the columns used to create an attribute map. Depending on which values are present in a particular row, the attribute map may be categorized differently. Source Attribute: yes Destination Attribute: yes Default Value: no Type: Attribute Map Create a new attribute with the name from the row and the value from the source attribute. Source Attribute: yes Destination Attribute: yes Default Value: yes Type: Attribute Map Create a new attribute with the name from the row and the value from the source attribute. If the source attribute is missing, the default value from the row is used. Source Attribute: no Destination Attribute: yes Default Value: yes Type: New Attribute Create a new attribute with the name and value from the row. After an attribute map has been applied, the source schema, by default, is retained. If one wishes to remove the source schema, add the control character ASCII 16 (DLE), or '\x10', to the end of . The ROW_ID_ATTR clause specifies an attribute to report the schema mapping rows that were applied to a feature. The rows are listed by row ID, separated by commas. Output Tags The SchemaMappingFactory supports the following output tags. MAPPED The output features that have at least one schema mapping action applied. UNMAPPED The output features that have no schema mapping action applied.