What is a Knowledge Graph?
A knowledge graph is a structured representation of real-world entities and the relationships between them. Instead of rows in tables, a knowledge graph stores facts as a network of nodes and edges.
The Three Building Blocks
- Nodes (entities): The things you care about — people, products, places, concepts
- Edges (relationships): How entities relate — works_at, invented, located_in
- Properties: Attributes attached to nodes or edges — names, dates, scores
Real-World Examples
- Google's Knowledge Graph powers the info panels on search results — billions of entities and relationships about people, places, and things.
- Wikidata is an open, community-maintained KG with over 100 million items.
- Facebook's Social Graph models users, friendships, pages, and interests.
- Pharmaceutical KGs link drugs, proteins, diseases, and clinical trials to accelerate discovery.
Why Graphs Instead of Tables?
Relational databases excel at structured, uniform data. But the real world is messy and relationship-heavy. In a KG:
- Adding a new relationship type doesn't require a schema migration
- Multi-hop questions ("friends of friends who like jazz") are first-class operations
- The graph itself is the data — relationships are explicit and queryable