What Is A Knowledge Graph?
In interviews, I’m often hit with the question: "What exactly is a knowledge graph?" It’s a fair ask, and one I’ve answered more times than I can count. So, I figured - why not put it down in writing?
Here’s my take, distilled into a post.
🔵 Graphs: The Invisible Web of Connections:
Before we dive into knowledge graphs, let’s talk about graphs - not the bar charts in Excel - but the kind made of nodes (things) and edges (relationships between things).
Take a social network like Facebook. Each person is a node, and every friendship between them is an edge. If you’re friends with Alice, and Alice is friends with Bob, then Bob is just one hop away in your network. Simple. That’s a graph: a way of modelling relationships between connected entities.
But real-world relationships aren’t just about people being friends. Alice lives in London. Bob works at a company. That company has an office in New York. Suddenly, we’re dealing with different types of nodes (people, cities, companies) and different types of relationships (friendship, employment, location). This is no longer a simple social network - this is where graphs level up into something far more powerful.
🔵What Makes a Graph a "Knowledge" Graph?
In a simple graph, an edge between two nodes just means "these things are connected." In a knowledge graph, the edges say how and why they are connected.
Let’s expand our example. Suppose Alice isn’t just a person - she’s a doctor. She works at a hospital. That hospital is located in London and specialises in cardiology. Instead of an undifferentiated mess of connections, we now have semantics - explicit labels that tell us what each node and edge means.
This is what turns a graph into a knowledge graph: it captures relationships, categories, and meanings. It understands that a person isn’t the same as a company, and that "works at" is different from "has visited."
🔵The Ontology: A Knowledge Graph’s Rulebook:
Now, here’s where it gets interesting. All this meaning - the way nodes and edges relate - isn’t just stored haphazardly. It’s distilled into a graph-based schema called an ontology.
Think of an ontology as a rulebook that defines how concepts in a knowledge graph are related. It tells us that:
🔹 A Person can "live in" a City or "work for" a Company
🔹 A Company can "have an office in" a City
🔹 A Doctor is a special kind of Person who "specialises in" a Field of Medicine
This ontology acts as a semantic scaffold, ensuring that everything in the knowledge graph adheres to meaningful, structured relationships. This means computers can start making logical inferences - if Alice is a doctor at a cardiology hospital, she probably knows something about heart disease, even if that fact isn’t explicitly stated.
🔵 Why Are Knowledge Graphs Everywhere Right Now?
Because a Knowledge Graph is a web of meaning - and in a world where intelligence becomes cheap, meaning is set to become everything.