Geovisualization Developer's Guide

Query

The create query response body is a JSON object returned by the Geovisualization REST API in response to a request for information about a query.

Table 1. Query Response Elements
Element Data Type Description
created_at ISO Datetime Date and time the query was created, in ISO 8601 format, with the Z indicating that the time is in UTC
dataset String Unique ID of the dataset associated with the query
description String Description of the query, based on the value provided when the query was created
estimated_rows Integer Estimated number of rows when the query is applied to the specified dataset
id String Unique ID for the query
kind String Type of response: the value is datalens#query when the request is successful
origin String Source of the dataset: Examples of possible values include user - the dataset was uploaded by the person logged into Geovisualization - and starter_pack - the dataset was included as part of the standard set of datasets preloaded into accounts for demonstration purposes
query Object A JSON element with the following subelements:
  • metrics – defines what data the response contains and is equivalent to a SELECT statement in SQL
  • version – the version number of the query rule engine
  • namespace – the namespae of the query
  • dataset – the unique ID of the dataset associated with the query
tags Array The labels used for searching for groups of queries, provided when the query was created or with a POST on the .../queries/{QUERY_ID}/tags endpoint
updated_at ISO Datetime Date and time the query was last modified, in ISO 8601 format, with the Z indicating that the time is in UTC
visibility String When the value is Private, you cannot share the query with others.

When the value is Public, you can share the query with others.

For more information about publishing items in Geovisualization, see Publishing.

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

{
  "origin": "user",
  "description": "Earthquake data from 2012 - Absolute value of depths",
  "tags": ["earthquake", "depths"],
  "updated_at": "2015-06-24T18:30:11Z",
  "visibility": "private",
  "dataset": "90af668484394fa782cc103409cafe39",
  "query": {
    "metrics": [
      "absolute_value"
    ],
    "version": 0.3,
    "namespace": {
      "absolute_value": {
        "source": [
          "Depth"
        ],
        "apply": [
          {
            "type": "transform",
            "fn": "abs"
          }
        ]
      }
    },
    "dataset": "90af668484394fa782cc103409cafe39"
  },
  "id": "88e786571fff488ab7003217344c936b",
  "kind": "datalens#query",
  "created_at": "2015-06-24T18:30:11Z",
  "estimated_rows": 1076
}