YAMAML

YAMAML Mapping

Elements in YAMAML Data Mapping

The following table lists the elements that can be used in a YAMAML data mapping.

ElementDescriptionTypeRequiredExamples
sourcePath of the data sourcestringyes/path/to/example.csv, http://ex.tld/ex.csv
typeType of the data sourcestringyescsv, xlsx, yaml, json
pathPath to the data elementstringyesCSV column name, JSON/YAML key path
stripStrip one or a group of characters, given as a list of stringslistno['_', ' ']
replaceReplace one or a group of characters with the given value. This should be a list of replace pair as a listlistno[[0,1],[' ', '-']]
separatorA separator character to split the given values into a group of valuesstringno, or `
prependPrepend a text string to the valuestringno
appendAppend a text string to the valuestringno

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],[' ', '-']]: replace 0 with 1 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
Previous
CLI Tool