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.
*A graph database is useful, but not mandatory for every knowledge graph.
What concepts and relationships mean.
What entities and facts are connected.
How connected data can be persisted and queried.
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.
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.
That question seems simple. Answering it responsibly requires agreed meanings, resolved identities, linked facts, current policies, and traceable evidence.
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.
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.
Populate the model with evidence.
The graph asserts that Nashik Hospital has MRI-07 and that the asset is associated with service contract SC-18. Each edge should carry or link to source, validity, timestamp, and responsible system.
A knowledge graph is the connected knowledge itself—not a synonym for the software that stores it.
MATCH (f:Facility)-[:HAS_ASSET]->(a:Equipment) WHERE a.assetId = 'MRI-07' RETURN f.name, a.assetId;
A query retrieves linked data from a property-graph implementation. Other storage and query approaches are possible.
Persist and retrieve connected data.
A graph database can provide indexed nodes and edges, traversal queries, transactions, and access mechanisms. It does not automatically give the graph reliable identities, semantics, or provenance.
Knowledge graphs can also be stored using RDF datasets, relational infrastructure, or other architectures.
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.
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.
Name
Agree on identifiers and terms: Facility, Equipment, installedAt, serviceContract.
Explain
Use RDFS/OWL where formal class and relationship semantics or inference are valuable.
Check
Use SHACL or equivalent rules to test required identifiers, valid values, and data completeness.
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.
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.
Collect
Bring in EHR metadata, ERP, HR, maintenance, policy and appointment sources.
Translate
Map codes and fields to common concepts; maintain terminologies and versions.
Identify
Reconcile “Nashik MRI”, “MRI-07” and the vendor asset identifier.
Validate
Apply ontology semantics and operational quality rules where needed.
Connect
Maintain edges, provenance, timestamps, versions and permissions.
Use
Support graph queries, search, operations intelligence and GraphRAG.
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.
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.
| Consideration | RDF approach | Property-graph approach |
|---|---|---|
| Model | Subject–predicate–object statements | Nodes and relationships with properties |
| Common tools | RDF, RDFS, OWL, SHACL, SPARQL | Cypher, GQL, vendor-specific tools |
| Often useful for | Interoperability, linked datasets, formally expressed semantics | Application traversal, relationship-centric operational queries |
| Hospital example | Align shared terminology and entity descriptions across systems | Traverse facility → equipment → contract → maintenance workflow |
| Watch-out | Standards adoption does not guarantee data quality | Fast 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.
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.
Ask the hospital operations graph
Where is MRI-07 and what should we check before downtime?
- MRI-07 → installedAt → Nashik
- MRI-07 → servicedUnder → SC-18
- SC-18 → governedBy → Policy P-12 v3
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.
Which site offers cardiology, and who manages the schedule?
- Nashik → offers → Cardiology
- Cardiology → schedule → CAL-NK-04
- CAL-NK-04 → ownedBy → Nashik Operations
The fictional service catalogue lists cardiology at Nashik, with the schedule owned by the Nashik operations team. Real-time appointment availability still requires the booking system.
Synthetic evidence: service catalogue S-11 · calendar CAL-NK-04.
Who owns the radiology downtime policy?
- Radiology → uses → MRI-07
- MRI-07 → subjectTo → Policy P-12
- Policy P-12 → ownedBy → Clinical Operations
The example graph links the policy to Clinical Operations. Before applying it, retrieve its document, effective date, current approval status and any replacement versions.
Synthetic evidence: policy register P-12 · ownership record O-04.
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.
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.
What should an enterprise actually build first?
Start with the decisions people need to make, then work backwards to data and architecture.
Define questions
Pick 10 high-value operational questions. Specify the evidence required for each answer.
Prove identities
Audit identifiers, systems of record, source quality, data owners and change frequency.
Build a thin graph
Model a small domain, test queries and compare against a simpler non-graph baseline.
Evaluate retrieval
Measure precision, completeness, latency, provenance and access-control enforcement.
Govern change
Assign stewards, version semantics, maintain mappings and monitor outdated assertions.
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.
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.
Primary references.
- W3C — Resource Description Framework (RDF)
- W3C — Web Ontology Language (OWL)
- W3C — Shapes Constraint Language (SHACL)
- ISO — GQL (ISO/IEC 39075:2024)
- HL7 — FHIR RDF
- Microsoft — GraphRAG repository
This page is educational. All Sanket’s Clean Hospital names, records, operational scenarios and answers are fictional.