turtle-matter

Sometimes, not all the data from the source is needed, but only a subset. The Extract class can be used to specify how to do that, depending on the type of the data.

Extraction Methods

Source type Property Expected property value Result
FileObject or FileSet fileProperty One of: fullpath, filename, content, lines, lineNumbers The corresponding property for the FileObject
CSV (FileObject) column A column name Values in the specified column
JSON jsonPath A JSONPath expression The value(s) obtained by evaluating the JSON path expression

FileProperty Values

Examples

Extracting File Content

{
  "extract": {
    "fileProperty": "content"
  }
}

Extracting CSV Column

{
  "extract": {
    "column": "userId"
  }
}

Extracting with JSONPath

{
  "extract": {
    "jsonPath": "$.metadata.title"
  }
}

Extracting Filename

{
  "extract": {
    "fileProperty": "filename"
  }
}

This class is typically used within a DataSource to specify exactly what part of the source data should be extracted for a particular field.