Skip to content

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.mml

Basic 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

BlockPurposeFile Location
domainBusiness domainsmodels/conceptual/
entityEntities, metrics, and derivationsInside domains

Logical Model

BlockPurposeFile Location
sourceSource systems with entity mappingsmodels/logical/

Physical Model

BlockPurposeFile Location
physical_modelDatabase tables, fields, and indexesmodels/physical/
tableTable definitionsInside physical_model
fieldField definitionsInside tables
indexIndex definitionsInside tables
foreign_keyForeign key relationshipsInside fields

Data Products

BlockPurposeFile Location
data_productData productsproducts/
reportReports and dashboardsInside products
metricMetrics and calculationsInside reports

Planning

BlockPurposeFile Location
entity_estimateEntity development estimatesestimates/
source_estimateSource integration estimatesestimates/
report_estimateReport development estimatesestimates/
roadmapRoadmap configurationroadmap/
taskDevelopment tasksroadmap/

Next Steps

Released under the MIT License.