Skip to main content

Semantic Model Setup

Building a robust analytics layer starts with a clear, reusable semantic model. This guide shows how to turn raw synced tables into business-ready entities, link them together, and expose trusted metrics.

Key concepts​

TermDefinition
EntityA logical representation of a table or dataset. Contains dimensions, measures, and relations.
DimensionA descriptive attribute — date, company name, status, etc.
MeasureA numeric metric, usually aggregated — sales amount, deal count, …
RelationA logical link between two entities. Always declared in both directions.
Semantic modelA connected set of entities forming a domain graph.
Access control

Only users with the Admin role can manage the semantic model.

Interface overview​

Here is a quick tour of the modeling workspace.

Cubes list in the semantic model

Opening the semantic model​

Click the Semantic Model icon (two connected circles) in the sidebar to open the modeling area from anywhere in the app.

Cubes tab​

Lists all cubes deployed to your organization. Click any row to open the read-only cube definition.

Read-only cube definition opened from the Cubes tab

Graph tab​

An interactive map of all cubes and their relations.

Cubes graph

Managing cubes​

Cubes are authored and deployed with the RevOS CLI. See the RevOS CLI docs.

Relation types and when to use them​

TypeQuick descriptionExampleHow to set
one_to_oneEach A has exactly one BCompany ↔️ Company profile"relationship": "one_to_one"
one_to_manyOne A owns many BCompany → Invoices"one_to_many"
many_to_oneMany A refer to one BInvoice → Company"many_to_one"
Declare relations in both directions

Declare each relation in both entities. If deals have many_to_one to companies, companies must have the mirror one_to_many to deals. Otherwise RevOS can't find a path between them.

Modeling many-to-many​

A direct many_to_many relation is not supported. Instead, create a junction entity — a link table with pairs of keys. Both original entities connect to it with one-to-many / many-to-one relations, which keeps the source tables clean and avoids duplicates.

Example (HubSpot deals ↔️ companies):

  1. Create the entity company_deal_link based on the companies table.
  2. In SQL, unnest the deal_ids JSON array: UNNEST(deal_ids) AS deal_id.
  3. Relations:
    • companies ↔️ company_deal_link — one_to_many / many_to_one.
    • deals ↔️ company_deal_link — one_to_many / many_to_one.

Dimensions and measures​

For the full reference on defining dimensions, measures, and their types, see the RevOS CLI docs.