← Explore the writing

Notes

Ontology vs Knowledge Graph vs Graph Database

Sanket Jagtap / My WorksEnterprise AI field guide • 001
Data architecture · Knowledge systems · GraphRAG

Ontology vs
Knowledge Graph
vs Graph Database

Three different jobs. One connected enterprise. A practical explanation using Sanket’s Clean Hospital—a fictional hospital chain.

Understanding these distinctions matters when organisations want AI systems that can connect facts, trace evidence, and answer questions across fragmented data.

THREE LAYERS — NOT SYNONYMS
01 / Ontology → Meaning
02 / Knowledge graph → Connected facts
03 / Graph database → Storage and querying*

*A graph database is useful, but not mandatory for every knowledge graph.

01 / DEFINEOntology

What concepts and relationships mean.

02 / CONNECTKnowledge graph

What entities and facts are connected.

03 / OPERATEGraph database

How connected data can be persisted and queried.

01 / ONE RUNNING EXAMPLE

Meet Sanket’s Clean Hospital.

Imagine a healthcare group with three hospitals. Its systems work individually, but executives and operations teams struggle to answer questions that cross organisational and software boundaries.

FICTIONAL GROUP / ILLUSTRATIVE DATA ONLY
HOSPITAL 01NashikRadiology · Cardiology
HOSPITAL 02MumbaiSurgery · Diagnostics
HOSPITAL 03PuneOutpatient · Rehabilitation
Systems: electronic health records (EHR), enterprise resource planning (ERP), HR, equipment maintenance, appointments, and policy documents.

The equipment register calls a scanner MRI-07. A service contract refers to the same asset using a vendor identifier. A maintenance record mentions “Nashik MRI”. A policy document sets rules for planned downtime. No single system connects all four records reliably.

“Which hospital has scanner MRI-07, who maintains it, and what must be checked before scheduling downtime?”

That question seems simple. Answering it responsibly requires agreed meanings, resolved identities, linked facts, current policies, and traceable evidence.

02 / INTERACTIVE EXPLAINER

One question. Three architectural layers.

Switch between the layers. The illustration changes from a model of allowed meanings to a network of specific facts to the infrastructure used to query them.

Facility (class)Equipment (class)Service (class)hasAssetoffers
MEANING

Define the vocabulary and relationships.

An ontology describes concepts such as Facility, Equipment, and Service; it may state class hierarchies, relationship semantics and other logical axioms.

It does not mean that MRI-07 exists or is installed in Nashik. Those are specific facts, not definitions.

Working analogy: ontology is the grammar, the knowledge graph is the set of meaningful statements, and the graph database is one possible system for storing and querying them. The analogy is useful, though not a formal definition.

03 / A TECHNICAL DISTINCTION THAT MATTERS

Ontology is not the same as validation.

The term “schema” is often used loosely, concealing three different jobs. In the hospital example they should remain separate.

01 / VOCABULARY

Name

Agree on identifiers and terms: Facility, Equipment, installedAt, serviceContract.

02 / SEMANTICS

Explain

Use RDFS/OWL where formal class and relationship semantics or inference are valuable.

03 / VALIDATION

Check

Use SHACL or equivalent rules to test required identifiers, valid values, and data completeness.

Why OWL alone is not enough for operational checks.

OWL generally operates with open-world semantics: if a record does not say an MRI has a service contract, this absence does not automatically prove no contract exists. A validation rule can flag the missing field for remediation. Different mechanisms solve different problems.

Clinical meaning also requires care: “recorded diagnosis”, “suspected diagnosis”, and “confirmed diagnosis” are not interchangeable. A clinical assertion should retain its author, source, status, date, and provenance. This article uses non-patient operational data to demonstrate the architecture.

04 / REFERENCE ARCHITECTURE

Build the knowledge layer, not just a diagram.

Buying a graph database does not create a useful knowledge graph. Most of the hard work happens before and around storage.

01 / INGEST

Collect

Bring in EHR metadata, ERP, HR, maintenance, policy and appointment sources.

02 / NORMALISE

Translate

Map codes and fields to common concepts; maintain terminologies and versions.

03 / RESOLVE

Identify

Reconcile “Nashik MRI”, “MRI-07” and the vendor asset identifier.

04 / MODEL

Validate

Apply ontology semantics and operational quality rules where needed.

05 / PUBLISH

Connect

Maintain edges, provenance, timestamps, versions and permissions.

06 / CONSUME

Use

Support graph queries, search, operations intelligence and GraphRAG.

The biggest source of failure is often entity resolution.

If the maintenance system and contract repository use different identities for one scanner, a graph can look complete while producing an incomplete or misleading answer. Define a canonical identity strategy, reconciliation rules and exception handling before promising enterprise intelligence.

05 / MODEL SELECTION

RDF vs property graphs: choose for the workload.

RDF and property graphs are ways to represent graph data. They are not competing definitions of a knowledge graph, and neither must be paired exclusively with a single product or semantics approach.

ConsiderationRDF approachProperty-graph approach
ModelSubject–predicate–object statementsNodes and relationships with properties
Common toolsRDF, RDFS, OWL, SHACL, SPARQLCypher, GQL, vendor-specific tools
Often useful forInteroperability, linked datasets, formally expressed semanticsApplication traversal, relationship-centric operational queries
Hospital exampleAlign shared terminology and entity descriptions across systemsTraverse facility → equipment → contract → maintenance workflow
Watch-outStandards adoption does not guarantee data qualityFast traversal does not guarantee semantic consistency

You can use formal ontologies with other data architectures, and RDF stores also support substantial operational workloads. Evaluate semantics, interoperability, query patterns, scalability, cost, team capabilities, and governance—not marketing labels.

06 / GRAPH RETRIEVAL-AUGMENTED GENERATION

What changes when an AI assistant can follow relationships?

In conventional retrieval-augmented generation (RAG), a model often receives relevant document passages. GraphRAG adds graph-based retrieval, traversal, or graph-derived context to help identify connected evidence. Different GraphRAG implementations use different graph construction and retrieval strategies.

INTERACTIVE / ALL RECORDS BELOW ARE FICTIONAL
Ask the hospital operations graph
QUERY + EVIDENCE PATH

Where is MRI-07 and what should we check before downtime?

  1. MRI-07 → installedAt → Nashik
  2. MRI-07 → servicedUnder → SC-18
  3. SC-18 → governedBy → Policy P-12 v3
ILLUSTRATIVE GROUNDED ANSWER

Records place MRI-07 at Nashik Hospital. Before downtime, operations should verify contract SC-18, the approved maintenance window, clinical bookings and the current policy P-12. The system must retrieve the original sources before approving or acting.

Synthetic evidence: asset A-07 · contract SC-18 · policy P-12 v3.

Where GraphRAG can help

Connected retrieval is especially valuable when a question requires joining multiple entities, following multi-hop dependencies, or preserving evidence paths: Which devices depend on a contract expiring next month? Which facilities use a policy that has been superseded? Which operational teams own a disrupted service?

Where it does not solve the problem

A graph cannot repair incorrect source facts merely by connecting them. Entity matching errors, outdated documents, missing permissions, weak retrieval and model hallucinations remain possible. Test answer correctness, citation accuracy, freshness, access control and failure behaviour on representative questions.

Healthcare safety boundary.

This example illustrates enterprise operations, not patient care recommendations. Real clinical deployments require appropriate privacy, safety, oversight and validation. A generated answer is not a substitute for approved policy or professional judgment.

07 / DECISION FRAMEWORK

What should an enterprise actually build first?

Start with the decisions people need to make, then work backwards to data and architecture.

FIRST

Define questions

Pick 10 high-value operational questions. Specify the evidence required for each answer.

SECOND

Prove identities

Audit identifiers, systems of record, source quality, data owners and change frequency.

THIRD

Build a thin graph

Model a small domain, test queries and compare against a simpler non-graph baseline.

FOURTH

Evaluate retrieval

Measure precision, completeness, latency, provenance and access-control enforcement.

FIFTH

Govern change

Assign stewards, version semantics, maintain mappings and monitor outdated assertions.

SIXTH

Scale selectively

Expand only when graph benefits justify extraction, operations and maintenance costs.

The practical choice is not “graph or no graph”. It is whether the relationships you need to reason over justify explicitly modelling and maintaining a knowledge layer.

08 / FREQUENTLY ASKED QUESTIONS

Short answers to common confusions.

Can a knowledge graph exist without an ontology?

Yes. Graph data can be created without a formal ontology. But agreed vocabulary, identity rules and governance become increasingly important as scale and reuse increase.

Does a knowledge graph require Neo4j or any graph database?

No. A dedicated graph database is one possible implementation. RDF stores, files, relational representations and hybrid architectures may all be appropriate depending on the workload.

Are ontologies and knowledge graphs the same thing?

No. An ontology defines vocabulary and semantics; a knowledge graph represents connected entities and assertions. The ontology can help interpret and constrain a graph, but the two are not interchangeable.

Is GraphRAG always better than vector search?

No. GraphRAG can help with multi-hop relationships and structured context, but graph extraction, maintenance and retrieval introduce cost and error modes. Test it against strong vector and hybrid baselines.

Can this architecture use healthcare standards?

Yes. Standards such as HL7 FHIR and relevant terminologies can inform mappings and interoperability. However, standards conformance alone does not establish clinical safety, privacy compliance or correct operational data.

The point to remember.

Ontology makes concepts interpretable. A knowledge graph connects facts. A graph database is one possible way to make those connections operational. Enterprise AI becomes more useful when the relationships are correct, the evidence is traceable and the resulting answers are governed.

STANDARDS AND FURTHER READING

Primary references.

This page is educational. All Sanket’s Clean Hospital names, records, operational scenarios and answers are fictional.

SANKET JAGTAP · MY WORKS · STRATEGY / DATA / AI

Leave a Reply

Your email address will not be published. Required fields are marked *