Skip to main content

Record Syntax

JSON Format

A single record may be encoded as a JSON object:

Property Value
<field name / label> field type appropriate value / null
"expressions" JSON object mapping field name/label to expression
"file" binary object (if database has file enabled)
"tags" JSON array of string(s) (if database has tag enabled)

The "expressions" property allows field values to be specified by expression, rather than explicit value. Between the base object and "expressions" object, field may only have a single value provided, or an error will be thrown.

Multiple records may be encoded as a JSON array of JSON objects in this format.

DSV Format

Certain types ofRecord data may be provided in a delimiter separated values format. In this case the record data itself is contained in a binary object.

PropertyValue
"type""dsv", "csv", or "tsv"
"file"binary object
"delimiter"string (required for "dsv")
"quote"string (optional)

The "csv" and "tsv" types specify default delimiters of comma (,) and tab (\t), respectively.

Example

{
 "records": {
  "type": "dsv",
  "file" : "<object ID>",
  "delimit": ";"
 }
}

The format of the separated values filesfile is largely based on the RFC 4180 standard. The specific requirements are:

  • lines must end with LF (\n) or CR LF (\r\n)
  • line breaks cannot be used in values
  • any field may be escaped
  • the default quote character is " (double quotes)
  • any field may be quoted by the quote character
  • any field containing the delimiter must be quoted
  • ana escapequote character in ana escapedquoted fieldvalue must be represented by two escapequote characters
  • the first record (row)row must contain the names of each field
  • blank lines with no data are ignored

DSV

The basic DSV format must explicitly specify a delimiter.

 {
  "type":      "dsv",
  "object_id": <string>,
  "delimit":   <string>,
  "quote":     <string>, (optional)
  "line":      <string>  (optional)
 }

TSV

The TSV format uses TAB (\t) as the default delimiter, but it may be overridden.

 {
  "type":      "tsv",
  "object_id": <string>,
  "delimit":   <string>, (optional)
  "quote":     <string>, (optional)
  "line":      <string>  (optional)
 }

CSV

The CSV format uses , (comma) as the default delimiter, but it may be overridden.

 {
  "type":      "csv",
  "object_id": <string>,
  "delimit":   <string>, (optional)
  "quote":     <string>, (optional)
  "line":      <string>  (optional)
 }