Ontology Is Source Code
Tony Seale argues that an ontology is not a database table or passive schema. It is formal logic and source code for organizational meaning, so it should compile, live in plain text, and be governed like code.
Core Claims
The generated graph models the post as an engineering governance argument for ontology source management.
Ontology is logic, not a table
The ontology declares kinds of things, relationships, constraints, and axioms.
It should compile
Syntax, satisfiability, expected entailments, contradictions, and duplicate concepts belong in build checks.
It should live in plain text
Files enable diffs, branches, blame, pull requests, and review context.
It should be governed like code
Branches, reviews, automated checks, releases, and builds already exist in engineering practice.
LLMs need source access
Agents should read, navigate, and edit ontology source directly, not only through APIs.
Ontology is source code for meaning
Core business terms deserve engineering rigor because they define organizational semantics.
Ontology Engineering Workflow
Use the same engineering control plane that already handles code carrying less conceptual weight.
Plain-text ontology source
Ontology files maintained as source artifacts that support diffs, branches, blame, and pull requests.
Compile gate
A validation gate where ontology syntax, satisfiability, entailments, contradiction checks, and duplicate concept checks must pass.
Pull request review
Review workflow for ontology changes in context.
Automated ontology checks
Build checks that catch syntax errors, unsatisfiable classes, unexpected entailments, contradictions, and duplicate concepts.
Governed like code
Ontology governance using branches, pull requests, reviews, automated checks, releases, and builds.
LLM-readable source
A design principle where large language models can read, navigate, and edit ontology source directly like a codebase.
Discussion Layer
Visible LinkedIn comments are represented as RDF comments and topic links, starting with Kingsley Uyi Idehen.
Knowledge Graph Explorer
Graph data is derived from the generated RDF entity and relationship model. Node and edge clicks use URIBurner resolver-backed IRIs.
RDF Graph Workbench
Explore ontology-as-code entities, practices, query examples, provenance, and source concepts.
Graph data embedded from companion RDF at generation time. The controls tray is closed by default; Advanced exposes settings and predicate filters.
Executable SPARQL
Generated live queries use the companion named graph IRI.
Core Practices
Run live queryPREFIX schema: <http://schema.org/>
PREFIX ex: <https://www.linkedin.com/posts/tonyseale_did-you-start-building-your-ontology-as-a-share-7463353332565356545-jY54#>
SELECT ?practice ?name ?description
WHERE {
GRAPH <https://linkeddata.uriburner.com/DAV/demos/daas/ontology-is-source-code-tony-seale-gpt5-chat-1.ttl> {
ex:ontologyAsCode ex:hasComponent ?practice .
?practice schema:name ?name ;
schema:description ?description .
}
}
ORDER BY ?name
Compile Gates
Run live queryPREFIX schema: <http://schema.org/>
PREFIX ex: <https://www.linkedin.com/posts/tonyseale_did-you-start-building-your-ontology-as-a-share-7463353332565356545-jY54#>
SELECT ?check ?name ?description
WHERE {
GRAPH <https://linkeddata.uriburner.com/DAV/demos/daas/ontology-is-source-code-tony-seale-gpt5-chat-1.ttl> {
ex:compileGate ex:tests ?check .
?check schema:name ?name ;
schema:description ?description .
}
}
ORDER BY ?name
Construct Workflow
Run live queryPREFIX ex: <https://www.linkedin.com/posts/tonyseale_did-you-start-building-your-ontology-as-a-share-7463353332565356545-jY54#>
PREFIX schema: <http://schema.org/>
CONSTRUCT {
ex:ontologyAsCode ?p ?o .
?o schema:name ?name .
}
WHERE {
GRAPH <https://linkeddata.uriburner.com/DAV/demos/daas/ontology-is-source-code-tony-seale-gpt5-chat-1.ttl> {
ex:ontologyAsCode ?p ?o .
OPTIONAL { ?o schema:name ?name }
}
}
Comment Perspectives
Run live queryPREFIX schema: <http://schema.org/>
PREFIX ex: <https://www.linkedin.com/posts/tonyseale_did-you-start-building-your-ontology-as-a-share-7463353332565356545-jY54#>
SELECT ?comment ?authorName ?topicName ?text
WHERE {
GRAPH <https://linkeddata.uriburner.com/DAV/demos/daas/ontology-is-source-code-tony-seale-gpt5-chat-1.ttl> {
ex:commentThread schema:hasPart ?comment .
?comment schema:author ?author ;
schema:text ?text ;
schema:about ?topic .
?author schema:name ?authorName .
?topic schema:name ?topicName .
}
}
ORDER BY ?authorName ?topicName
FAQ
Questions and answers are named RDF resources.
Why should an ontology be treated as code?
What does it mean for an ontology to compile?
Why is plain text important for ontology work?
How should an ontology be governed?
How do LLMs change ontology engineering?
Glossary
Defined terms from the post collection.
Ontology
A formal graph of classes, relationships, constraints, and axioms for a domain.
Ontology as code
Treating ontology source as logic-bearing code that compiles, has tests, and follows engineering governance.
Compile gate
Automated validation that catches invalid syntax, unsatisfiable classes, missing entailments, contradictions, and duplicates.
Plain-text source
Maintaining ontology definitions in files to enable diffs, branches, pull requests, blame, and source review.
Source code for meaning
The role of ontology as the formal source for what organizational concepts mean.
HowTo
A compact workflow for putting ontology-as-code discipline into practice.
Move ontology definitions into source files
Use RDF/Turtle, OWL, SHACL, or another text-based ontology source format that supports version control.
Add compile and reasoning checks
Validate syntax, class satisfiability, expected entailments, contradictions, and duplicate concept risks in CI.
Review ontology changes in pull requests
Use branches, diffs, contextual comments, and approval rules for ontology changes.
Publish versioned ontology releases
Package, tag, and document ontology releases so downstream systems and agents know which meaning contract they use.
Expose source and services to LLM agents
Let LLMs navigate source files directly while also providing APIs, MCP tools, SPARQL endpoints, and documentation.
Yes! The creation and management of ontologies, and even instance data, is a classic files-and-filesystem interaction pattern. Before LLMs this was difficult because RDF notations had tradeoffs: Turtle was human-readable but lacked tooling support, JSON-LD had more tooling support but was less readable, and RDF/XML was challenged on both fronts. Today, the Semantic Web stack gels naturally with LLMs and AI Agents. An agent can express a conceptualization in the notation you prefer and save it to a file; on suitable platforms those files can be copied to a folder transparently bound to a backend RDF DBMS for updating the triple or quad store.
For huge, highly regular ontologies such as anatomy, biological traits, or chemistry, one can sometimes curate the ontology in a table and map every instance or class to a design pattern that provides the logical modelling.
That sounds like it should be a vocabulary or taxonomy rather than an ontology, raising the question of whether vocabularies should be treated as code as well.
This is why everyone should be careful with new tools and vendors that are now reframing themselves as ontology tools.
An overview of RDF-native tooling and what major vendors support is relevant to the ontology-as-code discussion.
A question about developers trying to eliminate object-relational impedance mismatch by persisting data as objects instead of rows in tables or documents.
Ontology should not hide in an EAV table. It should compile, diff, branch, and fail CI when meaning breaks. The real test is executable ubiquitous language rather than a semantic artifact only specialists maintain.
The technical debt of the ontology codebase and associated DevOps measures the gap between current state and the value a company can derive from AI.
The compile step only bites if axioms have teeth; many enterprise ontologies are descriptive vocabularies in OWL clothing without constraints strict enough for a reasoner to disprove.
Ontology as code involves more than producing and processing RDF syntax; an ontology-driven system has more involved and snapshot-based approaches are only part of the story.
If an ontology is in tables, it can be moved into code and iterated from there.
Turtle is the coding language of choice because it plays nicely with SDLC tools.