> For the complete documentation index, see [llms.txt](https://v2.dataos.info/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://v2.dataos.info/concepts/foundations/activation/apis/getting-started/querying-data-products.md).

# Querying Data Products

A data product exposes two ways to read data.

**Semantic models** are the governed layer. They define measures, dimensions, segments, and joins in a project. Queries use member names, such as `users.plan_type` or `store_revenue.measure`, not warehouse column names. REST, Semantic SQL, GraphQL, and the Metric API all target this layer. The request is transpiled into warehouse SQL, executed on the gateway, and returned as a statement result.

**Physical models** are the underlying warehouse tables. Source SQL runs a `SELECT` written directly against those tables. It does not use the transpiler or semantic member names. Use Source SQL for ad-hoc access or for columns the semantic layer does not expose.

Most interfaces return `202 Accepted` and a statement id. You poll until the query finishes, then fetch rows. GraphQL usually returns data in one response. Long queries fall back to the same poll-and-fetch flow.

<table><thead><tr><th width="132.6046142578125">Path</th><th width="345.84765625">Input</th><th>What runs</th></tr></thead><tbody><tr><td>Semantic</td><td>REST, GraphQL, Semantic SQL, or Metric API</td><td>Transpiler → warehouse SQL → gateway</td></tr><tr><td>Physical</td><td>Source SQL</td><td>The <code>SELECT</code> statement → gateway</td></tr></tbody></table>

Member names use `model.column`. Time buckets add a granularity suffix (`users.signup_date.month`).

Use these pages to choose the right interface and understand shared query behavior.

{% hint style="info" %}
Semantic interfaces target the same governed layer. Most of them use submit, poll, then fetch.
{% endhint %}

### Choose an interface

<table data-view="cards"><thead><tr><th>Title</th><th data-card-target data-type="content-ref">Target</th></tr></thead><tbody><tr><td><strong>REST</strong><br>Use JSON queries for precise programmatic control.</td><td><a href="/pages/dpV4c6mjQFAAiOm3Bn4k">/pages/dpV4c6mjQFAAiOm3Bn4k</a></td></tr><tr><td><strong>Semantic SQL</strong><br>Use SQL syntax on top of semantic models.</td><td><a href="/pages/rxjBV6xx2KWETvmpvRmr">/pages/rxjBV6xx2KWETvmpvRmr</a></td></tr><tr><td><strong>GraphQL</strong><br>Use typed field selection and schema introspection.</td><td><a href="/pages/3D0SbSW7ssLWgHFFONW2">/pages/3D0SbSW7ssLWgHFFONW2</a></td></tr><tr><td><strong>Metrics</strong><br>Use the shortest path for querying <code>METRIC</code> models.</td><td><a href="/pages/gLJLzsmjcSPHmEfzxMoc">/pages/gLJLzsmjcSPHmEfzxMoc</a></td></tr><tr><td><strong>Source SQL</strong><br>Use direct <code>SELECT</code> access to physical tables.</td><td><a href="/pages/5xQ1xlU7yiamdtObYWyz">/pages/5xQ1xlU7yiamdtObYWyz</a></td></tr></tbody></table>

### Quick guidance

{% columns %}
{% column %}

#### Use semantic interfaces when

* Governed measures and dimensions are required.
* Model-aware joins and segments are required.
* Queries need to use member names.
  {% endcolumn %}

{% column %}

#### Use Source SQL when

* Direct physical table access is required.
* Raw warehouse SQL control is required.
* The semantic layer does not expose a field.
  {% endcolumn %}
  {% endcolumns %}

### Shared reference

* [Statement lifecycle](/concepts/foundations/activation/apis/getting-started/querying-data-products/statement-lifecycle.md) — async execution, polling, results, and deduplication.
* [Measure and dimension behavior](/concepts/foundations/activation/apis/getting-started/querying-data-products/measure-and-dimension-behavior.md) — how measures and dimensions behave in queries.
* [Cross-model queries](/concepts/foundations/activation/apis/getting-started/querying-data-products/cross-model-queries.md) — join direction, fan-out, and join hints.
* [GraphQL vs REST](/concepts/foundations/activation/apis/getting-started/querying-data-products/graphql-vs-rest.md) — compare capabilities and trade-offs.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://v2.dataos.info/concepts/foundations/activation/apis/getting-started/querying-data-products.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
