Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions core-spec/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ semantic_model:
description: Sales and customer analytics model
ai_context:
instructions: "Use this model for sales analysis and customer insights"
datasets: []
datasets:
- name: orders
source: sales.public.orders
relationships: []
metrics: []
custom_extensions:
Expand Down Expand Up @@ -337,8 +339,9 @@ expression:
```yaml
- name: total_revenue
expression:
- dialect: ANSI_SQL
expression: SUM(orders.amount)
dialects:
- dialect: ANSI_SQL
expression: SUM(orders.amount)
description: Total revenue across all orders
ai_context:
synonyms:
Expand All @@ -351,8 +354,9 @@ expression:
```yaml
- name: avg_orders
expression:
- dialect: ANSI_SQL
expression: SUM(orders.amount) / COUNT(DISTINCT customers.id)
dialects:
- dialect: ANSI_SQL
expression: SUM(orders.amount) / COUNT(DISTINCT customers.id)
description: Average orders
ai_context:
synonyms:
Expand Down Expand Up @@ -445,6 +449,7 @@ The following are well-known examples:
Here's a complete semantic model example showing all components working together:

```yaml
version: 0.2.0.dev0
semantic_model:
- name: ecommerce_analytics
description: E-commerce sales and customer analytics
Expand Down
6 changes: 2 additions & 4 deletions core-spec/spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,9 @@ datasets:
# Can be a single column or a composite of multiple columns
# This is the preferred unique identifier for this dataset and is used in relationships to determine many-to-one or one-to-one.
# Examples:
# primary_key:
# - [customer_id] # Simple primary key
# primary_key: [customer_id] # Simple primary key
#
# primary_key:
# - [order_id, line_number] # Composite primary key
# primary_key: [order_id, line_number] # Composite primary key
primary_key: [] # Array of column names (single or composite)

# Optional: Array of unique key definitions that uniquely identify rows in this dataset
Expand Down