# Ontologies, Context Graphs, and Semantic Layers

Source: [Metadata Weekly article](https://metadataweekly.substack.com/p/ontologies-context-graphs-and-semantic)  
HTML companion: [../webpages/ontologies-context-graphs-semantic-layers-gpt5-chat-1.html](../webpages/ontologies-context-graphs-semantic-layers-gpt5-chat-1.html)  
RDF source: [../rdf/ontologies-context-graphs-semantic-layers-gpt5-chat-1.ttl](../rdf/ontologies-context-graphs-semantic-layers-gpt5-chat-1.ttl)

## Overview

This Markdown companion mirrors the RDF-backed HTML infographic. The source article argues that a [semantic layer](https://linkeddata.uriburner.com/describe/?url=https%3A%2F%2Fmetadataweekly.substack.com%2Fp%2Fontologies-context-graphs-and-semantic%23semantic-layer) is valuable for governed metrics, but AI systems need richer [knowledge architecture](https://linkeddata.uriburner.com/describe/?url=https%3A%2F%2Fmetadataweekly.substack.com%2Fp%2Fontologies-context-graphs-and-semantic%23knowledge-architecture) that includes [ontologies](https://linkeddata.uriburner.com/describe/?url=https%3A%2F%2Fmetadataweekly.substack.com%2Fp%2Fontologies-context-graphs-and-semantic%23ontology), [knowledge graphs](https://linkeddata.uriburner.com/describe/?url=https%3A%2F%2Fmetadataweekly.substack.com%2Fp%2Fontologies-context-graphs-and-semantic%23knowledge-graph), and [context graphs](https://linkeddata.uriburner.com/describe/?url=https%3A%2F%2Fmetadataweekly.substack.com%2Fp%2Fontologies-context-graphs-and-semantic%23context-graph).

## Core Entities

- [Semantic layer](https://linkeddata.uriburner.com/describe/?url=https%3A%2F%2Fmetadataweekly.substack.com%2Fp%2Fontologies-context-graphs-and-semantic%23semantic-layer) - governed metric definitions, dimensional models, SQL generation, and reporting consistency.
- [Ontology](https://linkeddata.uriburner.com/describe/?url=https%3A%2F%2Fmetadataweekly.substack.com%2Fp%2Fontologies-context-graphs-and-semantic%23ontology) - formal concept, property, relationship, and constraint model.
- [Knowledge graph](https://linkeddata.uriburner.com/describe/?url=https%3A%2F%2Fmetadataweekly.substack.com%2Fp%2Fontologies-context-graphs-and-semantic%23knowledge-graph) - entity and relationship graph for machine-readable context.
- [Context graph](https://linkeddata.uriburner.com/describe/?url=https%3A%2F%2Fmetadataweekly.substack.com%2Fp%2Fontologies-context-graphs-and-semantic%23context-graph) - operational graph for decision traces, authority, procedures, precedent, and justification.
- [Knowledge architecture](https://linkeddata.uriburner.com/describe/?url=https%3A%2F%2Fmetadataweekly.substack.com%2Fp%2Fontologies-context-graphs-and-semantic%23knowledge-architecture) - the broader discipline of designing semantic systems for human and AI reasoning.

## Glossary

This section mirrors the RDF [`schema:DefinedTermSet`](https://linkeddata.uriburner.com/describe/?url=https%3A%2F%2Fmetadataweekly.substack.com%2Fp%2Fontologies-context-graphs-and-semantic%23glossary).

| Term | Definition |
|---|---|
| [Semantic layer](https://linkeddata.uriburner.com/describe/?url=https%3A%2F%2Fmetadataweekly.substack.com%2Fp%2Fontologies-context-graphs-and-semantic%23semantic-layer) | A governed abstraction layer for metric definitions, dimensional models, SQL generation, and reporting consistency. |
| [Ontology](https://linkeddata.uriburner.com/describe/?url=https%3A%2F%2Fmetadataweekly.substack.com%2Fp%2Fontologies-context-graphs-and-semantic%23ontology) | A formal specification of domain concepts, properties, constraints, and relationships. |
| [Knowledge graph](https://linkeddata.uriburner.com/describe/?url=https%3A%2F%2Fmetadataweekly.substack.com%2Fp%2Fontologies-context-graphs-and-semantic%23knowledge-graph) | A graph-based representation of entities, relationships, and facts that provides structured domain context. |
| [Context graph](https://linkeddata.uriburner.com/describe/?url=https%3A%2F%2Fmetadataweekly.substack.com%2Fp%2Fontologies-context-graphs-and-semantic%23context-graph) | A knowledge graph focused on operational context, decision traces, authority, precedents, procedures, justifications, and execution histories. |
| [Knowledge architecture](https://linkeddata.uriburner.com/describe/?url=https%3A%2F%2Fmetadataweekly.substack.com%2Fp%2Fontologies-context-graphs-and-semantic%23knowledge-architecture) | The discipline of designing semantic systems that represent concepts, relationships, constraints, context, and inference rules. |

## Architecture Comparison

| Architecture | Optimizes for | Typical question | AI relevance |
|---|---|---|---|
| Semantic layer | Measurement | What is X? | Trusted calculations |
| Ontology | Meaning | What kind of thing is this? | Concepts, constraints, inference |
| Knowledge graph | Context | What is connected? | Machine-readable domain structure |
| Context graph | Operational explanation | Why was this allowed? | Decision traces, authority, precedent |

## Claims

- [Metric consistency is not meaning](https://linkeddata.uriburner.com/describe/?url=https%3A%2F%2Fmetadataweekly.substack.com%2Fp%2Fontologies-context-graphs-and-semantic%23claim-metric-consistency): semantic layers solve governed calculation, not complete organizational understanding.
- [AI needs context](https://linkeddata.uriburner.com/describe/?url=https%3A%2F%2Fmetadataweekly.substack.com%2Fp%2Fontologies-context-graphs-and-semantic%23claim-ai-needs-context): AI-native architecture needs explicit context, constraints, and inference-ready relationships.

## FAQ

### [Is a semantic layer enough for AI?](https://linkeddata.uriburner.com/describe/?url=https%3A%2F%2Fmetadataweekly.substack.com%2Fp%2Fontologies-context-graphs-and-semantic%23q1)

It is enough for governed metric lookup and calculation consistency, but not for reasoning that requires domain concepts, constraints, causal context, or procedural meaning.

### [What does an ontology add?](https://linkeddata.uriburner.com/describe/?url=https%3A%2F%2Fmetadataweekly.substack.com%2Fp%2Fontologies-context-graphs-and-semantic%23q2)

An ontology makes concepts, relationships, properties, and constraints explicit so machines can interpret and reason over domain meaning.

### [What does a context graph add beyond a knowledge graph?](https://linkeddata.uriburner.com/describe/?url=https%3A%2F%2Fmetadataweekly.substack.com%2Fp%2Fontologies-context-graphs-and-semantic%23q3)

A context graph captures the operational why: decisions, authority, precedent, procedures, execution history, and supporting evidence.

### [What should organizations build now?](https://linkeddata.uriburner.com/describe/?url=https%3A%2F%2Fmetadataweekly.substack.com%2Fp%2Fontologies-context-graphs-and-semantic%23q4)

They should keep governed metrics where those work, then add formal knowledge representation where AI systems must reason about concepts, procedures, constraints, and decisions.

## HowTo

### [Use a semantic layer for governed metrics](https://linkeddata.uriburner.com/describe/?url=https%3A%2F%2Fmetadataweekly.substack.com%2Fp%2Fontologies-context-graphs-and-semantic%23step1)

Choose a semantic layer when the task is consistent calculation, dimensions, joins, and BI-facing answers.

### [Use an ontology for domain meaning](https://linkeddata.uriburner.com/describe/?url=https%3A%2F%2Fmetadataweekly.substack.com%2Fp%2Fontologies-context-graphs-and-semantic%23step2)

Choose an ontology when the task requires explicit classes, relationships, constraints, and inference.

### [Use a context graph for operational reasoning](https://linkeddata.uriburner.com/describe/?url=https%3A%2F%2Fmetadataweekly.substack.com%2Fp%2Fontologies-context-graphs-and-semantic%23step3)

Choose a context graph when the task requires decision traces, authority, procedures, precedents, or auditability.

## Explore Knowledge Graph using SPARQL

Named graph: `https://metadataweekly.substack.com/p/ontologies-context-graphs-and-semantic`  
Endpoint: [URIBurner SPARQL](https://linkeddata.uriburner.com/sparql)

### [Entity type summary](https://linkeddata.uriburner.com/describe/?url=https%3A%2F%2Fmetadataweekly.substack.com%2Fp%2Fontologies-context-graphs-and-semantic%23query-entity-type-summary)

Live query uses `text/x-html+tr`.

```sparql
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT ?type (SAMPLE(?s) AS ?sampleEntity) (SAMPLE(?label) AS ?sampleLabel) (COUNT(?s) AS ?entityCount)
WHERE {
  GRAPH <https://metadataweekly.substack.com/p/ontologies-context-graphs-and-semantic> {
    ?s rdf:type ?type .
    OPTIONAL { ?s rdfs:label ?label }
  }
}
GROUP BY ?type
ORDER BY DESC(?entityCount)
```

### [Describe source article](https://linkeddata.uriburner.com/describe/?url=https%3A%2F%2Fmetadataweekly.substack.com%2Fp%2Fontologies-context-graphs-and-semantic%23query-describe-article)

Live query uses `text/x-html-nice-turtle`.

```sparql
DESCRIBE <https://metadataweekly.substack.com/p/ontologies-context-graphs-and-semantic#article>
FROM <https://metadataweekly.substack.com/p/ontologies-context-graphs-and-semantic>
```

### [Construct compact graph](https://linkeddata.uriburner.com/describe/?url=https%3A%2F%2Fmetadataweekly.substack.com%2Fp%2Fontologies-context-graphs-and-semantic%23query-construct-compact-graph)

Live query uses `text/x-html-nice-turtle`.

```sparql
CONSTRUCT { ?s ?p ?o }
WHERE {
  GRAPH <https://metadataweekly.substack.com/p/ontologies-context-graphs-and-semantic> {
    ?s ?p ?o .
    FILTER(?p IN (<http://schema.org/about>, <http://schema.org/hasPart>, <http://schema.org/mentions>, <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>))
  }
}
LIMIT 100
```

## Provenance

Generated with the `kg-generator` and `rdf-infographic-skill` workflows. Entity links route through the URIBurner resolver pattern: `https://linkeddata.uriburner.com/describe/?url={encodedIRI}`. The HTML footer includes source material, companion files, skills used, generation environment, Linked Data runtime, named graph, resolver pattern, and extraction provenance.
