MATIH Platform is in active MVP development. Documentation reflects current implementation status.
10. Data Catalog & Governance
Semantic Layer
Semantic Models

Semantic Models

Semantic Models are the foundation of the Semantic Layer. Each model represents a logical data entity backed by a physical table or view, and defines the metrics (measures) and dimensions (attributes) available for querying. Models are managed through the MDL (Model Definition Language) service and follow a lifecycle from draft to published.


Model Structure

A semantic model contains the following components.

ComponentDescription
NameUnique identifier within the tenant
Table referencePhysical table or view backing the model
MetricsAggregatable measures (revenue, count, average)
DimensionsCategorical or temporal grouping attributes
RelationshipsJoins to other models
Data sourceConnection to the underlying data platform

Model Status Lifecycle

StatusDescription
DRAFTModel is being authored and is not available for queries
PUBLISHEDModel is validated and available for metric queries
DEPRECATEDModel is being phased out and will be removed

MDL Definition

Models are defined using MDL (Model Definition Language) declarations. Each MDL definition specifies models, metrics, dimensions, and their configurations.

{
  "name": "sales_analytics",
  "description": "Sales data model for analytics",
  "models": [
    {
      "name": "orders",
      "tableName": "delta.sales.orders",
      "metrics": [
        {
          "name": "total_revenue",
          "type": "SUM",
          "expression": "order_total",
          "description": "Sum of all order totals"
        },
        {
          "name": "order_count",
          "type": "COUNT",
          "expression": "*",
          "description": "Total number of orders"
        }
      ],
      "dimensions": [
        {
          "name": "order_date",
          "type": "TIMESTAMP",
          "expression": "created_at",
          "isTimeDimension": true
        },
        {
          "name": "region",
          "type": "STRING",
          "expression": "shipping_region"
        }
      ]
    }
  ]
}

Metric Types

TypeDescription
SUMSum of values
COUNTCount of rows
COUNT_DISTINCTCount of distinct values
AVERAGEMean of values
MINMinimum value
MAXMaximum value
MEDIAN50th percentile
PERCENTILEArbitrary percentile
DERIVEDComputed from other metrics (formula)
RATIORatio of two metrics
CUMULATIVERunning total over time
PERIOD_OVER_PERIODPeriod comparison (YoY, MoM)

Dimension Types

TypeDescription
STRINGCategorical text values
INTEGERWhole number values
DECIMALFloating-point values
BOOLEANTrue/false values
DATEDate only (no time component)
TIMESTAMPDate and time
TIMETime only (no date component)
GEO_POINTGeographic coordinates
GEO_POLYGONGeographic polygon shapes
JSONComplex JSON objects
ARRAYArray values

MDL Endpoints

MethodPathDescription
GET/api/v1/mdlList all MDL definitions
GET/api/v1/mdl/:mdlIdGet an MDL definition by ID
GET/api/v1/mdl/by-name/:nameGet the latest MDL definition by name
GET/api/v1/mdl/by-name/:name/versionsGet all versions of an MDL definition
POST/api/v1/mdlCreate a new MDL definition
PUT/api/v1/mdl/:mdlIdUpdate an MDL definition
POST/api/v1/mdl/:mdlId/validateValidate an MDL definition
POST/api/v1/mdl/:mdlId/publishPublish an MDL definition
DELETE/api/v1/mdl/:mdlIdDelete an MDL definition

Validation

Before an MDL definition can be published, it must pass validation. Validation checks include:

  • All referenced tables exist in the configured catalogs
  • Metric expressions are valid SQL aggregations
  • Dimension expressions reference valid columns
  • Relationship join keys exist in both source and target models
  • No circular dependencies between models

Best Practices

  • Define one model per logical business entity (orders, customers, products)
  • Use meaningful metric names that business users can understand
  • Mark time columns with isTimeDimension: true for temporal analysis
  • Validate models before publishing to catch configuration errors early
  • Use the versioning system to track changes to metric definitions over time