YAMAML
YAMAML Mapping
Elements in YAMAML Data Mapping
The following table lists the elements that can be used in a YAMAML data mapping.
Element | Description | Type | Required | Examples |
---|---|---|---|---|
source | Path of the data source | string | yes | /path/to/example.csv , http://ex.tld/ex.csv |
type | Type of the data source | string | yes | csv , xlsx , yaml , json |
path | Path to the data element | string | yes | CSV column name, JSON/YAML key path |
strip | Strip one or a group of characters, given as a list of strings | list | no | ['_', ' '] |
replace | Replace one or a group of characters with the given value. This should be a list of replace pair as a list | list | no | [[0,1],[' ', '-']] |
separator | A separator character to split the given values into a group of values | string | no | , or ` |
prepend | Prepend a text string to the value | string | no | |
append | Append a text string to the value | string | no |
source
The source
element specifies the path to the data source. This can be a local file path or a URL to a file.
Type: string
Required: yes
Examples:
/path/to/example.csv
http://ex.tld/ex.csv
type
The type
element specifies the type of the data source. This can be one of the following values: csv
, xlsx
, yaml
, json
.
Type: string
Required: yes
Examples:
csv
json
path
The path
element specifies the path to the data element. This can be a CSV column name or a JSON/YAML key path.
Type: string
Required: yes
Examples:
column_name
json_key_path
strip
The strip
element specifies one or a group of characters to strip from the value. This should be given as a list of strings.
Type: list
Required: no
Examples:
['_', ' ']
: strip underscores and spaces from the value
replace
The replace
element specifies one or a group of characters to replace with the given value. This should be a list of replace pairs as a list.
Type: list
Required: no
Examples:
[[0,1],[' ', '-']]
: replace0
with1
and spaces with dashes
separator
The separator
element specifies a separator character to split the given values into a group of values.
Type: string
Required: no
Examples:
,
: split values by commas|
: split values by pipes
mapping:
source: tbbt_characters.csv
type: csv
path: knows
seperator: ","
prepend
The prepend
element specifies a text string to prepend to the value.
Type: string
Required: no
Examples:
mapping:
source: tbbt_characters.csv
type: csv
path: wikidata
prepend: http://www.wikidata.org/entity/
append
The append
element specifies a text string to append to the value.
Type: string
Required: no
Examples:
_suffix
: append_suffix
to the value