Data modeling with explicit relationships
Building evidence AI can trace
Two core concepts for giving data "meaning"
A formal definition of concepts and relationships in a domain. "Customers place orders, orders contain products, products belong to categories" — expressed in a machine-readable format. An ontology is a schema — it defines the structure and rules of data, not the data itself.
Actual data connected as nodes and edges based on an ontology. If the ontology says "customers place orders," the knowledge graph says "John placed Order #1234." A knowledge graph contains instance data.
Relational DBs express relationships through tables and JOINs. As relationships deepen, JOINs get complex and performance drops. Knowledge graphs store relationships as first-class citizens — finding "3-hop relationships" is natural and fast. When AI needs "categories of products bought by John's colleagues," graph traversal beats 5 JOINs.
Vector retrieval is strong at finding semantically similar documents, but it does not preserve relation types and paths explicitly. Knowledge graphs supply that structure for multi-hop traversal and corpus-level synthesis. The benefit still depends on the data, questions, and extraction quality, so validate it per task, as in Microsoft Research's GraphRAG study.
You don't need OWL on day one — add depth incrementally
A list of terms with definitions
Starting PointHierarchy (is-a). e.g. Animal > Mammal > Dog
ClassificationSynonyms, related terms, broader/narrower
RelationsProperties, constraints, logical rules, inference
ReasoningEvery knowledge graph is built from Subject-Predicate-Object triples
If vector search hit its limits — graphs may be the answer
| Query Type | Vector RAG | GraphRAG | Recommendation |
|---|---|---|---|
| "Find docs about topic X" | Good fit | Overkill | Vector |
| "What's the relationship between A and B?" | Insufficient | Good fit | Graph |
| "Exact total sales of X last month?" | Poor fit | Generated answer is risky | Direct DB/graph query |
| "Path of influence from A to B?" | Can't do | Good fit | Graph |
| "Summarize latest papers on this topic" | Good fit | Unnecessary | Vector |
Tools for building your own knowledge graphs
For first-time ontology builders
Research shows ontologies extracted from DB schemas perform comparably to text-derived ones, at far lower cost. Feed DDL (table definitions) to an LLM to auto-extract classes, properties, and relationships. Leverage existing data structure.
Start with only the core nodes and relations needed to answer the first competency questions. There is no universal right class count. Expand incrementally when a new question cannot be represented, and record why.
There is no need to abandon vector search. Route semantic retrieval to vectors, relationship traversal and global synthesis to graphs, and exact aggregation to direct queries. Validate that policy on the real question distribution.
The biggest issue in early GraphRAG: "John Doe, 45" vs "John Doe, age 45", "Type 2 Diabetes" vs "T2D". If the same entity has different names, the graph breaks. Synonym dictionaries and normalization are essential.