A knowledge graph is a structured representation of information as a network of entities (nodes) and relationships (edges), enabling computers to model complex real-world facts and their interconnections. Entities can be people, places, events, concepts, or any identifiable thing; relationships describe how entities are connected (born_in, part_of, discovered_by). Knowledge graphs power search engines (Google Knowledge Graph), virtual assistants (Siri, Alexa), recommendation systems, and AI reasoning engines.
Knowledge graphs are typically represented using the Resource Description Framework (RDF), a World Wide Web Consortium (W3C) standard that encodes facts as subject-predicate-object triples: (Marie Curie) - (born in) - (Warsaw). SPARQL is the query language for RDF graphs, analogous to SQL for relational databases. SPARQL allows complex queries like "list all Nobel Prize winners in physics who were born in Eastern Europe." Large public knowledge graphs include Wikidata (90+ million entities), DBpedia, and Freebase (now defunct).
Graph neural networks (GNNs) learn representations of nodes and edges that can be used for link prediction (what new facts are likely true?), entity classification (what type of thing is this?), and question answering. Knowledge graph completion — automatically inferring missing facts — is an active research area using embedding methods (TransE, RotatE, ComplEx) that represent entities as vectors and relationships as geometric operations in embedding space. Large language models are increasingly combined with knowledge graphs to ground their responses in verified factual databases.
A relational database stores data in structured tables with predefined schemas. A knowledge graph stores data as a flexible network of entities and relationships, making it easy to add new types of entities or relationships without redesigning the schema. Knowledge graphs excel at representing complex, interconnected, and heterogeneous information where relationships between data points are as important as the data itself.
An RDF triple is a subject-predicate-object statement encoding one fact. For example: (Albert Einstein, bornIn, Ulm) or (Ulm, locatedIn, Germany). Subjects and objects are entities (identified by URIs), and predicates are relationships. A knowledge graph is a collection of millions of such triples that together encode a rich factual network.
Google's Knowledge Graph (launched 2012) underpins the information panels shown on the right side of search results, providing structured answers to queries like "Who is Marie Curie?" It contains billions of entities and relationships sourced from Wikipedia, Freebase, and other data providers. It enables Google to understand queries semantically (recognising that "Einstein" refers to the physicist) rather than just matching keywords.
Knowledge graph embedding maps entities and relationships to continuous vector spaces such that the geometry captures the graph's structure. The TransE model represents a triple (h, r, t) as h + r ≈ t — the head entity plus the relation vector should approximately equal the tail entity vector. Embeddings enable link prediction (finding missing triples), entity similarity computation, and input to machine learning models.
Biomedical knowledge graphs link genes, proteins, diseases, drugs, pathways, and clinical trials. Graph-based analysis can find candidate drugs for a new disease by identifying existing drugs that target proteins implicated in that disease. Link prediction identifies likely interactions between drug compounds and biological targets. This approach helped accelerate COVID-19 drug repurposing research in 2020.