Geovisualization Developer's Guide

Dataset Schema

The dataset schema response body is a JSON object returned by the Geovisualization REST API in response to a request for the definition of a dataset schema.

Table 1. Dataset Schema Response Elements
Element Data Type Description
kind String Type of response: the value is datalens#dataset_schema when the request is successful.
schema Object Schema of the dataset, if present:
  • delimiter – data delimiter: comma, semicolon or tab
  • type – type of file: currently, only CSV is supported
  • columns – a list of lists with each list representing a column in the data and containing the following elements:
    • index – integer representing index number of column
    • type – field type: number, string, or date
    • name – column name
    • alias – alternative name for the column
  • Note that columns auto-generated by geocoding requests have origin set to geocoding, and they also include the following attributes:
    • input_constants – list of defined input constants in original request
    • source_columns – list of columns used for geocoding
  • encoding – always UTF-8
dataset String The unique ID of the dataset

The code example below illustrates a typical response to a successful dataset schema request.

{
  "kind": "datalens#dataset_schema",
  "schema": {
    "delimiter": ";",
    "type": "CSV",
    "columns": [
      {
        "alias": "First column",
        "type": "string",
        "name": "column_1",
        "index": 0
      },
      {
        "alias": "Second column",
        "type": "string",
        "name": "column_2",
        "index": 1
      },
      {
        "origin": "geocoding",
        "alias": "lat",
        "name": "lat",
        "index": 2,
        "source_columns": [
          "column_1"
        ],
        "type": "number",
        "input_constants": []
      },
      {
        "origin": "geocoding",
        "alias": "lon",
        "name": "lon",
        "index": 3,
        "source_columns": [
          "column_1"
        ],
        "type": "number",
        "input_constants": []
      }
    ],
    "encoding": "utf-8"
  },
  "dataset": "87354ed28a66441385942f62e94282ea"
}