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.
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.
"mapapps_etl": {
"MapappsETLTools": [{
"fmeServerConfig": {
"fmeServerUrl": "http://<FME Server 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 |
|
The types are based on the default FME attribute types.
Comparison with esri types: |
description |
Attribute description. |
||
mandatory |
Is the attribute mandatory? |
|
|
category |
Attribute category. |
||
options |
Options to select for default values. |
Array with options:
|
|
default |
Default value. |
Text, number or option. |