> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cognite.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Asset-centric OData service

> Connect Cognite Data Fusion as a data source and use OData clients to query, transform, and visualize data stored in CDF asset-centric resources.

The asset-centric <span translate="no">OData</span> service lets you access <span translate="no">CDF</span> resources such as <span translate="no">assets</span>, <span translate="no">time series</span>, <span translate="no">events</span>, <span translate="no">files</span>, <span translate="no">sequences</span>, and <span translate="no">RAW</span> data via an <span translate="no">OData</span> API.

The asset-centric <span translate="no">OData</span> service accepts URLs with the following schema:

```
https://{cluster}.cognitedata.com/odata/{apiVersion}/projects/{project}
```

Where:

* `{cluster}`: the name of the <span translate="no">CDF</span> cluster, e.g., `westeurope-1`.
* `{apiVersion}`: the version of the <span translate="no">OData</span> service API (latest is `v1`).
* `{project}`: the name of the <span translate="no">CDF</span> project, e.g., `publicdata`.

If you point the <span translate="no">OData</span> client to the correct asset-centric <span translate="no">OData</span> URL and [authenticate](/cdf/access/concepts/authentication_flows_oidc), the server returns a table with all asset-centric types currently supported by the <span translate="no">OData</span> service in addition to [supported <span translate="no">OData</span> functions](#supported-odata-functions).

<a id="filtering-asset-centric-resource-types" />

## Filtering asset-centric resource types

The asset-centric OData service can push filters down to <span translate="no">CDF</span>. This improves performance by ensuring that filtering happens on the server side, reducing the amount of data transmitted to the client.

<a id="filtering-options" />

### Filtering options

* **Pushdown**: Filter functions that are pushed down to the <span translate="no">CDF</span> backend. This is the most efficient filtering.
* **Local**: Filtering done by the<span translate="no"> OData</span> service before returning the result to the client. Less efficient than pushdown.
* **Client-side**: Filtering done by the client after data is retrieved. Least efficient.

<a id="definitions" />

### Definitions

* **FilterFunctions**: `Contains`, `StartsWith`, and `EndsWith`.
* **Comparison**: `<`, `<=`, `>`, `>=`, and `=`.
* **Search**: uses the search API and may require additional local filtering.

<Info>
  Search returns a limited number of rows, and you may not receive all matching data in <span translate="no">CDF</span>.
</Info>

<a id="assets" />

### <span translate="no">Assets</span>

| Property                      | Pushdown        | Local              |
| ----------------------------- | --------------- | ------------------ |
| `Id`                          | =               | =                  |
| `ExternalId`                  | =, `StartsWith` | =, FilterFunctions |
| `Name`                        | =, Search       | =, FilterFunctions |
| `Description`                 | Search          | =, FilterFunctions |
| `ParentId`                    | =               | =                  |
| `ParentExternalId`            | =               | =                  |
| `DataSetId`                   | =               | =                  |
| `Source`                      | =               | =                  |
| [`MetaData`](#custom-queries) | =               |                    |
| `RootId`                      | =               | =                  |
| `CreatedTime`                 | Comparison      | Comparison         |
| `LastUpdatedTime`             | Comparison      | Comparison         |

<a id="time-series" />

### <span translate="no">Time series</span>

| Property                      | Pushdown        | Local              |
| ----------------------------- | --------------- | ------------------ |
| `Id`                          | =               | =                  |
| `ExternalId`                  | =, `StartsWith` | =, FilterFunctions |
| `Name`                        | =, Search       | =, FilterFunctions |
| `Description`                 | Search          | =, FilterFunctions |
| `IsString`                    | =               | =                  |
| [`MetaData`](#custom-queries) | =               |                    |
| `Unit`                        | =               | =                  |
| `IsStep`                      | =               | =                  |
| `AssetId`                     | =               | =                  |
| `SecurityCategories`          |                 |                    |
| `DataSetId`                   | =               | =                  |
| `CreatedTime`                 | Comparison      | Comparison         |
| `LastUpdatedTime`             | Comparison      | Comparison         |

<a id="data-point" />

### <span translate="no">Data point</span>

| Property    | Pushdown   | Local      |
| ----------- | ---------- | ---------- |
| `Id`        | =          | =          |
| `TimeStamp` | Comparison | Comparison |

<a id="events" />

### <span translate="no">Events</span>

| Property                      | Pushdown        | Local              |
| ----------------------------- | --------------- | ------------------ |
| `Id`                          | =               | =                  |
| `ExternalId`                  | =, `StartsWith` | FilterFunctions    |
| `Description`                 | Search          | =, FilterFunctions |
| `Source`                      | =               | =                  |
| `Type`                        | =               | =                  |
| `SubType`                     | =               | =                  |
| [`MetaData`](#custom-queries) | =               |                    |
| `DataSetId`                   | =               | =                  |
| `StartTime`                   | Comparison      | Comparison         |
| `EndTime`                     | Comparison      | Comparison         |
| `CreatedTime`                 | Comparison      | Comparison         |
| `LastUpdatedTime`             | Comparison      | Comparison         |
| `AssetIds`                    | `Contains`      | `Contains`         |

<a id="files" />

### <span translate="no">Files</span>

| Property             | Pushdown        | Local              |
| -------------------- | --------------- | ------------------ |
| `Id`                 | =               | =                  |
| `ExternalId`         | =, `StartsWith` | =, FilterFunctions |
| `Name`               | =, Search       | =, FilterFunctions |
| `Source`             | =               | =                  |
| `MimeType`           | =               | =                  |
| `MetaData`           |                 |                    |
| `DataSetId`          | =               | =                  |
| `SourceCreatedTime`  | Comparison      | Comparison         |
| `SourceModifiedTime` | Comparison      | Comparison         |
| `CreatedTime`        | Comparison      | Comparison         |
| `LastUpdatedTime`    | Comparison      | Comparison         |
| `UploadedTime`       | Comparison      | Comparison         |
| `Uploaded`           | =               | =                  |
| `AssetIds`           | `Contains`      | `Contains`         |

<a id="sequences" />

### <span translate="no">Sequences</span>

| Property          | Pushdown     | Local              |
| ----------------- | ------------ | ------------------ |
| `Id`              | \*           | =                  |
| `ExternalId`      | `StartsWith` | =, `StartsWith`    |
| `Name`            | =, Search    | =, FilterFunctions |
| `Description`     | =, Search    | =, FilterFunctions |
| `MetaData`        |              |                    |
| `AssetId`         | =            | =                  |
| `DataSetId`       | =            | =                  |
| `CreatedTime`     | Comparison   | Comparison         |
| `LastUpdatedTime` | Comparison   | Comparison         |
| `Columns`         |              |                    |

<Note>
  Supported via the `Sequences(id)` syntax.
</Note>

<a id="cdf-raw-databases" />

### <span translate="no">CDF RAW</span> databases

| Property | Pushdown | Local |
| -------- | -------- | ----- |
| `Name`   | =        | =     |

<a id="cdf-raw-tables" />

### <span translate="no">CDF RAW</span> tables

| Property | Pushdown | Local |
| -------- | -------- | ----- |
| `Name`   | =        | =     |

<a id="cdf-raw-rows" />

### <span translate="no">CDF RAW</span> rows

| Property          | Pushdown   | Local             |
| ----------------- | ---------- | ----------------- |
| `Key`             | =          | =, FilterFunction |
| `LastUpdatedTime` | Comparison | Comparison        |

<a id="supported-odata-functions" />

## Supported OData functions

<a id="assetsroots" />

### AssetsRoots

Fetch the root assets for a <span translate="no">CDF</span> project.

| Parameter     | Type | Description |
| ------------- | ---- | ----------- |
| No parameters |      |             |

<a id="assetssearch" />

### AssetsSearch

Search assets in a <span translate="no">CDF</span> project.

| Parameter | Type | Description                                                                                                                                                                                                  |
| --------- | ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `Search`  | Text | Whitespace-separated terms to search for in assets. Does a best-effort fuzzy search in relevant fields (currently `name` and `description`) for variations of any search terms. Orders results by relevance. |

<a id="eventssearch" />

### EventsSearch

Search events in a <span translate="no">CDF</span> project.

| Parameter | Type | Description                                                                                                                                                                                       |
| --------- | ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Search`  | Text | Whitespace-separated terms to search for in events. Does a best-effort fuzzy search in relevant fields (currently `description`) for variations of any search terms. Orders results by relevance. |

<a id="timeseriesaggregate" />

### TimeseriesAggregate

Aggregate data points from multiple time series.

| Parameter     | Type            | Description                                                                                        |
| ------------- | --------------- | -------------------------------------------------------------------------------------------------- |
| `Tags`        | Text            | A comma-separated list of time series IDs or external IDs to include in the query.                 |
| `Granularity` | Text            | The granularity used to fetch data point aggregates.                                               |
| `Start`       | Text            | Get datapoints starting from and including this time.                                              |
| `End`         | Text (optional) | Get datapoints up to, but excluding, this point in time. If no value is provided, defaults to now. |

<a id="timeseriessearch" />

### TimeseriesSearch

Search time series in a <span translate="no">CDF</span> project.

| Parameter | Type | Description                                                                                                                                                                                                            |
| --------- | ---- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Search`  | Text | A whitespace-separated terms to search for in time series. Does a best-effort fuzzy search in relevant fields (currently `name` and `description`) for variations of any search terms and orders results by relevance. |
