Sample model

The model behind every picture

A small, invented order-to-cash and inventory model, laid out the way a Fabric lakehouse and warehouse usually are. It is deliberately ordinary, so the structure is the interesting part.

At a glance

Loading the model…

Raw file: data/sample-model.json. It is generated by tools/build_sample_model.py in the repo, which is the easiest place to read the whole model top to bottom.

Tables by layer

The JSON shape

Six top-level keys. Only layers, tables and columnLineage are required; the rest switch on extra views.

KeyWhat it holdsUsed by
layersid, name, order, description. Ids map to the layer colors: source, bronze, silver, gold, semantic, report.Everything
tablesid, layer, schema, name, kind (source, raw, entity, fact, dimension, semantic-table, measure-table, report), optional grain, scd, fact_type, and columns with name, type, optional key (PK, FK, SK, BK, DD), hidden, expression.Everything
columnLineageEdges {from, to, transform} between column ids, where a column id is <table id>.<column name>. Table lineage is derived from these.Lineage flow, column tracer, engine cake, data anatomy, semantic engine
relationshipsSemantic-model relationships: fact, from, dim, to, cardinality (*:1 or *:*), active, optional role and note.Star schema, bus matrix, semantic engine
hierarchiesDrill paths in the semantic model: table, name and ordered levels (column names, top first).Semantic engine
engineThe analytic engine layers, top to bottom, with what each does.Engine cake
pipelineConfigExample rows of a metadata-driven load control table.This page

Swapping in your own model

Each piece of the JSON has a natural source in a real platform. None of these exports needs anything exotic:

  • Tables and columns: INFORMATION_SCHEMA.COLUMNS from the Warehouse and the lakehouse SQL analytics endpoint, one query per layer.
  • Bronze and silver lineage: the pipeline config table already says which source object lands in which target; column edges are pass-through by default, then hand-annotate the renames and derivations.
  • Gold lineage: parse the load stored procedures, or keep a small mapping table next to them. A mapping table you maintain beats a parser you don't.
  • Semantic layer and measures: the TMDL or model.bim export of the semantic model, or INFO.TABLES(), INFO.COLUMNS(), INFO.RELATIONSHIPS() and INFO.MEASURES() DAX functions run from a notebook with semantic link.
  • Report visuals: the report definition (PBIR) lists each visual's fields and measures.
In Microsoft Fabric

A single notebook can do all of it: query the SQL endpoints for columns, read the control table for bronze, call semantic link for the model, and write one JSON file to a lakehouse Files folder. Commit that file here and every exploration redraws with your model.

Pipeline config sample

The control rows that would load this model in a metadata-driven pipeline. See metadata-driven pipelines for the pattern.