Skip to main content

Record Syntax

A single record may be encoded as a JSON object, with a value for each field included as a property of the object. The key may be either the field name or label, and each field may only have a single value provided.

PropertyValue
<field name / label>field type appropriate value / null
"file"RFC 4180 standard
"tags"RFC 4180 standard
"expressions"JSON object mapping field name/label to expression

Data Object

A data object is used to import any type of binary data. This may be used in conjuction with the store functionality (see here, or the data may be embedded directly.

When referencing a stored object, the data object is specified as a string by the server-provided "object_id".

Records

Provides the data for one or more records.

Array

Provides record data as an array of record objects (see below).

DSV

Provides record data as a delimiter separated values file. See the [[XINA API :: DSV Format|DSV format]] page for the syntax and more information.

Record

Provides data for a single record as a JSON object.

Property Value
field name / label
"file"

DSV Format

Certain types of data may be provided in a delimiter separated values format.

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

  • lines end with CR LF
  • line breaks cannot be used in values
  • any field may be escaped
  • the default quote character is " (double quotes)
  • any field containing the delimiter must be quoted
  • an escape character in an escaped field must be represented by two escape characters
  • the first record (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)
 }