The Ontology Is a Guide—Until Direction Becomes a Contract
Utopia’s ontology is not a dictionary bolted onto the graph after extraction. It is the working boundary that tells the extractor which kinds of things and relationships it may name, while also recording where that vocabulary is incomplete. This chapter examines how Utopia starts with an empty or imported ontology, lets recurring source language propose additions, and enforces only the constraints that protect the graph’s representation. The practical judgment is not whether a large ontology is “better,” but which parts should guide interpretation, which parts may correct representation, and which parts must remain open to revision.
A vocabulary can be missing without the observation being lost
An ontology is often described as a taxonomy of classes, but Utopia uses it more broadly. It contains classes for entities, attributes for literal values, relations between entities, descriptions that help the model choose among terms, and signatures that describe which kinds of entities may occupy either end of a relation. It can also carry selected logical declarations used later by the consistency checker and reasoning engine. This makes it an operating component: its contents affect extraction, entity resolution, conflict detection, and inference.
That influence creates a danger. If a missing category is represented by a fake category, the system may mistake a temporary lack of vocabulary for a fact about the world. Earlier versions of Utopia used broad built-in classes and a generic relation to give every extraction somewhere to land. The result was superficially complete but semantically weak. An unresolved type looked as though someone had decided that the entity belonged to a class called “concept.” An unrecognized relationship looked like a normal related_to edge, even though no one had established that “related to” was the relation expressed by the source.
Utopia now permits a knowledge base to begin with no types or relations at all. An entity can remain untyped, and a fact can remain predicate-less while retaining its subject, object, value, time, evidence, and source wording. This is not an empty result in the ordinary sense. It says that the source supplied an observation but the system has not yet earned a classification or a canonical relationship name. Later ontology work can revisit that observation without reconstituting information from a lossy fallback.
A knowledge base may also start from an imported ontology. Utopia retains the original OWL or RDF file and projects the pieces current consumers understand into its working vocabulary. The original is kept because the projection is intentionally incomplete: a feature that is not yet represented in the local tables should be a missing consumer, not deleted input. Imported IRIs provide durable identity for classes and relations even when their labels change. Short keys are the tokens used in prompts and APIs; they are not reliable identity because different vocabularies can use the same local word for different concepts.
The repository includes optional packs such as schema.org, W3C Org, PROV-O, FOAF, and IOF Core. These packs offer different kinds of starting structure: general entities and events, organizational roles, provenance, social relationships, or industrial manufacturing. The current design does not make a pack mandatory or assume that one bundle fits every organization. A pack can provide useful domain and range declarations, but it can also make selection harder when a generic-sounding property has a narrow meaning. The latest documented policy leaves the base without a preselected pack; a user who wants a pack’s vocabulary can choose it deliberately.
That policy is a trade-off, not a verdict against imported ontologies. A pack can improve type coverage and provide signatures that an empty base cannot invent. An empty base can keep prompts smaller, grow relations in the language of its own corpus, and avoid presenting thousands of narrowly defined properties to a model choosing from names alone. The right starting point depends on whether the immediate need is alignment to an established vocabulary or an evidence-led vocabulary that can develop with the documents.
The growth loop exists for the gap between those choices. When extraction encounters a term the ontology lacks, Utopia records the original phrasing as an ontology signal. Recurrence across documents becomes evidence that a term may deserve a place in the vocabulary. Deterministic counting decides whether a candidate has enough spread to be considered; semantic questions remain for a person. Are two phrasings genuine synonyms, or do they merely occur in similar contexts? Is a verb describing a business relationship, or is it only the language of an article reporting someone else’s claim?
This division of labor is deliberate. Counting document prevalence makes adoption reproducible and resistant to a single accidental sentence. Human judgment is reserved for meaning, where frequency is not enough. When a person adopts a relation, Utopia can rewrite the waiting facts through an append-and-supersede path rather than relabeling them invisibly. An undo operation restores the earlier rows while leaving the adopted relation and the record of adoption in place. Automatic adoption is allowed only where the action is visible and reversible; axioms are not assigned automatically because a wrong axiom can trigger cascading conflicts or inferences.
The ontology is therefore both a starting condition and a feedback loop. Its current vocabulary shapes what the next document can express. The corpus exposes gaps in that vocabulary. A person can accept a new term, reject it, or keep two terms apart. The resulting change affects future extraction, but the earlier evidence remains available for inspection.
Guidance for types, contracts for direction
The most important distinction in Utopia’s ontology design is that not every declaration has the same authority. Class selection is guidance. If a model assigns an entity a class that is too coarse or simply wrong, throwing away the observation because the class does not fit would make the ontology a destructive gate. The entity can be retyped later, and an untyped entity can receive its first considered type without pretending that an earlier extraction decision was being overturned.
Relation argument order is different. A signature such as employee (organization → person) is not a claim that the world must obey a model’s classification. It is the encoding convention for the relation’s key. If the endpoints are written in reverse, the graph represents the relationship incorrectly even if the text clearly supports its existence. Utopia checks the actual stored entity types at write time. If the subject violates the domain while the object fits the range, it swaps the endpoints and records direction_corrected. If neither direction satisfies the signature, it removes the predicate but keeps the entities, time, and evidence. The source observation survives; the illegal named edge does not.
This distinction resolves a conflict between two reasonable instincts. A hard type gate would protect the ontology but systematically lose facts whenever the ontology is incomplete or the model chooses a sibling class. No direction check would preserve more output but allow a relation to be stored backwards, so every later query and inference would read the graph’s encoding incorrectly. Utopia makes the type side revisable and the argument-order side explicit. One is a hypothesis about what an entity is; the other is a structural requirement for reading a relation.
The design was motivated by measured failure rather than by a preference for formalism. In a controlled run with an imported vocabulary, many checkable facts were initially written backwards because the extractor followed natural language more strongly than the signature in its prompt. Adding more prompt wording improved the result only partially. Ancestor completion made the relevant general classes available, and write-time judgment reduced the reported violation rate from 57% to 4% and true reversals from 39 to 0 in that run. One of 29 swaps was still wrong, because an ontology declaration can be vague or inapplicable. The result supports a traced correction, not the claim that the ontology is infallible.
The signature check also has to be applied wherever a fact can be reattached. It cannot protect extraction while allowing a later ontology adoption or entity merge to write the same edge through a different path. Utopia therefore reuses the direction judgment for extraction and later modifications, and sends cases that fit neither direction to an explicit empty-predicate outcome. This is an architectural lesson: a rule applied at one entry point is not a system invariant if another writer can bypass it.
Scaling the vocabulary without turning the prompt into the system
A small ontology can be supplied whole to every extraction call. That is simple and often preferable: retrieval would add a round trip without improving a list that already fits comfortably. The strategy changes when an ontology becomes large. Inlining every class, relation, and attribute for every chunk creates a prompt whose cost grows with both document size and vocabulary size, while asking a model to choose among hundreds of plausible names can degrade selection quality.
Utopia switches by a character budget. For a large ontology, the chunk’s embedding retrieves candidate classes, relations, and attributes, and the system adds the ancestors of the selected classes. Attributes follow their domain class, so the prompt preserves the connection between a class and the fields that describe it. Relation signatures name only classes that are actually present in the selected slice; an absent endpoint falls back to an unconstrained side rather than teaching the model a type that the prompt never supplied.
Ancestor completion is more than a convenience. Retrieval tends to favor a leaf class whose label appears literally in the passage. A person mentioned in a research story may be ranked near a narrow class such as “researcher,” while the general person class is farther away in vector space. If only the leaf is shown, a relation whose signature needs person may lose its usable range and degrade to an uninformative wildcard. Adding the class’s ancestors preserves the taxonomy’s own generalization chain without maintaining a hand-written list of “important” base classes.
This design keeps the prompt bounded while retaining the structural context needed for safe writes. It does not guarantee the best candidate. A large pack can contain generic property names, near-synonyms, or web-facing concepts that do not fit an enterprise corpus. Per-chunk retrieval can bring the wrong term into view, and an empty ontology has no signature with which to correct direction. Prompt selection is therefore part of the quality problem, not a solved implementation detail.
The documented budget and per-chunk candidate counts are live choices, with evidence that retrieval avoids the extreme cost of fully inlining a large vocabulary. The project also records the limits of that evidence: several comparisons are based on small or single-run corpora, model output varies, and the mixed-pack and starting-scale questions remain open. That qualification matters because a shorter prompt is not automatically a better prompt. The useful criterion is whether the selected vocabulary lets the extractor preserve more correct structure without hiding relevant alternatives or making the model’s choices opaque.
The ontology’s role can now be stated precisely. It gives the extractor a language, gives the graph some structural invariants, and gives people a place to govern what the corpus keeps asking for. It does not replace the source, guarantee that a class choice is correct, or turn every missing term into a reason to discard an observation. When it is wrong, the safest design is one that leaves the mistake visible and repairable.
That leaves a different question. Even with a careful vocabulary and a traced relation direction, two documents may use similar names for different entities—or different names for the same one. The next boundary is identity: deciding which mention belongs to which node without allowing a convenient match to merge the wrong histories.