MML Overview
Modality Modeling Language (MML) is a declarative language for defining data models in a version-controllable format.
Key Features
- Human-Readable: MML files are text-based and easy to understand
- Git-Friendly: Designed for version control with meaningful diffs
- Declarative: Describe what you want, not how to build it
- Hierarchical: Natural nesting matches your data model structure
File Organization
MML files are organized in a project directory structure:
my-project/
├── modality_project.yaml # Project configuration
└── modality/
├── models/
│ ├── conceptual/ # Entity relationship models
│ │ ├── sales.mml
│ │ └── marketing.mml
│ ├── logical/ # Source mappings
│ │ └── mappings.mml
│ └── physical/ # Physical schema (auto-generated)
│ └── schema.mml
├── products/ # Data products
│ └── customer_analytics.mml
└── estimates/ # Effort estimates
└── estimates.mmlBasic Example
Here's a simple MML file defining a sales domain:
mml
domain "Sales" {
color = "#3498db"
description = "Sales and revenue tracking"
entity "Customer" {
type = "entity"
description = "Customer master data"
belongs-to "Platform.User"
}
entity "Order" {
type = "entity"
description = "Customer orders"
belongs-to "Customer"
}
}Block Types
MML supports several block types organized across conceptual, logical, and physical models:
Conceptual Model
| Block | Purpose | File Location |
|---|---|---|
domain | Business domains | models/conceptual/ |
entity | Entities, metrics, and derivations | Inside domains |
Logical Model
| Block | Purpose | File Location |
|---|---|---|
source | Source systems with entity mappings | models/logical/ |
Physical Model
| Block | Purpose | File Location |
|---|---|---|
physical_model | Database tables, fields, and indexes | models/physical/ |
table | Table definitions | Inside physical_model |
field | Field definitions | Inside tables |
index | Index definitions | Inside tables |
foreign_key | Foreign key relationships | Inside fields |
Data Products
| Block | Purpose | File Location |
|---|---|---|
data_product | Data products | products/ |
report | Reports and dashboards | Inside products |
metric | Metrics and calculations | Inside reports |
Planning
| Block | Purpose | File Location |
|---|---|---|
entity_estimate | Entity development estimates | estimates/ |
source_estimate | Source integration estimates | estimates/ |
report_estimate | Report development estimates | estimates/ |
roadmap | Roadmap configuration | roadmap/ |
task | Development tasks | roadmap/ |
