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

# Data models overview

> How Ocular's data models are organized — sales, fulfilment, customer activity, and ads — and the dimensions and metrics you'll use when querying.

Ocular exposes your data through a **semantic layer** rather than raw database tables. You query named entities (cubes) with predefined measures and dimensions, not SQL against underlying tables. This page explains the building blocks so the per-cube reference pages make sense.

## Why a semantic layer

Raw tables change shape over time, require deep schema knowledge, and force every team to re-derive the same metrics. The semantic layer fixes definitions in one place — "revenue", "orders", "unique customers" mean the same thing across every dashboard, report, and ad-hoc query. You query the model, not the warehouse.

## Building blocks

<CardGroup cols={2}>
  <Card title="Cube" icon="cube">
    An entity you can query — for example, **Sales**, **Customer Activity**, **Fulfilment**. Each cube is a logical view of one part of your business.
  </Card>

  <Card title="Measure" icon="calculator">
    A numeric value the cube can compute — `total_revenue`, `order_count`, `aov`. Measures are aggregations; you don't sum them yourself.
  </Card>

  <Card title="Dimension" icon="tags">
    A field you can group or filter by — `order_date`, `marketing_channel`, `country`. Dimensions slice measures.
  </Card>

  <Card title="Segment" icon="filter">
    A named, reusable filter — `repeat_customers`, `paid_traffic_only`. Apply a segment instead of rewriting the same `WHERE` clause.
  </Card>

  <Card title="Join" icon="link">
    A defined relationship between two cubes — lets you query measures from one cube sliced by dimensions of another (e.g. revenue by ad campaign).
  </Card>

  <Card title="Time dimension" icon="calendar">
    A dimension you can roll up by day, week, month, or quarter — used for all time-series analysis.
  </Card>
</CardGroup>

## How to read a cube reference page

Each cube in this section follows the same structure:

1. **What it represents** — the slice of your business the cube models.
2. **Measures** — every numeric value you can ask for.
3. **Dimensions** — every field you can group or filter by.
4. **Segments** — predefined filters.
5. **Joins** — which other cubes you can pull in.
6. **Example queries** — common questions answered by this cube.

## Available cubes

<CardGroup cols={2}>
  <Card title="Sales" icon="chart-line" href="/data-models/sales">
    Orders, revenue, AOV, refunds.
  </Card>

  <Card title="Customer Activity" icon="users" href="/data-models/customer-activity">
    New vs. repeat customers, cohorts, retention.
  </Card>

  <Card title="Fulfilment" icon="truck" href="/data-models/fulfilment">
    Shipments, delivery status, RTOs, returns.
  </Card>
</CardGroup>

## What this section is *not*

This is a reference for the **semantic layer**, not the underlying warehouse tables. If you're looking for raw table schemas, those aren't exposed — every query goes through a cube. If a measure or dimension you need is missing, request it from your Ocular account team rather than trying to query the warehouse directly.
