Gen AI Fundamentals › Ontology Builder

🕸️ Ontology Builder

What it contains · what shape · who builds it · where it is stored · PaaS or on-prem
Why this page exists. Ontology work fails far more often from starting too big than from choosing the wrong tool. This page covers the components, the formalisms, the roles, the stores and the deployment choice — but the section that matters most is the last one: how to start without boiling the ocean.

1 · Ontology vs taxonomy vs schema concept

These five get used interchangeably and cost real money when confused in a design review.

Artefact What it captures Example Answers
GlossaryBusiness terms and their agreed definitions"Active Customer means…"What does this word mean?
TaxonomyHierarchical classification — is-a onlyProduct → Vaccine → mRNA VaccineWhat kind of thing is this?
OntologyEntities, relationships, constraints and rules that support inferenceStudy investigates Compound; Compound treats IndicationHow do things relate, and what follows from that?
Knowledge graphAn ontology populated with instancesStudy NCT0123 investigates GSK-456What is actually true in our estate?
Data model / schemaPhysical structure of a table or documentdim_product(sku, name…)How is it stored?
Semantic layerBusiness metrics and dimensions over physical tablesrevenue = sum(net_amount)How do we calculate it consistently?
The one-line distinction: a taxonomy tells you what something is; an ontology tells you what it is connected to and what can be inferred. If your requirement never needs a relationship traversal or an inference, you need a taxonomy or a glossary — and you have just saved yourself a year.

2 · Where you actually need one trade-off

Use caseWhat the ontology buys youCould you skip it?
Impact & blast-radius analysis"What breaks if I change this table, service or field" — transitive, across systemsNo — this is inherently multi-hop
Entity resolution / master dataThe same customer, site or compound reconciled across a dozen systemsNo — identity is a relationship problem
Text-to-SQL and NL queryWhich tables mean what, and how they legitimately joinPartly — a semantic layer may be enough
Agent tool selection & contextWhich system owns which concept, so an agent picks the right toolOften — a good tool catalogue may suffice
Hybrid graph + vector RAGMulti-hop questions vector search cannot answerUsually yes at first — start with hybrid search
Policy & classification propagationTag a concept once, inherit the controls everywhere it appearsNo — inheritance is the point
Regulatory interoperabilitySpeaking IDMP, CDISC or FHIR because a regulator requires itNo — the standard is the ontology
Merging systems after acquisitionA common conceptual layer across incompatible modelsNo — this is the classic case
The qualifying test: write down five real questions the business cannot answer today. If none of them requires following a relationship through another entity, you do not need an ontology yet. Most "we need an ontology" programmes are actually asking for a glossary, a semantic layer, or better search.

3 · What it contains concept

ComponentWhat it isSkipping it costs you
Classes / entitiesThe things that exist — Study, Site, Compound, Incident, ServiceNothing to hang anything on
PropertiesAttributes with datatypes and unitsAmbiguity — is duration in hours or days?
RelationshipsTyped edges with domain and range — investigates, depends-on, supersedesThis is the ontology. Without it you have a taxonomy
HierarchiesSubclass and subproperty — what inherits from whatEvery rule has to be restated at every level
Cardinality & constraintsA Study has exactly one Sponsor; a Site has at least one InvestigatorData that validates but is nonsense
Axioms & rulesWhat can be inferred — transitivity, symmetry, disjointnessYou infer in application code instead, inconsistently
Identifiers & namespacesStable URIs or keys that survive renamingNothing can be merged or federated later
Labels & synonymsPreferred term, alternates, abbreviations, other languagesSearch and NL query miss the way people actually speak
Mappings / crosswalksLinks to external standards and to physical columnsAn ontology disconnected from data — the classic shelfware failure
Provenance & versioningWho asserted this, when, from what source, under which versionNo way to audit or roll back a meaning change
Mappings are the component teams skip and the one that decides success. An ontology with no link to physical columns is a diagram. The mapping layer — concept → table → column — is what turns it into something a query engine or an agent can actually use.

4 · Shape & form trade-off

Formalism Looks like Strengths Costs Use when
RDF / OWLTurtle, JSON-LD; SPARQL; SHACLW3C standard, formal inference, federates, aligns with public ontologiesSteep learning curve; scarce skills; verboseRegulated, interoperability, external standards
SKOSConcept schemes, broader/narrowerLightweight, ideal for vocabularies and taxonomiesNot expressive enough for real constraintsControlled vocabularies, thesauri
Labeled property graphNeo4j + CypherPragmatic, fast, easy to hire for, great toolingNo standard semantics; inference is yours to writeOperational graphs, impact analysis, agent memory
LinkMLYAML schemaAuthor once, generate OWL, JSON Schema, SHACL, Python, SQL DDLYounger ecosystemYou want one source and several outputs
JSON Schema / PydanticCode-facing typesWhat applications and LLM tool definitions actually consumeNo inference, no relationships beyond nestingThe operational projection — generate it, do not hand-write it
Semantic layerdbt / Cube / MetricFlow YAMLConsistent metrics; already in the analytics workflowMetrics and dimensions only — not a general ontologyBI consistency and text-to-SQL grounding
You will need two representations, and that is fine. One authoritative (OWL, SKOS or LinkML) and one operational (property graph, JSON Schema, semantic layer). The rule is that the second is generated from the first. The moment both are hand-maintained they diverge, and the ontology becomes documentation nobody trusts.

5 · Who builds it concept

RoleOwnsFailure if they are absent
Domain SME / stewardThe meaning. Which distinctions matter and which are noiseThe commonest failure. A technically elegant ontology the business does not recognise
Ontologist / knowledge engineerThe formalism — classes, relations, constraints, alignment to standardsInconsistent modelling that cannot be reasoned over
Data engineerMappings to physical tables, population pipelines, refreshAn ontology unconnected to real data
ArchitectScope, boundaries, which standard to adopt, what stays outScope creep to the whole enterprise; nothing ships
Governance / QAChange control, versioning, regulatory alignmentMeaning drifting silently; no audit trail
LLM assistanceProposes candidate entities, relations and synonyms from documents and schemasSlow manual extraction — but it only ever proposes; a human ratifies
A workable modern split: an LLM pass over existing schemas, documents and tickets proposes candidate concepts and relationships; the ontologist shapes them; the SME ratifies meaning; CI validates the result. That collapses the slowest part of the work without handing meaning to a model — propose automatically, ratify deliberately.

6 · Where it lives landscape

Four distinct storage questions, and teams routinely conflate them.

Authoring & source of truthGit. The ontology is code — versioned, reviewed, diffable, released. Never a database as the master copy.
Instance storeThe populated knowledge graph — triple store or property graph.
Metadata & governanceCatalog holding classification, lineage and policy — Unity Catalog, Purview, Collibra.
Operational projectionGenerated JSON Schema, semantic-layer YAML, Cypher constraints that applications consume.
Option Category Strengths Choose when
Authoring & validation
Protégé / WebProtégéOSSAuthoringThe de-facto OWL editor; reasoners built inFormal OWL work — the default
LinkMLOSSAuthoringYAML source, generates OWL, SHACL, JSON Schema, Python, DDLYou want ontology-as-code with real outputs
SHACL / pySHACL, ShExOSSValidationConstraint validation you can run in CIAlways — this is your test suite
VocBench, Neo4j ArrowsOSSAuthoringCollaborative vocabulary editing; quick model sketchingSME-facing curation and whiteboarding
TopBraid EDG, PoolParty, Semaphore, metaphactoryAuthoringGovernance workflow, SME-friendly UIs, publishingLarge curated vocabularies with non-technical stewards
Triple stores — RDF / SPARQL
Apache Jena FusekiOSSStoreFree, standard, easy to startModest scale, getting going
GraphDB (Ontotext)free tierStoreStrong reasoning, mature toolingInference matters
Stardog, AllegroGraph, RDFox, VirtuosoStoreVirtual graphs over relational data, high-performance reasoningEnterprise scale with federation needs
Oxigraph, BlazegraphOSSStoreLightweight, embeddableSmall footprint or embedded use
Property graphs
Neo4jOSS + SaaSStoreMost mature; Cypher, tooling, vector index; AuraDB managedDefault for an operational graph
Memgraph, FalkorDB, KùzuOSSStoreIn-memory speed; FalkorDB for request-path latency; Kùzu embeddedLatency-sensitive or per-tenant graphs
Neptune (AWS), Spanner Graph (GCP), Cosmos DB Gremlin (Azure)cloudStoreManaged, IAM-integrated; Neptune speaks both RDF and property graphCloud-standardised estates
Apache AGE (Postgres)OSSStoreGraph queries in the Postgres you already runModest graphs, one fewer system
Catalog & governance
Unity CatalogDatabricksCatalogLineage, tags, classification, permissions on real dataDatabricks estates — put mappings here
Microsoft PurviewAzureCatalogEstate-wide classification and glossaryAzure estates
DataHub, OpenMetadata, Apache Atlas, EgeriaOSSCatalogOpen metadata models, glossary, lineageMulti-cloud or vendor-neutral requirement
Collibra, Alation, AtlanCatalogStewardship workflow for non-technical usersFormal governance programmes
Semantic layer
dbt Semantic Layer, CubeOSS + SaaSSemanticsMetric definitions consumed by BI and text-to-SQLConsistent metrics is the actual requirement
Databricks Metric Views, AtScale, Power BI modelsmixedSemanticsNative to the platformAlready standardised there

7 · PaaS or on-prem trade-off

FactorPoints to managed / PaaSPoints to self-hosted / on-prem
Data residency & regulationRegion-pinned managed service meets the requirementGxP validated environment, or data that may not leave the datacentre
Content sensitivityOntology schema is rarely sensitive — often fine anywhereInstances may be highly sensitive — patient, trial, commercial
ScaleElastic growth, unpredictable loadKnown, stable volumes
LatencyBatch or interactive analyticsGraph reads on a request path next to the app
Ops capacityNo team to run a triple storeExisting DBA and platform capability
Validation burdenVendor-qualified service reduces your evidence loadYou control the change window and the qualification
Exit costStandards-based (RDF/SPARQL) keeps it portableFull control, but you carry upgrades and patching
The split that usually wins in regulated estates: keep the ontology itself in Git — it is text, it is reviewable, it moves anywhere, and it is rarely sensitive. Then choose the instance store on the sensitivity of the data, not of the model. Schema in the open, instances where policy requires. That separation also makes the deployment decision reversible.

8 · Adopt before you build important

In life sciences and healthcare the ontologies largely already exist, are maintained by people whose job that is, and are often what a regulator expects to receive. Building your own version of MedDRA is an expensive way to be non-standard.

DomainEstablished standardsWhere to find them
Clinical termsSNOMED CT, ICD-10/11, LOINC (labs), RxNorm, UMLSBioPortal, UMLS Metathesaurus
Adverse eventsMedDRAMSSO (licensed)
Products & substancesIDMP (ISO 11615/11616), GINAS, ChEBIISO, EMA, EBI
Clinical trials dataCDISC — SDTM, ADaM, CDASH, Controlled TerminologyCDISC library
Real-world / observationalOMOP Common Data ModelOHDSI
InteroperabilityHL7 FHIRHL7
Biology & diseaseGene Ontology, UniProt, EFO, MONDO, NCItOLS (EBI), BioPortal
General / linked dataschema.org, SKOS, Dublin Core, PROV-O, DCATW3C, schema.org
The rule: adopt the standard, then extend it with a small local namespace for what is genuinely yours — internal programme codes, site hierarchies, system names. Your ontology should be mostly imports and a thin layer of local concepts. If it is mostly local, either you are in an unusual domain or you have not looked hard enough.

9 · Ontology as code pattern

# repo layout — the ontology is a versioned, tested, released artefact
ontology/
  imports/         # pinned versions of external standards
  core/            # your entities and relationships (.ttl or LinkML .yaml)
  mappings/        # concept -> physical table.column
  shapes/          # SHACL constraints = the test suite
  generated/       # NEVER hand-edited

# CI — the same shape as any other build
- validate:   pyshacl -s shapes/ -d core/          # constraints hold
- reason:     check no unsatisfiable classes       # logically coherent
- diff:       report added/removed/renamed concepts vs the last release
- generate:   linkml → JSON Schema, OWL, Python, Cypher constraints
- publish:    versioned artefact + changelog       # semver: renames are breaking
Treat a concept rename as a breaking change and version accordingly. Downstream queries, mappings and prompts refer to concept names; changing one quietly is the ontology equivalent of renaming a public API column.

10 · How to start — and how it fails practice

  1. Start with five questions the business cannot answer today. The ontology exists to answer them; anything not needed for those five waits.
  2. Adopt the standards that already cover your domain. Import, do not re-model.
  3. Ten to twenty core entities. Enough for the five questions, no more.
  4. Write the mappings immediately — concept to real column. An unmapped concept is a hypothesis.
  5. Populate one real slice end to end and answer question one. A working thin slice beats a complete model.
  6. Put it in Git with SHACL in CI from day one, not after it grows.
  7. Generate every downstream form. Hand-maintained copies diverge within weeks.
  8. Let a model propose, a human ratify. LLM extraction over schemas and documents removes the drudgery without outsourcing meaning.
Failure modeWhat it looks like
Boiling the oceanEighteen months modelling the enterprise; nothing queryable; funding withdrawn
No consumerBuilt by a central team with no application depending on it. Nothing keeps it honest
Formal purity over usefulnessBeautiful OWL axioms; no mappings; no data; no answers
Unmapped ontologyConcepts that never connect to a physical column — a diagram, not infrastructure
No versioningMeanings drift, downstream queries break, nobody can say when or why
Rebuilding a standardA bespoke adverse-event hierarchy that no regulator or partner recognises
Two hand-maintained copiesThe OWL and the property graph disagree; both are now untrusted
The one measure worth tracking: how many production queries, applications or agents depend on the ontology. If that number is zero six months in, the problem is not the modelling — it is that nothing needed it. A single dependent consumer does more for quality than any amount of review.
Related: AI Engineering Blueprint — where the ontology sits among the other 36 concerns · Graph & memory frameworks — GraphRAG, Graphiti and the graph databases underneath.