Ontology (knowledge representation)
A formal specification of the concepts in a domain and the rules governing how those concepts relate. The schema — not the data. A knowledge-graph is built on top of an ontology: the ontology defines what kinds of things exist and what relationships between them are valid; the knowledge graph populates those slots with actual entities and facts.
The canonical definition is Tom Gruber’s (1993): an ontology is “a specification of a conceptualization” — more fully, a formal description of the concepts and relationships that can exist for an agent or community of agents (ontology-information-science-wikipedia). A contemporary ontology describes individuals (instances), classes (concepts), attributes (properties), and relations between them, plus the restrictions and axioms over them.
Ontology vs. taxonomy
The line that matters for this wiki: an ontology is not just a naming hierarchy. What makes it an ontology rather than a taxonomy is that it carries axioms that constrain the possible interpretations of its terms — Gruber stressed that “ontologies need not be limited to” taxonomic class hierarchies and the subsumption relation (ontology-information-science-wikipedia). That constraint is exactly what makes the ontology usable as a guardrail on extraction below. A second axis: domain ontologies model one area and are often mutually incompatible, while upper / foundation ontologies supply objects and relations common across domains to make them interoperate (ontology-information-science-wikipedia).
Ontologies and LLMs
LLMs can now draft an ontology schema from a prose description — a task that previously required specialist knowledge engineers (ontologies-knowledge-graphs-ai). More practically: feeding that schema back as a constraint on a second LLM extraction pass reduces hallucination. The ontology limits what the model can assert, turning open-ended generation into constrained extraction. Schema as guardrail.
This is the semantic-web analog of the agent-guardrails discipline: formal constraints on output structure rather than on actions.
History
Ontologies originate in philosophy (the study of what exists); in computer science they were formalized for the Semantic Web (W3C OWL, built on RDF/RDFS) as machine-readable domain models, with CycL — the Cyc project’s first-order-predicate-calculus language — a notable early alternative (ontology-information-science-wikipedia). The field predates LLMs by decades — LLMs change who can build them, not what they are.
Related
knowledge-graph · ontology-information-science-wikipedia · ontologies-knowledge-graphs-ai · retrieval-augmented-generation