Schema mapping

map.apps ETL schema mapping allows users to upload their data and map the source schema to a predefined destination schema. You can configure mandatory attributes as well as default values for each ETL tool. In addition to that, source attribute types will be validated against the destination attribute types to make sure that the following FME process can successfully process the data.

schema mapping

You can use the schema mapping in combination with the file upload and analyzing input. After users upload a file, the FME workspace schema_analyzer.fmw will analyze the contents and provide the mapping gui. After a successful configuration, the Published Parameters mapapps_etl_schema and mapapps_etl_defaults will be provided, which can be evaluated in the workspace.

The workspace schema_mapping.fmw provides a basic workflow template to map attribute names and values to the destination based on the user input. Within the template everything related to the schema mapping processes is already provided. Depending on the use case, the template has to be completed to handle the mapped features. This could mean writing the data to a database, to a local file or providing the data as a data download back to the user.

Schema mapping can only be done for uploads with one single feature type. Subsequent feature types (e.g. multiple sheets in an Excel file) will be ignored.

ETL tool configuration

To enable the schema mapping activate useSchemaMapping and useAnalyzeworkspace. In addition to that, configure the destination schema in the object destinationSchema. Here, list all attributes that the user can fill by attribute mapping or by default values. The attribute options are listed in the table below.

app.json
"mapapps_etl": {
      "MapappsETLTools": [{
          "fmeServerConfig": {
            "fmeServerUrl": "http://<FME Flow URL>",
            "workspaceName": "schema_mapping.fmw",
            "repositoryName": "<Repository Name>>",
            "useAnalyzeworkspace": true,
            "useSchemaMapping": true,
            "analyzeworkspace": "schema_analyzer.fmw",
            "destinationSchema": {
              "attributes": [
                  {
                    "name": "Parameter1",
                    "type": "varchar(30)",
                    "description": "Parameter explanation",
                    "mandatory": 1,
                    "category": "Category 1"
                  },
                  {
                    "name": "Parameter2",
                    "type": "real64",
                    "description": "Parameter explanation",
                    "mandatory": 0,
                    "category": "Category 2"
                  }
              ]
            }
          },
          "fmeTool": {
            "inputs": [
              "upload"
            ],
            "output": "download",
            "marginBox": {
              "w": "90%",
              "h": "90%"
            },
            "maximizable": true
          },

          ...
JSON-Parameter Description Options Option Description

name

Name of the attribute in the data model.

type

Data type of the attribute

varchar(n), int16, int32, real32, real64, date

The types are based on the default FME attribute types. n can be replaced by the maximum allowed number of characters.

Comparison with esri types:
int16 = short, int32 = long, real32 = float, real64 = double

description

Attribute description.

mandatory

Is the attribute mandatory?

0, 1

0 = optional, 1 = mandatory

category

Attribute category.
Attributes of the same category will be grouped in a tab.

options

Options to select for default values.

Array with options:

{
  "text":"<text>",
  "value": "<value>"
}

<value> can be a strings or an integer.

default

Default value.
Will be filled automatically.

Text, number or option.
For options, the "value" has to be entered.