diff --git a/core-spec/spec.md b/core-spec/spec.md index 8b9c10a..67a4b98 100644 --- a/core-spec/spec.md +++ b/core-spec/spec.md @@ -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: @@ -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: @@ -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: @@ -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 diff --git a/core-spec/spec.yaml b/core-spec/spec.yaml index 7229e08..3265e79 100644 --- a/core-spec/spec.yaml +++ b/core-spec/spec.yaml @@ -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