How to connect concepts, rules, and business meaning across your metadata mesh
Summary
As we scale metadata-driven modeling across teams, we eventually hit a new challenge:
We know how data flows — but do we know what it means?
We can trace lineage and structure across thousands of tables, yet still struggle to answer basic business questions like:
- What exactly is a “Customer”?
- How does “Revenue” differ between domains?
- Which policies govern “Personal Data”?
To solve this, we need a Semantic Layer — a layer of meaning that links metadata, business rules, and governance policies into a unified understanding.

1. From Metadata to Semantics
Let’s recap the evolution so far:

The semantic layer doesn’t replace metadata — it enriches it. It connects entities to their business definitions, rules, and governance context.
2. Why a Semantic Layer?
Metadata tells us how data is structured.
Semantics tell us why it matters.
Without semantics:
- Business terms drift across teams.
- Models become technically correct but contextually inconsistent.
- Policy compliance (e.g., GDPR, PII) becomes manual and error-prone.
By adding semantics:
- Business terms become shared vocabulary.
- Models are self-describing and policy-aware.
- Governance and analytics become traceable and explainable.
3. Defining Semantics in YAML
Let’s extend our YAML model structure to include business meaning and policy links.
layer: conceptual
entity: Customer
definition: A person or organization that purchases goods or services.
aliases:
– Client
– Buyer
business_rules:
– rule_id: R001
description: A customer must have at least one valid contact point.
– rule_id: R002
description: A customer may have multiple active contracts.
policies:
– policy_id: GDPR01
category: Privacy
applies_to: PersonalData
description: Customer attributes containing personal information must be masked.
tags:
– domain: sales
– pii: true
This adds meaning, governance, and discoverability — all as metadata.
4. Linking Semantics to Logical and Physical Layers
Once defined, semantic links cascade automatically:

Each link carries its semantic context downstream — enabling:
- Policy enforcement (e.g., masking all PII)
- Consistent naming and reporting
- Traceable compliance across systems
5. Storing the Semantic Layer in DuckDB
Let’s extend the metadata schema:
CREATE TABLE metadata.semantics (
concept TEXT,
definition TEXT,
aliases TEXT[],
policy_refs TEXT[],
rule_refs TEXT[],
tags TEXT[]
);
Now, you can join semantics with entities:
SELECT e.layer, e.entity, s.definition, s.policy_refs
FROM metadata.entities e
LEFT JOIN metadata.semantics s ON e.entity = s.concept;
This allows you to query — or even visualize — meaning as part of your metadata lineage.
6. Visualizing the Semantic Network
You can use tools like pyvis or Graphviz to visualize semantic relationships:
import duckdb
from pyvis.network import Network
net = Network(height=”700px”, width=”100%”, directed=False)
conn = duckdb.connect(“data/metadata_mesh.duckdb”)
for concept, alias in conn.execute(“SELECT concept, unnest(aliases) FROM metadata.semantics”).fetchall():
net.add_node(concept, color=”#2b8ee6”)
net.add_node(alias, color=”#f5a623”)
net.add_edge(concept, alias, title=”alias”)
net.show(“semantic_network.html”)
This produces a knowledge graph of business meaning, automatically generated from metadata.
7. Integrating Business Glossaries and Policies
To make semantics truly useful, link them with:
- Business glossaries (from Notion, Confluence, or Collibra)
- Policy repositories (GDPR, SOX, internal data ethics)
- Quality rules and data contracts
Each term in the glossary maps to one or more metadata entities:
SELECT concept, COUNT(entity)
FROM metadata.entities
WHERE derived_from LIKE ‘conceptual.%’
GROUP BY concept;
This bridges the gap between data modeling and governance.
8. Semantic Validation Rules
Semantic metadata can also enforce policy-level validation. For example, all entities tagged as pii: true must have a masking rule.
SELECT e.entity
FROM metadata.entities e
LEFT JOIN metadata.quality_rules r ON e.entity = r.entity
WHERE e.tags LIKE ‘%pii%’ AND r.name NOT LIKE ‘%mask%’;
This gives you governance as code — automatic, explainable, and traceable.
9. Benefits of the Semantic Layer

Semantics transform metadata from structural description into organizational knowledge.
10. In Summary
The Semantic Layer turns your metadata mesh into an enterprise knowledge fabric:
- Every entity has a meaning.
- Every attribute has a policy.
- Every rule is traceable.
This is the layer where data modeling meets knowledge management — and where architecture finally connects with governance and AI.
11. Next in the Series
“From Semantics to AI: Using Metadata Knowledge Graphs to Power Intelligent Documentation and Model Generation.”
We’ll explore how semantic metadata can drive AI-assisted modeling, automated documentation, and contextual reasoning.