Knowledge Graphs

Ontologies Guide

Production guide to ontologies for knowledge graphs - TBox/ABox, ontology vs schema, evolution governance, RDFS, OWL, SKOS, and enterprise stewardship.

60 min readIntermediateLast reviewed: 20 July 2026
PrerequisitesRDFKnowledge Graphs

Quick Summary

An ontology is the formal vocabulary contract that turns a graph database into a knowledge graph—defining TBox semantics that ABox data must align with.

One Analogy

An ontology is the building code; instance data is the construction. Without code, every team builds incompatible structures.

Engineering Rule

Start with competency questions and RDFS; add OWL only when inference is required; govern every TBox change with versioning and SHACL on the ABox.

TL;DR

  • An ontology is a formal specification of concepts, properties, and relationships—the shared vocabulary that distinguishes a knowledge graph from an ungoverned graph database.

  • TBox (terminology) vs ABox (assertions): TBox defines classes and properties; ABox holds instance facts. Ontology evolution changes TBox; data pipelines populate ABox.

  • Ontology ≠ database schema. Schema enforces storage structure (closed world). Ontology defines semantic meaning (open world) with optional OWL inference.

  • RDFS for basic typing; OWL for inference; SKOS for taxonomies; SHACL for validation. Production systems combine layers appropriately.

  • Govern ontology changes with versioning, stewardship RFCs, competency-question regression tests, and quarterly reviews—under-governed ontologies devolve into incompatible dialects.

Why This Matters

Fifty engineers add node labels and relationship types independently. Six months later: :Person, :Employee, :Staff, :Human, and :User overlap unpredictably. Queries miss data. LLM extraction prompts produce inconsistent types.

An ontology is the contract everyone builds against. It defines that ex:Employee rdfs:subClassOf ex:Person, that ex:worksAt connects Person to Organization, and that every Person must have a foaf:name (validated via SHACL, not OWL alone).

Ontologies power:

  • Enterprise knowledge graphs — cross-department semantic integration.

  • Life sciences — Gene Ontology, SNOMED CT, ChEBI for research and regulatory reporting.

  • Finance — FIBO for instrument classification and compliance.

  • Manufacturing — ISA-95 aligned production ontologies for MES integration.

  • Telecom — TM Forum SID-aligned resource and service ontologies.

  • AI structured outputs — ontology-guided entity extraction validated before graph merge, paired with RAG for document grounding.

Without ontology discipline, you have a graph database. With it, you have a knowledge graph that scales across teams and decades.

The Problem

Ambiguous terminology. "Client" means customer in sales, application in engineering, API consumer in platform. Ontologies assign unambiguous URIs: ex:Customer vs ex:SoftwareClient with definitions.

Implicit schema in code. Application enums encode domain structure in Java/Python—invisible to other systems. Ontologies publish schema as machine-readable RDF consumable by any pipeline.

Inference and consistency. If ex:Manager rdfs:subClassOf ex:Employee rdfs:subClassOf ex:Person, a reasoner infers managers are persons. OWL consistency checking catches contradictions.

Ontology vs schema confusion. Relational schemas enforce "this column must exist" (closed world). Ontologies define "this class means X" (open world). Teams expecting database-style enforcement from OWL alone will fail—pair with SHACL.

Graph database without ontology. Neo4j labels proliferate without governance. The fix is not switching databases—it is establishing TBox discipline, even if TBox lives in RDF and ABox syncs to a property graph projection.

How We Got Here

Ontology engineering evolved from philosophy and library science into production data infrastructure:

Diagram: Ontology technology stack evolution

flowchart LR
    A[Taxonomies / Thesauri] --> B[SKOS 2009]
    B --> C[RDFS typing]
    C --> D[OWL 2 formal logic]
    D --> E[SHACL validation 2017]
    E --> F[Enterprise EDG platforms]
    F --> G[LLM extraction contracts]
Layer Standard Role
Taxonomy SKOS Broader/narrower navigation
Vocabulary RDFS Classes, properties, domain/range
Logic OWL 2 Inference, disjointness, equivalence
Validation SHACL Closed-world ABox quality
Query SPARQL Competency question execution

Architecture

Ontology architecture in enterprise knowledge graphs:

Component Role
Ontology repository Git + Protégé, TopBraid EDG, PoolParty
TBox OWL/RDFS class and property definitions
ABox Instance triples from ETL
Versioning Semantic versioning (/ontology/1.2#), deprecation policy
Reasoner (optional) Materialize OWL inferences on ABox
SHACL validator Closed-world data quality gates
Registry HTTP URI resolution for ontology terms
Stewardship workflow RFC process for TBox changes
Projections Sync to Cypher property graphs, vector indexes

Diagram: TBox / ABox separation

flowchart TB
    subgraph tbox [TBox - Ontology]
        OWL[OWL Classes Properties]
        SKOS[SKOS Taxonomies]
        SH[SHACL Shapes]
    end
    subgraph abox [ABox - Instance Data]
        DATA[Entity Triples]
        FEEDS[Source Feeds]
    end
    subgraph ops [Operations]
        REASON[OWL Materialization]
        VALID[SHACL Validation]
        SPARQL[SPARQL Queries]
    end
    OWL --> REASON
    FEEDS --> DATA
    SH --> VALID
    DATA --> VALID
    VALID -->|pass| DATA
    DATA --> REASON
    REASON --> SPARQL
    tbox -.->|governs| abox

Diagram: Ontology evolution lifecycle

stateDiagram-v2
    [*] --> Propose: RFC new term
    Propose --> Review: steward + domain expert
    Review --> Reject: duplicate / unclear
    Reject --> Propose
    Review --> Approve: competency Q passes
    Approve --> Publish: version bump
    Publish --> Deprecate: term superseded
    Deprecate --> Publish: replacement mapped
    Publish --> Monitor: usage metrics
    Monitor --> Propose: new requirement

Step-by-Step Flow

Step 1: Scope the domain. "Product catalog and supply chain" not "everything in the company."

Step 2: Gather competency questions. SPARQL queries the ontology must support. Example: "List all components of products supplied by vendors in region X."

Step 3: Reuse existing vocabularies. schema.org, FOAF, Dublin Core, FIBO, SNOMED before minting terms.

Step 4: Draft TBox. Start with RDFS classes and properties; add OWL axioms only when inference is required.

Step 5: Review with domain experts. Validate labels, definitions, hierarchy with non-engineers.

Step 6: Define SHACL shapes. Cardinality, datatypes, required properties for ABox data.

Step 7: Publish at stable URIs. https://example.com/ontology/1.0# with HTML documentation.

Step 8: Integrate with ingestion. ETL maps source columns to ontology properties; SHACL validates before load.

Step 9: Version and deprecate. Never delete URIs; mark owl:deprecated true with replacement pointers.

Step 10: Quarterly review. Prune unused terms; extend via governed RFC process.

Real Production Example

Healthcare: clinical pathway ontology

Competency question: "Which active medications for patients with Condition X interact with Drug Y?"

@prefix med: <https://health.example/ontology#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .

med:Patient a owl:Class .
med:Medication a owl:Class .
med:hasActiveMedication a owl:ObjectProperty ;
    rdfs:domain med:Patient ; rdfs:range med:Medication .
med:interactsWith a owl:ObjectProperty, owl:SymmetricProperty ;
    rdfs:domain med:Medication ; rdfs:range med:Medication .

Clinical terminology board approves TBox changes with 2-week review. SHACL shapes require med:hasActiveMedication cardinality ≥ 0 for active patients.

Finance: FIBO alignment

Bank maps internal ex:CreditDefaultSwap to FIBO equivalent class via owl:equivalentClass. Regulatory reports query by FIBO URI—internal naming changes don't break downstream systems.

Manufacturing: ISA-95 equipment hierarchy

TBox models Enterprise → Site → Area → WorkCenter → WorkUnit. ABox populated from MES feeds. Competency question: "Which work centers use equipment from supplier S?" drives :usesEquipment and :suppliedBy property definitions.

Telecom: TM Forum SID resource ontology

Service inventory TBox aligns with SID :ResourceFacingService and :CustomerFacingService. Property graph projection in Neptune serves operational Cypher queries; TBox remains RDF canonical.

LLM extraction with ontology contract

LangChain extraction chain targets TBox classes. pySHACL validates ABox before merge. Valid entity URIs link to document chunks in vector indexes for hybrid RAG.

Enterprise governance RACI

Role Responsibility
Ontology steward Approve TBox changes, maintain competency questions
Domain expert Validate definitions, approve new classes
Data engineer ETL mapping from sources to ontology properties
Platform engineer SHACL CI, SPARQL endpoint, reasoner pipeline
App team Consume via SPARQL or LPG projection; request new terms via RFC
AI engineer LLM extraction prompts aligned to TBox; SHACL gate before merge

Quarterly ontology review agenda: unused term report, new competency questions from product teams, external ontology updates (FIBO/SNOMED releases), and ABox coverage metrics.

RDFS starter template

Every enterprise ontology should begin with this minimal RDFS foundation before adding OWL complexity:

@prefix ex:    <https://example.com/ontology#> .
@prefix rdfs:  <http://www.w3.org/2000/01/rdf-schema#> .
@prefix rdf:   <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .

ex:Person a rdfs:Class ;
    rdfs:label "Person"@en ;
    rdfs:comment "A human individual."@en .

ex:Organization a rdfs:Class ;
    rdfs:label "Organization"@en .

ex:Employee a rdfs:Class ;
    rdfs:subClassOf ex:Person ;
    rdfs:label "Employee"@en .

ex:worksAt a rdf:Property ;
    rdfs:domain ex:Person ;
    rdfs:range ex:Organization ;
    rdfs:label "works at"@en .

Extend only when competency questions require additional axioms—resist adding OWL restrictions until a concrete query fails without inference.

SKOS taxonomy integration

@prefix skos: <http://www.w3.org/2004/02/skos/core#> .

ex:ArtificialIntelligence a skos:Concept ;
    skos:prefLabel "Artificial Intelligence"@en ;
    skos:broader ex:ComputerScience ;
    skos:narrower ex:MachineLearning .

ex:MachineLearning a skos:Concept ;
    skos:prefLabel "Machine Learning"@en ;
    skos:broader ex:ArtificialIntelligence .

Link SKOS concepts to OWL classes via skos:exactMatch or owl:equivalentClass when taxonomy terms align with formal types used in ABox data.

Ontology evolution RFC template

Every TBox change proposal should include:

  1. Problem statement — which competency question fails today
  2. Proposed terms — new/changed classes and properties with definitions
  3. Reuse analysis — schema.org, FIBO, or internal terms considered first
  4. Impact assessment — ABox mappings, SHACL shapes, SPARQL queries affected
  5. Migration plan — deprecation timeline for superseded terms
  6. Reviewers — steward + domain expert sign-off required

Reject RFCs that add OWL complexity without a failing competency question—ontology bloat is harder to fix than under-modeling.

Industry ontology reuse guide

Industry Start with Extend when
Finance FIBO modules for instruments, entities Proprietary product types not in FIBO
Life sciences ChEBI, GO, schema.org Internal assay types
Healthcare SNOMED CT (license required) Hospital-specific workflows
Manufacturing ISA-95, schema.org Product Custom BOM relationships
Telecom TM Forum SID fragments Internal service catalog terms
General web schema.org, FOAF, Dublin Core Domain-specific extensions

Always document owl:imports and license compliance in ontology README. Pin external ontology versions—SNOMED and FIBO release on schedules that may break equivalence mappings if unpinned.

Protégé workflow for domain experts

Non-engineers can validate ontology terms in Protégé without writing SPARQL: use Entities tab to browse class hierarchy, read rdfs:comment and skos:definition, and flag ambiguous labels in steward review meetings. Engineers export OWL/XML or Turtle from Protégé to Git; CI runs reasoner consistency check and SHACL validation on sample ABox before merge to production TBox branch.

ABox typing best practices

Type instances at the most specific known class in ABox—ex:Manager not just ex:Person. OWL inference propagates upward automatically when materialized. Over-typing at every ancestor level creates ETL maintenance burden; under-typing loses query precision when reasoning is disabled. Document typing policy in ontology README for data engineers.

Design Decisions

Decision Option A Option B When to choose
Ontology vs schema RDF ontology (TBox) SQL/JSON schema Ontology when semantics shared across systems
RDFS vs OWL RDFS + SHACL Full OWL 2 DL RDFS for most enterprise KGs; OWL when inference required
Reuse vs mint schema.org, FIBO Custom terms Reuse when equivalent exists
Central vs modular Single file owl:imports modules Modular for large domains
SKOS vs OWL classes SKOS for browse taxonomies OWL for logical constraints SKOS for nav tags; OWL for inference participants
TBox storage RDF only RDF TBox + LPG ABox projection Dual when app needs property graphs

Comparisons

Ontology vs schema vs taxonomy

Term Scope World assumption Example
Schema Storage structure Closed SQL columns, JSON Schema
Taxonomy Hierarchical terms N/A SKOS broader/narrower
Vocabulary Term list Open FOAF properties
Ontology Classes, properties, axioms Open FIBO, SNOMED, custom OWL

RDFS vs OWL vs SHACL vs SKOS

Layer Purpose When to add
SKOS Taxonomies, thesauri Content classification, search nav
RDFS Basic typing Always—foundation TBox
OWL Inference, logic Subclass inference, disjointness, equivalence
SHACL ABox validation Always in production—required fields

Ontology governance models

Model Pros Cons
Central committee Consistency Bottleneck
Domain module owners Scales Requires import discipline
Open contribution + RFC Engagement Needs strong review
No governance Fast start Becomes graph database chaos

Common Mistakes

  1. Ontology before use cases — 200 classes, zero ABox data. Model for competency questions.

  2. Duplicate synonymous classes:Client, :Customer, :Buyer without owl:equivalentClass.

  3. Confusing ontology with database schema — Expecting OWL to enforce "required field" (use SHACL).

  4. Over-restrictive OWLowl:FunctionalProperty on legitimately multi-valued properties.

  5. Unstable URIs — Changing URIs breaks downstream. Version ontologies; never rename published URIs.

  6. No human-readable definitionsrdfs:label without skos:definition leaves experts unable to validate.

  7. Ignoring license of reused ontologies—FIBO, SNOMED have usage terms.

  8. Publishing TBox without ABox consumers. Ontology teams ship v2.0 while ETL still maps to deprecated v1.2 terms—pin versions per environment and coordinate releases.

Where It Breaks Down

Ontology programs fail for organizational reasons as often as technical ones:

OWL reasoning performance on large ABox. Complex OWL 2 DL with rich restrictions over millions of individuals makes classification intractable—use EL/RL profiles or scope reasoning to TBox-only consistency checks.

Social agreement without executive sponsorship. Perfect technical ontology rejected by business units who weren't consulted—competency questions must include non-engineer reviewers from day one.

Neo4j label drift vs RDF TBox. Without explicit mapping (:Employeeex:Employee), property graph and RDF diverge silently. Maintain mapping table or neosemantics sync with CI diff checks.

SKOS-only taxonomies for operational data. Navigation hierarchies do not enforce that :Product nodes have price—pair SKOS browse trees with OWL classes and SHACL shapes on ABox.

Ontology versioning without migration playbooks. Deprecated terms without owl:deprecated and rdfs:seeAlso replacements leave ETL mappers guessing—every deprecation needs a sunset date and consumer notification.

Track unused class reports (zero ABox references in 90 days), SHACL violation trends by source feed, and RFC cycle time. When SPARQL competency tests fail after TBox change, roll back before ABox loads propagate.

When NOT

Skip formal ontology engineering when:

  1. Single team, single application, short lifespan — label conventions in Neo4j may suffice.

  2. No cross-system semantic sharing — closed-world SQL schema is simpler.

  3. Data is purely operational telemetry — time-series and metrics don't need conceptual modeling.

  4. Team cannot sustain stewardship — unpublished ontology rots faster than no ontology.

  5. Inference is never queried — RDFS + SKOS + SHACL may suffice without OWL.

Invest in ontologies when multiple teams, regulatory alignment, or LLM extraction validation require a durable semantic contract.

Running in Production

Best Practice

Best Practices — Version TBox in Git, SHACL on every ABox load, competency SPARQL in CI, steward RFC for changes, monitor unused class reports.

Dimension Consideration
Scaling Separate TBox reasoner from ABox if memory exceeds limits. Incremental reasoning for delta updates.
Latency Materialized inferences for hot queries. Reasoning async on TBox changes.
Cost Steward FTE is primary cost. Enterprise platforms (TopBraid, PoolParty) add licensing. Protégé + Git + Jena is viable OSS.
Monitoring TBox version per environment, SHACL violation trends, unused class reports, consistency check in CI.
Evaluation Competency question SPARQL suite after TBox changes. Domain expert sign-off.
Security Ontology URIs are public vocabulary. ACL applies to ABox instance data.

Important

Pair every OWL TBox with SHACL shapes for ABox validation. Reasoning alone does not catch missing required properties.

Diagram: Learning path

flowchart LR
    A[Knowledge Graphs] --> B[RDF]
    B --> C[Ontologies]
    C --> D[OWL]
    C --> E[SHACL]
    C --> F[SPARQL]
    C --> G[Enterprise KG]

Prerequisites: RDF · Knowledge Graphs

Next topics: OWL · SHACL · SPARQL

Interview Questions

  1. Ontology vs schema—what's the difference?

    • Expected: schema = closed storage structure; ontology = open-world semantic definitions with URIs.
  2. TBox vs ABox?

    • Expected: TBox = terminology (classes, properties); ABox = instance assertions (data triples).
  3. Why SHACL if you have OWL?

    • Expected: OWL open-world doesn't flag missing required fields; SHACL closed-world validation.
  4. Competency-question-driven design?

    • Expected: SPARQL questions drive which classes/properties to add; prevents unused complexity.
  5. How version an ontology in production?

    • Expected: versioned namespace URI, owl:deprecated, replacement pointers, pin version per environment.
  6. SKOS vs OWL classes?

    • Expected: SKOS for browse/nav taxonomies; OWL when terms participate in inference.
  7. Ontology on RDF but app on Neo4j—how align?

    • Expected: TBox in RDF; map labels to OWL classes; explicit projection/sync layer.
  8. When is ontology overkill?

    • Expected: single team, no cross-system sharing, no compliance inference—label conventions may suffice.

Key Takeaways

  • Ontologies define the shared vocabulary that distinguishes knowledge graphs from graph databases.
  • TBox (terminology) governs ABox (data); evolve them with different workflows.
  • Start RDFS + SHACL; add OWL when inference requirements justify complexity.
  • Reuse FIBO, schema.org, SNOMED before minting custom terms.
  • Govern changes with stewardship, versioning, competency questions, and CI validation.
  • SKOS for taxonomies; OWL for logic; SHACL for data quality—use the right layer.

FAQs

What is an ontology in simple terms?

A formal dictionary of concepts and relationships for a domain—machine-readable via RDF.

Ontology vs schema vs taxonomy?

Schema = storage structure. Taxonomy = hierarchical categories. Ontology = formal semantics with URIs and optional logic.

Do I need OWL or is RDFS enough?

RDFS + SHACL handles most enterprise KGs. Add OWL when automated inference is required.

What is SKOS used for?

Taxonomies and controlled vocabularies—preferred labels, broader/narrower—for search and content management.

What tool builds ontologies?

Protégé is standard OSS. Enterprise: TopBraid EDG, PoolParty.

How do ontologies relate to SHACL?

Ontologies define meaning (open world). SHACL validates data shape (closed world). Use both.

Can schema.org be my ontology?

Partially—for web entities. Extend with domain-specific terms for industry concepts.

What is a competency question?

A natural language question your KG must answer—drives ontology design. Validated as SPARQL tests.

How do ontologies help LLMs?

Stable entity types for extraction, SHACL validation of outputs, semantic context for GraphRAG.

What is ontology modularization?

Split into imported modules (product.owl, supplier.owl) so teams edit independently.

What is an ontology RFC workflow?

Proposal document with competency questions, proposed terms, impact on existing ABox mappings, steward review, and CI SPARQL regression before merge to main TBox branch.

How align TBox with Neo4j labels?

Maintain explicit mapping table (:Employeeex:Employee) in schema registry; CI checks that new labels have TBox correspondence or documented exception for ephemeral types.

How measure ontology health?

Unused class count, SHACL violation rate by source, RFC cycle time, competency test pass rate, and ABox coverage (% instances typed with most specific known class).

How often should we review the ontology?

Quarterly minimum for active enterprise KGs. Ad-hoc review when major source systems change, regulatory ontology releases (FIBO, SNOMED), or LLM extraction error rates spike due to type mismatches.

Can we use ontologies without a triple store?

You can publish TBox as OWL files in Git and validate ABox in CI with pySHACL without a production SPARQL endpoint—but consumption still requires RDF tooling somewhere in the pipeline. Property graph-only teams should maintain TBox as reference documentation even if ABox lives in Neo4j.

What is the difference between ontology and knowledge graph schema?

Ontology is the semantic model (TBox) with formal definitions and optional logic. Knowledge graph schema encompasses ontology plus SHACL shapes, ETL mapping rules, label registries for LPG projections, and consumption API contracts—the full operational contract around the data.

Who should own the ontology steward role?

Typically a senior data architect or semantic engineer with domain liaison responsibilities—not a rotating developer assignment. Stewards need authority to reject RFCs, schedule quarterly reviews, and coordinate with compliance on external ontology licenses (FIBO, SNOMED).

References

Next Topics

Learning Path

Continue Learning

Related Guides

Related Tools

ToolCategoryPurposeWebsiteBest For
Neo4j Vector Index
CloudSelf-hosted
Vector DBVector search on Neo4j graph database — combine embeddings with knowledge graphs.neo4j.comGraphRAG
LangChain
PopularOpen SourceAPI
frameworksFramework for building LLM-powered applications and workflows.langchain.comRAG systems
LlamaIndex
Open SourceAPI
frameworksData framework for connecting LLMs to private and structured data.llamaindex.aiRAG over documents

Related Rankings