# Dataset

## Base definition

```javascript
{
    "kind": "dataset",
    "id": string,
    "qualifiedReference": string,
    "scopedReference": string,
    "referenceId": string,
    "name": string,
    "url": string,
    "uri": string,
    "doi": string,
    "owner": {
      user.base | organization.base // See user or organization resource definition
    }
}
```

## List definition

In addition to the base definition, any dataset resource returned by a `list` request will contain the following properties:

```javascript
{
    "description": string,
    "labels": string[], // Only present if you are an administrator
    "accessLevel": string("overview"|"metadata"|"sample"|"data"|"edit"),
    "publicAccessLevel": string("none"|"overview"|"metadata"|"sample"|"data"|"edit"),
    "createdAt": integer, 
    "updatedAt": integer, 
    "tableCount": integer,
    "numBytes": integer, 
    "totalNumBytes": integer,
    "totalActiveTabularBytes": integer,
    "totalInactiveTabularBytes": integer,
    "totalRawFileBytes": integer,
    "temporalRange": [integer, integer], 
    "temporalPrecision": string,
    "geoBBox": {
        "westLongitude": number,
	"eastLongitude": number,
	"northLatitude": number,
	"southLatitude": number
    },
    "sampleConfiguration": null | {
        "variableName": null | string,
        "targetRatio": float
    }
}
```

## Get definition

In addition to the base and list definition, any dataset resource returned by a `get` request will contain the following properties:

```javascript
{
    "methodologyMarkdown": string,
    "usageMarkdown": string,
    "contactInfo": string,
    "links": [
        { 
            "title": string, 
            "url": string 
        }
    ],
    "supportingFiles": [
        { 
            "name": string, 
            "url": string, 
            "accessLevel": string("overview"|"metadata"|"sample"|"data"),
            "mimeType": string,
            "size": int 
        }
    ],
    "customDocumentationSections": [
        {
             "title": string,
             "accessLevel": string("overview"|"metadata"|"sample"|"data"),
             "markdownContent": string  
        }    
    ],
    "tags": [
        {
            "name": string
        }
    ],
    "version": object(version.base),
    "currentVersion": object(version.base),
    "nextVersion": object(version.base)
}
```

## Documentation

| Fields                                                                                         |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |                                                                                                                                                        |
| ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| <p></p><p><strong>Base</strong><br></p>                                                        |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |                                                                                                                                                        |
| kind                                                                                           | <p><strong>string</strong></p><p>The resource type.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |                                                                                                                                                        |
| id                                                                                             | <p><strong>string</strong></p><p>A unique, persistent identifier for the dataset.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |                                                                                                                                                        |
| qualifiedReference                                                                             | <p><strong>string</strong><br>The fully <a href="../referencing-resources">qualified reference</a> for the dataset, of the form <code>username.dataset\_reference</code>.  E.g., <code>demo.ghcn\_daily\_weather\_data:v1\_1:7br5</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                  |                                                                                                                                                        |
| scopedReference                                                                                | <p><strong>string</strong><br>The canonical reference for the dataset, e.g., <code>ghcn\_daily\_weather\_data:v1\_1:7br5</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |                                                                                                                                                        |
| referenceId                                                                                    | <p><strong>string</strong><br>A persistent, 4-character identifier for this dataset. Will always be unique across all datasets owned by the user / organization.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |                                                                                                                                                        |
| name                                                                                           | <p><strong>string</strong></p><p>The name of the dataset</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |                                                                                                                                                        |
| url                                                                                            | <p><strong>string</strong></p><p>The table's url discoverable via the web interface.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |                                                                                                                                                        |
| uri                                                                                            | <p><strong>string</strong></p><p>The fully qualified URI of the dataset, for use in generating calls to this API. </p><p>For example, <code>/datasets/demo.ghcn\_daily\_weather\_data:v1\_1:7br5</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                   |                                                                                                                                                        |
| doi                                                                                            | <p><strong>string</strong><br>The permanent reference to the dataset, using the <a href="https://www.doi.org/">digital object identifier</a> system. Will be of the form <a href="https://doi.org/10.1109/5.771073">10.1109/5.771073</a><br><br>Will currently only be present for datasets hosted by organizations that have a DOI registry configured.</p>                                                                                                                                                                                                                                                                                                  |                                                                                                                                                        |
| owner                                                                                          | <p><strong>object</strong></p><p>The owner of the dataset. Will either be an <a href="organization">organization base definition</a> or a <a href="user">user base definition</a>.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |                                                                                                                                                        |
| <p></p><p><strong>List</strong><br></p>                                                        |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |                                                                                                                                                        |
| createdAt                                                                                      | <p><strong>integer</strong></p><p>When the dataset was created. Stored as milliseconds since the epoch (1970-01-01).</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |                                                                                                                                                        |
| updatedAt                                                                                      | <p><strong>integer</strong></p><p>When the dataset was updated. Stored as milliseconds since the epoch (1970-01-01).</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |                                                                                                                                                        |
| accessLevel                                                                                    | <p><strong>string</strong></p><p>The accessLevel of the table for the current user, ignoring the access token being used. Will be one of: <code>"none", "overview", "metadata", "data"</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                             |                                                                                                                                                        |
| publicAccessLevel                                                                              | <p><strong>string</strong></p><p>The accessLevel of the table to unauthenticated users. Will be one of: <code>"none", "overview", "metadata", "data"</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |                                                                                                                                                        |
| description                                                                                    | <p><strong>string</strong></p><p>A user-provided description of the dataset. Corresponds to the "abstract" show on the dataset overview.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |                                                                                                                                                        |
| tableCount                                                                                     | <p><strong>integer</strong></p><p>The number of tables on the dataset</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |                                                                                                                                                        |
| numBytes                                                                                       | <p><strong>integer</strong></p><p>The size of all tables stored across the current version of the dataset.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |                                                                                                                                                        |
| totalNumBytes                                                                                  | <p><strong>integer</strong></p><p>The total storage size of this dataset, across all versions.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |                                                                                                                                                        |
| totalActiveTabularBytes                                                                        | <p><strong>integer</strong><br>The total "active" bytes across all tables in this dataset, across all versions. Rows within a table become active once queried.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |                                                                                                                                                        |
| totalInactiveTabularBytes                                                                      | <p><strong>integer</strong><br>The total "inactive" bytes across all tables in this dataset, across all versions. A particular row of a table becomes inactive when it hasn't been queried in 90 days.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                    |                                                                                                                                                        |
| totalRawFileBytes                                                                              | <p><strong>integer</strong><br>The total number of bytes across all non-tabular files stored on this dataset, across all versions.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |                                                                                                                                                        |
| temporalRange                                                                                  | <p><strong>array(integer, integer)</strong></p><p>Will be null if no range has been specified. A tuple representing the start and end values for the temporal range. Stored as milliseconds since the epoch (1970-01-01).</p><p></p><p>Note that in the case where <code>temporalPrecision</code> is "year" or "date", the upper bound of this value will store one millisecond before the next offset. For example:</p><p><code>\[1980, 1982]</code>  </p><p>=> <code>\[1980-01-01 00:00:00.000, 1982-12-31 23:59:59.999]</code></p><p><code>\[1990-09-19, 1990-09-24]</code></p><p> => <code>\[1990-09-19 00:00:00.000, 1990-09-24 23:59:59.999]</code></p> |                                                                                                                                                        |
| temporalPrecision                                                                              | <p><strong>string</strong></p><p>The precision of the temporal range. Will be one of <code>"year", "date", "dateTime"</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |                                                                                                                                                        |
| geoBBox                                                                                        | <p><strong>object</strong><br>An object describing the geographic bounding box of all geographic variables in the dataset. <br><br>Will only be present for datasets containing "geography" variables, and if those variables' summary statistics have been computed (computation is performed automatically when a version of a dataset is released).</p>                                                                                                                                                                                                                                                                                                    |                                                                                                                                                        |
| <p>geoBBox<br>  .westLongitude<br>  .eastLongitude<br>  .northLatitude<br>  .southLatitude</p> | <p><strong>number</strong><br>Each property represents one side of the bounding box, expressed in numeric degrees.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |                                                                                                                                                        |
| sampleConfiguration                                                                            | <p><strong>object                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | null</strong><br>If a sample is present on this dataset, contains information about the sample configuration. Otherwise, will be <code>null</code></p> |
| sampleConfiguration.variableName                                                               | <p><strong>string</strong><br>The name of the variable that the sample is based on. May be null if the sample is a simple random sample.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |                                                                                                                                                        |
| sampleConfiguration.targetRatio                                                                | <p><strong>float</strong><br>The approximate ratio of records in the sample tables compared to the unsampled tables.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |                                                                                                                                                        |
| <p></p><p><strong>Get</strong><br></p>                                                         |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |                                                                                                                                                        |
| methodologyMarkdown                                                                            | <p><strong>string</strong><br>The methodology information documented for the dataset, in markdown format. May be null.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |                                                                                                                                                        |
| usageMarkdown                                                                                  | <p><strong>string</strong><br>The usage information documented for the dataset, in markdown format. May be null.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |                                                                                                                                                        |
| contactInfo                                                                                    | <p><strong>string</strong><br>The contact information documented for the dataset, as free text. May be null.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |                                                                                                                                                        |
| customDocumentationSections\[]                                                                 | <p><strong>array(object)</strong></p><p>An array of custom documentation sections for the dataset</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |                                                                                                                                                        |
| customDocumentationSections\[].title                                                           | <p><strong>string</strong></p><p>The title of the custom section</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |                                                                                                                                                        |
| <p>customDocumentationSections\[]</p><p>    .accessLevel</p>                                   | <p><strong>string</strong></p><p>The minimum accessLevel required to view the custom section. Will be one of <code>overview</code>,<code>metadata</code>, <code>data</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |                                                                                                                                                        |
| <p>customDocumentationSections\[]</p><p>    .markdownContent</p>                               | <p><strong>string</strong></p><p>The content of the documentation, stored as markdown. This field will be null if the current caller doesn't have the appropriate access level to view this section.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                      |                                                                                                                                                        |
| links                                                                                          | <p><strong>array(object)</strong></p><p>An array of external links with related content to the dataset</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |                                                                                                                                                        |
| links\[].title                                                                                 | <p><strong>string</strong><br>The link title</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |                                                                                                                                                        |
| links\[].url                                                                                   | <p><strong>string</strong><br>The link URL</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |                                                                                                                                                        |
| supportingFiles                                                                                | <p><strong>array(object)</strong></p><p>An array of hosted files with supporting content related to the dataset</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |                                                                                                                                                        |
| supportingFiles\[].name                                                                        | <p><strong>string</strong><br>The name of the supporting file</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |                                                                                                                                                        |
| supportingFiles\[].url                                                                         | <p><strong>string</strong><br>The download url of the supporting file. This URL will only be accessible if the calling user has the appropriate accessLevel to view this supporting file</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |                                                                                                                                                        |
| supportingFiles\[].accessLevel                                                                 | <p><strong>string</strong><br>The accessLevel required to view the supporting file. Will be one of <code>overview</code>,<code>metadata</code>, <code>data</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |                                                                                                                                                        |
| supportingFiles\[].mimeType                                                                    | <p><strong>string</strong><br>The recorded <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types">MIME type</a> of the uploaded file</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |                                                                                                                                                        |
| supportingFiles\[].size                                                                        | <p><strong>integer</strong><br>The size, in bytes, of the supporting file</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |                                                                                                                                                        |
| tags                                                                                           | <p><strong>array(object)</strong></p><p>An array of tags on this dataset.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |                                                                                                                                                        |
| tags.name                                                                                      | <p><strong>string</strong></p><p>The name of the tag</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |                                                                                                                                                        |
| version                                                                                        | <p><strong>object</strong></p><p>The version of the dataset that was requested. If no version was specified in the request, will be the dataset's current version. Returned as a <a href="version">version.base resource</a>.</p>                                                                                                                                                                                                                                                                                                                                                                                                                             |                                                                                                                                                        |
| currentVersion                                                                                 | <p><strong>object</strong></p><p>The dataset's current (latest) version. Will be null if no version has yet been released. Returned as a <a href="version">version.base resource</a>.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |                                                                                                                                                        |
| nextVersion                                                                                    | <p><strong>object</strong></p><p>The dataset's next version. Is only present if the requesting user is a dataset editor and the request is authorized for <code>data.edit</code> scope. Will be null if no pending version has been created. Returned as a <a href="version">version.base resource</a>.</p>                                                                                                                                                                                                                                                                                                                                                   |                                                                                                                                                        |
