Getting Started
Step-by-step tutorial for writing semantic domain templates by hand or programmatically
Semantic domains can be built through the UI or by writing YAML/JSON templates directly. This guide walks you through building a complete domain template from scratch, one concept at a time.
When to use template editing:
- Bulk configuration of many fields or datasets
- Version-controlled domains stored in Git
- CI/CD pipelines that deploy domain changes automatically
- Copying configurations between environments
- AI agents or scripts generating domains programmatically
How to access the Code Editor:
- Open your domain in the Domain Editor
- Click the Code Editor tab
- Toggle between YAML and JSON format
- Edit the template and click Save
Minimal Template
The smallest valid domain template:
All other top-level fields are optional and default to empty. The full skeleton:
Guide Sections
Datasets & Fields
Define datasets (physical or virtual) and their fields (identifiers, dimensions, metrics)
Relationships
Configure joins between datasets for automatic multi-table queries
Inline Expressions
Define inline SQL transforms and display formatting on dataset metrics
Calculated Fields
Create reusable KPIs, custom groupings, and learn when to use each type
SQL Generation
Understand how templates translate to executable SQL queries
Validation & Examples
Complete domain example and validation error reference