ATLAS NOVA My AtlasVelocer ↗

Technology · Language models

Knowledge graph

A knowledge graph is a graph of data that accumulates and conveys knowledge of the real world.

Its nodes stand for entities, the things one wants to talk about, and its edges stand for relations between those entities.⁠[1] A node indicates an entity, which may be a real object or an abstract concept.⁠[1] The relations are stored as edges connecting nodes, where the edge between two nodes conveys the semantic relation between the two entities.⁠[1]

Key facts
2,250,197relationships of 24 types in Hetionet v1.0, Himmelstein et al. 2017⁠[2]
69%margin by which Decagon beat baselines predicting polypharmacy side effects, Zitnik et al. 2018⁠[3]
0.863mean AUC of the knowledge graph embedding adverse drug reaction model, Zhang et al. 2021⁠[4]
220 millionrelationships in the Clinical Knowledge Graph platform, Santos et al. 2022⁠[5]

Overview

What a knowledge graph is

The basic statement a knowledge graph records is a link between two entities. Bill Gates can be linked to Microsoft because he founded the company, so the pair has a relationship in the real world that the graph can capture.⁠[1] Read as a sentence, the link has a subject, a relation and an object, and the graph stores it as an edge running from one node to the other. A graph made of such links is a directed graph: the relation is not necessarily symmetric, so the direction of a link carries meaning, and the head entity points to the tail entity along the relation's edge. The founder link runs from the person to the company, and because the relation is not necessarily symmetric, the direction of a link matters.⁠[1] Direction is therefore part of the fact, not a formatting detail.

Two stacked panels connect Person and Company types to Person A and Company B instances, with founderOf arrows and four numbered callouts.
A fictional founder relationship connects two entities, while an ontology defines their types and the relation's meaning. Dashed arrows link instances to their types. View full-size image.Knowledge Graph Schema and Instances by Atlas Nova. Illustration generated with AI for this article and checked against its text.

Schema and semantics

A collection of links is only useful if the links mean the same thing everywhere they appear. Knowledge graphs handle this with an ontology, a schema that defines the properties of a specific domain and how they relate to one another. The ontology is a schema that shows the properties of a specific domain and how they are related.⁠[1]

The other property that separates a knowledge graph from a diagram drawn for human readers is formal semantics, a precise, machine-interpretable meaning attached to every node, edge and label. These representations use formal semantics, which allows computers to process them efficiently and unambiguously.⁠[1] That is what makes the graph something a program can traverse, join against other data, and reason over, rather than a picture that only a person can interpret.

A useful way to hold the idea together is to see the three layers as answering different questions. The nodes answer "what things are there?" The edges answer "how are they connected?" The ontology answers "what do those connections mean, and which ones are allowed?" A graph with nodes and edges but no shared schema can still be stored and drawn, but its links are only as meaningful as the private conventions of whoever built it. Adding the schema is what turns a heap of connections into knowledge that other systems can reuse.

It helps to contrast this with the data structures most people know first.

The definition above is the common core, but it is worth knowing that the term is used with some looseness. Surveys of the field note that precisely defining a knowledge graph is difficult because multiple conflicting definitions circulate, and they often settle on a working definition suited to their domain.⁠[6] The essential commitment stays the same across those definitions: entities as nodes, relations as edges, and a formal, machine-readable structure that lets a computer use the knowledge rather than merely store it.

History

From Google's graph to a research field

The name itself has a date and a company behind it. In 2012, Google first put forward Knowledge Graph by introducing their knowledge base called Google Knowledge Graph.⁠[1] The phrase then spread outward from a single product into a general label for a kind of data structure, and the label stuck because it described something many organisations were already trying to build: a machine-readable map of the things they knew about and how those things connected.

A three-row subject-relation-object table sits beside a triangular directed graph, above examples of encyclopedic, social and lexical domains.
A table of triples and a directed graph encode the same three fictional facts. Different knowledge graph domains share this structure while varying in sources and scope. View full-size image.Same Facts, Two Views by Atlas Nova. Illustration generated with AI for this article and checked against its text.

Once the idea had a name, public graphs followed in numbers, each built from a different starting material. DBpedia was intended to discover semantically meaningful information from Wikipedia and convert it into a well-structured ontological knowledge base. Freebase was built upon multiple sources to provide a structured and global resource of information. Facebook's entity graph converted the unstructured content of user profiles into meaningful structured data. Wikidata is a cross-lingual, document-oriented graph supporting many sites and services such as Wikipedia, while Yago extracts a large number of entities and their relationships from sources including Wikipedia and WordNet. WordNet, older than the rest, is a lexical knowledge base that measures semantic similarity between words through hierarchical concept graphs.⁠[1]

The variety in that list is the point. Some of these graphs are encyclopedic, some social, some lexical; they were assembled for different purposes and from different raw material. What they share is the underlying commitment described earlier: entities as nodes, relations as edges, and a formal structure a machine can process. A reader who meets the term in one context should therefore not assume the graph looks like the one met in another. The schema, the coverage and the granularity all vary with the source.

A note on vocabulary is needed here, because the field does not keep its terms apart. Generally, the knowledge graph and the knowledge base are regarded as the same concept and are used interchangeably. A knowledge base is a typical data set that represents real-world facts and semantic relations in the form of triplets, and when those triplets are represented as a graph with edges as relations and nodes as entities, it is considered a knowledge graph.⁠[1] The distinction, where one is drawn at all, is one of emphasis rather than of kind: the same store of facts can be described either way depending on whether the speaker is thinking about the data or about its shape.

That looseness is worth holding onto rather than fighting. It explains why the literature ranges so widely, from encyclopedic projects to lexical resources, under a single heading, and why a definition suited to one domain may not transfer neatly to another. The term names a family of structures and a research programme around them, not a single standardised format.

How it works

Nodes, edges and triples

Everything a knowledge graph holds is built from one small unit. The triple is the fundamental unit of a knowledge graph, written as (subject, predicate, object) or, in the vocabulary used for prediction, (head, relation, tail).⁠[1] The subject and object are entities drawn from the graph's nodes; the predicate is the relation drawn from its edges. A triple is therefore not a new kind of object sitting beside nodes and edges. It is the smallest complete statement the graph can make, and every larger structure in the graph is a collection of such statements sharing entities.

The Bill Gates example shows how the three parts fit together. The triple (Bill Gates, founderOf, Microsoft) records that the person node points to the company node along a founder relation. The first entity is the head entity and the second is the tail entity, so the head is where the relation starts and the tail is where it lands.⁠[1] Reading the triple as a sentence gives the same order: subject, then relation, then object. Reading it backwards does not give a different phrasing of the same fact but a different fact, and usually a false one.

That asymmetry is why a knowledge graph is described as a directed graph. Since the relation is not necessarily symmetric, the direction of a link matters, and the head entities point to the tail entities via the relation's edge.⁠[1] Direction is stored as part of the fact rather than inferred from context, which is what allows a machine to answer a question like "who founded this company" without having to work out which end of the link is which. A relation that genuinely runs both ways, such as one company resembling another, can be recorded in both directions, but the graph does not assume it.

Two ways to store the same triples

The triple is a logical unit, not a file format, and two representation schemes are commonly used to hold it. Resource Description Framework (RDF) and Labeled Property Graphs (LPGs) are the two typical ways to represent and manage knowledge graphs.⁠[1] Both can express the same set of subject-relation-object statements; they differ in how much extra material they attach to each statement and in the query languages built around them. The choice is an engineering decision about tooling and interoperability, not a change in what the graph means.

Because the triple is uniform, a graph can be extended one statement at a time. Adding a new fact means adding a triple, and adding a new kind of fact means adding triples with a predicate the schema did not previously use. Nothing about the existing statements has to be reshaped, which is the flexibility that makes the structure suit domains where knowledge arrives unevenly. The cost is that meaning depends heavily on the predicate being used consistently, which is the job of the ontology described earlier.

The uniformity also makes the graph easy to query by pattern. A question becomes a triple with one part left blank, and answering it means finding the entities that fill the blank. Longer questions chain triples together through shared entities, following a path from one node to another. That chaining is the basis for most of what knowledge graphs are used for, from answering questions to predicting links that are not yet in the graph, and it is why the triple, small as it is, carries the whole design.

A triple is one fact: two entities and the directed relation between them.

A triple is the smallest complete statement, made of an entity, a relation and another entity.

Building a graph from databases and text

A knowledge graph does not arrive finished. It has to be assembled, and the assembly is called knowledge acquisition: the work of finding facts and getting them into the graph as nodes and edges. The facts come from two very different kinds of raw material. One is structured data already organised in tables and databases, where the relations are explicit and only need to be translated into the graph's vocabulary. The other is unstructured text, where the relations are buried in sentences written for human readers and must be pulled out by some process, whether a person reading carefully or a program scanning at speed.

The structured route is the simpler one. Knowledge is imported from structured sources by employing mapping languages, such as R2RML, which state how rows and columns in a database correspond to entities and relations in the graph.⁠[1] A table of genes and a table of diseases, each with a column naming the other, can be turned into nodes and edges by a mapping that says which column is the entity and which is the relation. The mapping is written once and applied mechanically, so the graph inherits whatever precision and whatever gaps the source database already had.

The unstructured route is where most of the difficulty lives, and it is where biomedical work has done the most to show how the trade-offs fall. Biomedical knowledge graphs are often constructed from manually curated databases, in which domain experts read the literature and annotate the sentences that assert a relationship.⁠[6] A curator reads a paper, finds the sentence claiming that one protein interacts with another, and records the edge. The result is precise: a human has judged that the sentence really does assert the relation, so the edges that make it into the graph are usually correct.

The cost of that precision is coverage. Studies have shown that databases built by manual curation contain relatively precise data but the recall is low.⁠[6] Recall here means the share of the relations that actually exist in the literature which the database manages to capture; low recall means many true relations are simply never recorded. The reason is volume. The publication rate is too high for curators to keep up, so the queue of unread papers grows faster than the reading. The COSMIC database, assembled by experts scanning the literature for cancer-related genes, held approximately 35 million entries in 2016 and had grown to 45 million by 2018, a pace that shows both how much there is to record and how far behind any manual effort must fall.⁠[6]

Machines reading the text

Automated extraction tries to close that gap, and it comes in several flavours that differ in how much human guidance they need. The simplest is rule-based extraction, which identifies essential keywords and grammatical patterns to detect relationships of interest.⁠[6] The patterns are built by experts who work out, from the grammatical structure of sentences, what a relationship-asserting sentence tends to look like, and then let the program match that shape across a corpus. A pattern matcher built to find drug-disease treatments matched drug-disease pairs from a clinical trials registry against pairs mentioned in abstracts, and the sentences it found were used to write simple patterns such as "drug in the treatment of disease" that could then be matched elsewhere. Evaluated on two hand-curated datasets, that system reached a precision of 0.904 and a recall of 0.131. The high precision means that when it flagged a sentence it was almost always right; the low recall means it found only a small fraction of what was there, because the patterns it had learned were too specific to catch infrequent drug pairs.⁠[6]

That pairing of high precision with low recall is the recurring shape of the problem. Rules can be made strict enough to trust, but strict rules miss the unusual phrasings, and loosening them lets errors in. A different family of methods gives up on hand-written rules and lets statistics do the work.

Unsupervised extraction draws inferences from text without annotated labels, typically through clustering or statistical calculation. One such signal is co-occurrence, the appearance of two entities together in the same piece of text; the assumption is that pairs mentioned together more often than chance are likely to be related. Two databases, DISEASES and STRING, were populated this way from PubMed abstracts, measuring how often pairs were mentioned within individual sentences and within whole abstracts, and the approach identified 543,405 disease-gene associations and 792,730 high-confidence protein-protein interactions.⁠[6] Co-occurrence needs no labelled training data and scales to any corpus, but it cannot tell a sentence asserting a relation from one merely mentioning both things, so its output is a candidate list rather than a set of established facts.

Supervised extraction sits between the two. It uses labelled sentences, examples marked as asserting a relationship or not, to construct generalised patterns that separate the positive cases from the negative ones. The labels are the expensive part, and much of the progress in this area has come from publicly available pre-labelled datasets built by curators for shared open tasks. With those in hand, a classifier can be trained to recognise the linguistic shape of an assertion, and the methods range from linear classifiers such as support vector machines, which map a sentence into a high-dimensional space and draw a boundary between the classes, to deep learning models that learn the mapping themselves.⁠[6]

Mixing the methods

None of these approaches is used alone in practice, because their weaknesses are complementary. Manual curation is precise but cannot keep pace; automated extraction is fast but noisy. A semi-automatic arrangement uses an automated system to pre-filter the text, removing irrelevant sentences so that curators only review the plausible ones, and this saved curators an average of 2 to 2.8 hours compared with working through the text unaided. The automated stage still tends to miss lesser-known relationships and to struggle with ambiguous sentences, which makes correcting its output a task in itself. Manual curation also keeps a role that automation cannot fill: it generates the gold-standard datasets that automated systems are validated against and supplies the labels used to train them.⁠[6]

The practical lesson running through all of this is that a knowledge graph's quality is bounded by its acquisition pipeline, and the pipeline is a set of trade-offs rather than a solved problem. A graph built from curated databases will be trustworthy but sparse; one built by mining text at scale will be broad but uneven, with some edges well supported and others resting on a single ambiguous sentence. What the graph is going to be used for decides which error is worse. A system that recommends a drug needs its edges to be right, while a system that generates hypotheses for a researcher to check can tolerate candidates that turn out to be wrong. The later sections take up what happens once the graph exists, including how its entities and relations are turned into vectors and how missing links are predicted.

Semi-automatic arrangement, in which an automated system filters the text before curators review it.

Embeddings: turning the graph into vectors

A knowledge graph stores its facts as symbols. The node for a drug is a label, the edge for "treats" is a label, and a program can follow those labels but cannot do arithmetic on them. Most of the machine learning that a graph is meant to feed, however, works on numbers: it takes a list of values, multiplies them by weights, and produces a prediction. The bridge between the two is knowledge graph embedding, the task of mapping the entities and relations of a graph to a low-dimensional vector space so that the vectors capture the semantics and the structure of the graph efficiently.⁠[1] Each entity becomes a point in that space, each relation becomes something that can be applied to points, and the geometry of the space is arranged so that true facts sit close together and false ones do not.

The word "low-dimensional" is doing real work. A graph with millions of nodes could be described by giving every node its own coordinate axis, but that representation would be as sparse and as useless for learning as the symbol it replaced. An embedding squeezes each entity into a short list of numbers, positioned so that the graph's structure survives the squeeze. Once the vectors exist, ordinary machine learning models can consume them, and the graph's knowledge becomes an input to prediction rather than a store to be looked up.⁠[1]

Three families of triplet-based models

The methods that learn these vectors from the triples alone fall into three main groups. Knowledge graph embedding approaches based on triplet facts are commonly divided into tensor factorization-based, translation-based, and neural network-based methods.⁠[1] The division is about what the model assumes a relation is. A translation model treats a relation as a shift in space.

The translation idea is the easiest to picture. A relation is modelled as a movement from the head entity to the tail entity, so that the vector for the head, plus a vector for the relation, should land near the vector for the tail. Training adjusts all three vectors until the true triples satisfy that arithmetic and the false ones do not.

TransR addresses that assumption directly. Its authors observe that an entity may have multiple aspects and that various relations may focus on different aspects of entities, which makes a common space insufficient for modelling. Their fix is to keep entities in one space and relations in another, and to project an entity from the entity space into the relation's own space before applying the translation.⁠[7] A person has a height, a nationality and an employer, and a relation about employment should look at the employment aspect rather than the height. Giving each relation its own projection lets the model attend to the aspect that relation cares about, at the cost of more parameters to learn. Evaluated on link prediction, triple classification and relational fact extraction, the model showed significant and consistent improvements over the translation baselines it was compared with.⁠[7]

What the vectors are for

The point of learning vectors is that they can be used for tasks the graph cannot answer by lookup. A survey of the field describes embedding as simplifying the manipulation of a graph while preserving its inherent structure, and notes that it benefits downstream tasks such as knowledge graph completion and relation extraction. The same survey organises the techniques by what information they use: some rely only on the facts observed in the graph, while others bring in additional material such as entity types, relation paths, textual descriptions and logical rules.⁠[8] That extra information matters because a graph's triples alone are a thin signal, and a description of an entity in words can tell a model something the edges never recorded.

The choice among these families is therefore not a matter of one being correct. What they share is the underlying bet: that the pattern of connections around an entity carries enough information to place it in a space where useful comparisons become arithmetic. Whether that bet pays off depends on the graph and on the task, and the applications that follow are where the payoff, or its absence, becomes visible.

An embedding turns each entity into a short list of numbers, positioned so that the graph's structure survives the squeeze.

Triplet-based embedding methods are commonly divided into three families.

Uses

Drug repurposing with Hetionet

Finding a new use for a drug that already exists is attractive because much of the expensive work has been done. An approved compound has been through toxicology profiling, preclinical models, clinical trials and postmarketing surveillance, so a second indication could in principle be reached with less time, lower failure rates and lower cost than a molecule starting from scratch.⁠[2] The difficulty is knowing where to look. The space of possible compound-disease pairs is enormous, and testing them one at a time is not feasible, so the question becomes whether existing biological knowledge can be organised well enough to rank the candidates before any experiment is run.

Project Rephetio was an attempt to answer that question by building the knowledge into a single structure and letting a model learn from it. The structure is a heterogeneous network, or hetnet: a network with more than one type of node and more than one type of relationship, built by aggregating graphs for each relationship type onto common nodes.⁠[2] The point of the heterogeneity is integration. A drug, a gene, a disease and a side effect are different kinds of thing, and a homogeneous graph would have to flatten them into one category; a hetnet keeps the types distinct while letting them share nodes, so that a path can run from a compound through a gene to a disease without losing track of what each step means.

The assembled graph was named Hetionet v1.0. It integrates data from 29 public resources into 47,031 nodes of 11 types and 2,250,197 relationships of 24 types, connecting compounds, diseases, genes, anatomies, pathways, biological processes, molecular functions, cellular components, pharmacologic classes, side effects and symptoms. Building it was a time-intensive undertaking even though every resource was publicly available, and the integration required attention to legal barriers to data reuse; the payoff is that a researcher can begin asking integrative questions without first spending months processing data. The graph was also made queryable directly, through a public Neo4j instance in which specialised graph queries can be written in a few lines of Cypher code.⁠[2]

Metapaths as patterns of evidence

A graph of that size does not answer questions by itself. What Project Rephetio needed was a way to describe the kinds of evidence that might distinguish a compound that treats a disease from one that does not, and to let a model weigh them. The device for this is the metapath, a template for a path through the graph that names the types of node and edge it passes through rather than specific entities. A metapath says, in effect, "a compound that binds a gene that associates with a disease" without saying which compound, gene or disease. Any concrete path in the graph that follows that shape is an instance of the metapath, and the number and kind of such paths between a given compound and disease become features the model can use.

The model was trained on treatments that are already known. It learned and evaluated itself on existing medical indications, treating them as a gold standard, and its task was to identify which network patterns distinguish treatments from non-treatments. Once trained, it produced a probability of treatment for 209,168 compound-disease pairs, and those predictions were validated against two external sets of known treatments. The scale is the substance of the result: a pharmacologist can reason carefully about a handful of drug classes, but the model assigned a probability to every pair in the graph and, for any pair, could immediately supply the top network paths supporting its therapeutic efficacy. A human expert could produce a similar explanation, but not without substantial time spent researching the compound's pharmacology, the disease's pathophysiology and the molecular relationships between them.⁠[2]

Which kinds of evidence carried the weight

The more interesting finding concerns which relationship types turned out to be informative. Using the best-performing metapath to assess the pharmacological utility of each type of edge, the relationships fell into tiers. The top tier consisted of the kinds of information traditionally considered by pharmacology: compound treats disease, pharmacologic class includes compound, compound resembles compound, disease resembles disease, and compound binds gene. The upper-middle tier held information that has been the focus of substantial medical study but has only recently begun to play a larger role in drug development, namely disease associates gene, compound causes side effect, disease presents symptom, disease localizes anatomy, and gene interacts gene.⁠[2]

Lower down sat the high-throughput data. The transcriptomics relationships, such as compound downregulates gene, anatomy expresses gene, gene regulates gene and disease downregulates gene, were only moderately informative of drug efficacy, despite the excitement around them as a less biased route to discovery. The same tier held relationships produced by time-intensive basic biology, such as a gene participating in a pathway, a molecular function or a biological process, which had historically been pursued for basic science rather than medical application. The lowest tier included gene participation in a cellular component, which may reflect that the relevance of cellular location to pharmacology is highly case dependent and not amenable to systematic profiling.⁠[2]

That ordering is a caution as much as a result. One common approach to repurposing has been to look for compounds whose transcriptional signature opposes the disease's, and several systematic studies had already reported underwhelming performance for it; Project Rephetio found the same, with the relevant metapaths performing poorly. Compounds with similar transcriptional signatures were somewhat prone to treating the same disease, and compounds with opposing signatures slightly averse to doing so, but diseases with similar transcriptional profiles were not prone to treatment by the same compound. The model ended up selecting the traditional pharmacological information rather than the high-throughput data types, which the authors had expected to contribute more. One caveat they note is that omics-scale data will likely play a larger role in the next generation of pharmacotherapies, so a reevaluation on treatments discovered in later decades might raise its predictive ability.⁠[2]

The predictions themselves were not all indications. Among the top 100 epilepsy predictions were 15 compounds that can trigger seizures, which follows from the fact that many of the relationship types are general: the compound binds gene relation conflates antagonist and agonist effects, so a high-scoring pair may exacerbate a disease rather than treat it. The predictions still represented a substantial relative enrichment over the null, which makes working out the correct directionality a logical next step. One prediction, the off-label use of acamprosate for epilepsy, was supported by a single animal model.⁠[2] The broader lesson is that a knowledge graph does not reason on its own; it supplies a structured set of relationship types, and the value of a prediction depends on whether the metapaths the model learned to trust actually correspond to mechanisms, a question the graph can raise but not settle.

A hetnet makes drug repurposing a path-finding problem: the model learns which shapes of path separate real treatments from the rest.

Project Rephetio trained a model on known treatments, predicted probabilities for pairs, and validated them.

Side effects, protein function and adverse reactions

A knowledge graph earns its keep when it answers a question that no single database could. Three biomedical problems show the pattern: which side effect a pair of drugs will cause together, what a newly sequenced protein does, and whether a drug will produce a reaction that trials never caught. Each is a prediction problem over a graph, and each shows a different way of using the graph's structure.

When two drugs interact

Most diseases are driven by complex biological processes that resist any single drug, so treatment often means polypharmacy, the concurrent use of multiple medications.⁠[3] Combining drugs can work well, because each may act on a different protein and together they overcome redundancy in the underlying biology. The cost is that a drug can change the activity of another, and the resulting side effects are hard to find. They are rare, it is practically impossible to test every possible pair, and small clinical trials usually do not observe them. The scale of the problem is large: polypharmacy affects nearly 15% of the U.S. population, and treating its side effects costs more than $177 billion a year in the U.S..⁠[3]

Earlier computational methods reduced a drug pair to a single score, answering whether the two interact at all. That is the wrong question for a clinician, who needs to know which side effect will appear. Decagon was built to answer the specific version: given two drugs, predict the exact side effect, if any, through which the combination manifests. It does this by constructing a multimodal graph, a network whose nodes are of several kinds and whose edges are of many kinds, here protein-protein interactions, drug-protein target interactions, and drug-drug interactions in which each side effect is an edge of a different type. The graph encodes 964 different side effect types as 964 distinct edge types, so the model must choose among them rather than merely flag a link.⁠[3]

The model itself is a graph convolutional neural network, a network that learns by repeatedly aggregating information from each node's neighbours in the graph. Decagon adapts this to the multirelational setting, so that the type of each edge matters when information is passed along it, and it is trained end to end rather than in the usual two-stage pipeline of extracting graph features and then fitting a separate predictor.⁠[3] Two observations motivated the design. Co-prescribed drugs tend to share more target proteins than random drug pairs, so drug-target information is worth including, and a map of protein-protein interactions is needed to model drugs that share side effects.⁠[3]

On the prediction task, Decagon outperformed alternative approaches by up to 69%, with a 20% average gain, and the largest gains came on side effect types with a strong molecular basis. On side effects that are mostly not molecular, it still performed well because model parameters are shared across edge types. The model also learned representations of side effects indicative of co-occurrence of polypharmacy in patients, and several novel predictions had supporting evidence in the biomedical literature.⁠[3] The result matters beyond the numbers: it shows that a graph can be asked not just whether two things are connected but through which of many relation types the connection runs.

Guessing a protein's job from its sequence

Sequencing produces protein sequences far faster than experiments can establish what those proteins do, and experimental functional characterisation is time-consuming and expensive, often done rigorously for only a few model organisms.⁠[9] Computational prediction fills the gap, but it faces an awkward output space. Protein functions are classified using the Gene Ontology (GO), a controlled vocabulary of over 40,000 functions and cellular locations, and the classes are linked by formally defined relations that a prediction must respect to stay consistent. A protein may also have several functions at once, which makes the task multi-class and multi-label rather than a single choice.⁠[9]

DeepGO predicts function from two inputs at once: the raw amino acid sequence, processed by a convolutional network that learns features from it, and the protein's position in a cross-species protein-protein interaction network, processed by a second component that learns a representation from its neighbours. The two representations are then fed into a deep neuro-symbolic model built to resemble the structure and dependencies between GO classes, refining predictions and features at each level of the hierarchy and optimising performance over the whole ontology rather than class by class.⁠[9] The design choice is the interesting part. Rather than treating the 40,000 classes as independent labels, the model uses the dependencies between them as background information, so a prediction high in the hierarchy constrains what can be predicted below it.

Evaluated under the standards of the Computational Assessment of Function Annotation, DeepGO improved significantly over baseline methods such as BLAST, which assigns a protein the functions of its closest sequence match, and it did particularly well at predicting cellular locations. The advantage comes from not relying on hand-crafted features: the model is data-driven, learning what to look for from sequence and network position together. Its weakness is the mirror image, since it needs large amounts of training data for each class, which the accumulated manual GO annotations supply but other domains would not.⁠[9]

Predicting adverse reactions from a graph of drugs

A third use turns the graph into a source of features for a simple classifier. Adverse drug reactions cause more than 20% of clinical trial failures, and because premarket trials are limited in size, duration and the heterogeneity of their subjects, many reactions surface only after a drug is marketed. A model was built from a knowledge graph containing four types of node, drug, indication, target and side effect, extracted from the DrugBank and SIDER databases. The graph was then embedded using a method based on Word2Vec, a technique from natural language processing that learns a vector for a word from the words that appear around it; here the triples of the graph supplied the contexts, and drugs, targets, indications and side effects were each embedded into a vector.⁠[4]

The difference from earlier work is what goes into the vector. Previous methods characterised a drug from its own properties, such as chemical structure or targets, one drug at a time, so the connections between drugs were not represented and information was lost. Embedding the graph instead lets a drug's vector absorb its relationships to targets, indications and side effects, and lets attributes be linked through a shared drug. A logistic regression classifier then takes the difference between a drug's vector and a side effect's vector and outputs the probability that the drug causes that reaction, giving one unified model rather than a separate classifier per side effect.⁠[4]

The classifier reached a maximum AUC of 0.87, with a mean of 0.863, and prediction performance rose as the degree of graph embedding increased, which indicates that the embedding process was effectively packing information into the vectors.⁠[4] AUC, the area under the receiver operating characteristic curve, measures how well a model ranks a true case above a false one; 0.5 is chance and 1.0 is perfect separation. The authors used liver injury as a worked example, predicting the probability of drug-induced liver injury for every drug in the graph and then searching the literature to check the higher-probability predictions. Because the side effects and targets were vectorised alongside the drugs, the same machinery could in principle be turned to predicting drug targets or indications.⁠[4]

Taken together, the three systems show the range of what a graph contributes. Decagon uses the graph's typed edges as the thing to be predicted, DeepGO uses network position as one of several inputs, and the adverse-reaction model uses the graph mainly to build better vectors for a conventional classifier. What they share is the premise that a biomedical entity is best described by what it is connected to. The limits of that premise, including how incomplete these graphs are and how far a predicted association is from a demonstrated cause, are taken up later.

A graph's edges can be the prediction target, an input feature, or the raw material for a vector; the choice depends on the question.

DeepGO combines sequence and network-position representations and refines predictions across the ontology.

Clinical and scientific knowledge graphs

A knowledge graph built for research has to hold two kinds of thing at once: the settled background knowledge that has accumulated in public databases and publications, and the fresh measurements a laboratory has just produced. These are different in character. The background is broad, curated and slow to change; the measurements are narrow, noisy and new. A clinical knowledge graph is a graph built to bring the two together, so that a set of experimental results can be interpreted against everything already known about the entities involved.

Protein measurements, databases, literature and clinical information feed a protein network with a purple exploration loop and analytics outputs.
Protein measurements join prior and clinical knowledge in an illustrative network. Iterative exploration and modular analytics produce reproducible analyses and hypotheses. View full-size image.From Proteomics to Biological Context by Atlas Nova. Illustration generated with AI for this article and checked against its text.

The Clinical Knowledge Graph (CKG) is an open-source platform of this kind, currently comprising close to 20 million nodes and 220 million relationships that represent relevant experimental data, public databases and literature.⁠[5] Its design rests on a property that a graph has and a table does not: the connections to a protein are already present the moment the protein is identified. The graph structure provides a flexible data model that is easily extendable to new nodes and relationships as new databases become available.⁠[5] A laboratory that sequences or quantifies a set of proteins can therefore place those proteins into the existing network and read off their neighbours, rather than assembling the context by hand from a dozen separate sources.

Why the graph suits proteomics

Proteomics produces lists. An experiment identifies and quantifies hundreds or thousands of proteins, and the analytical problem is to turn that list into biological meaning. The CKG harmonises proteomics data with prior knowledge and clinical information using a graph structure that naturally provides immediate connections to the identified proteins, and its automated, instantaneous and iterative nature helps reveal pertinent biological context for better understanding and generation of new hypotheses.⁠[5] The word "iterative" matters here. An analysis is rarely one pass; a first look suggests a pathway, the pathway suggests other proteins to examine, and those proteins suggest a further question. A graph supports that movement because each answer is a node with its own neighbours, so following a lead is a matter of walking to the next node rather than starting a new search.

The platform was built with reproducibility in mind as well as interpretation. Its analytics core is modular and implemented in Python on widely used open-source libraries covering statistics, network analysis, machine learning and visualisation, and shareable analysis pipelines are generated as notebooks so that results can be reproduced and replicated. It also adopts community standards for metadata and multiple proteomics data formats, which keeps the platform able to follow an active field as formats change. Although the CKG was designed for clinically relevant questions, it is equally applicable to other organisms and to any biological study.⁠[5]

Graphs behind everyday AI services

The same structural argument applies outside the clinic, in the systems that answer questions and recommend products. Knowledge graphs are widely employed in recommender systems, question-answering systems and information retrieval tools, and the richness of information within the graphs typically enhances their performance.⁠[1] The graph supplies the missing context as structured links rather than as text to be parsed, so a system can check that two things are related instead of inferring it from a sentence.

The benefit is easiest to see where a request has to be matched against a body of material. A question phrased in ordinary language names entities and asks about a relation between them; a graph stores exactly entities and relations, so answering becomes a matter of finding the entities and following the relation. The same holds for retrieval, where a query can be expanded using the graph's connections, and for recommendation, where a user's history can be connected through shared entities to items the user has not seen. In each case the graph is not the product but the side information that makes the product's guesses better informed.

What unites the clinical platform and the consumer services is the underlying bet described earlier in this chapter: that an entity is well characterised by what it is connected to. A protein is described by its interactions, pathways and disease associations; a product is described by its category, its attributes and the items bought alongside it. The graph is the place where those connections are stored once and reused by every system that needs them. How such graphs are used to fill in the links they are missing, and where the approach runs into trouble, are covered later.

Research

Risks and limits

Incompleteness, bias and immature tools

The gap between what a knowledge graph holds and what is true is not a temporary shortfall that better extraction will close. No effort has yet produced a comprehensive representation of all the knowledge in a field, and most graphs still lack a good number of entities and relationships.⁠[1] Every downstream use inherits that gap. A query that returns nothing may be reporting a genuine absence or merely a missing edge, and the graph itself cannot tell the two apart.

A dense blue network and sparse purple branch sit beside accuracy bars and a fraction calculation, above a compound-protein-disease path.
A hypothetical benchmark achieves 83% overall accuracy despite only 20% accuracy for rare entities. A separate relationship path illustrates why association does not establish a treatment effect. View full-size image.When Averages Hide Graph Bias by Atlas Nova. Illustration generated with AI for this article and checked against its text.

Link prediction is the standard response, and it carries a risk that is easy to overlook. A model trained to fill in missing edges learns from the edges that are present, and those edges are not a neutral sample of the domain. Some entities are mentioned far more often than others, and a graph built from literature or databases reflects that attention. The usual way of reporting accuracy makes this worse. The standard practice is to report accuracy by aggregating over a large number of test facts in which some entities are vastly more represented than others, which allows link prediction methods to exhibit good results by just attending to structural properties that include such entities while ignoring the remaining majority of the graph.⁠[11] A method can therefore look strong on a benchmark while being poor at the long tail, because the benchmark is dominated by the well-connected nodes the method has learned to favour.

The remedy is partly a matter of measurement. A comparison of 18 state-of-the-art embedding-based link prediction methods, together with a rule-based baseline, extended the dimensions of analysis beyond what is commonly reported and examined effectiveness and efficiency across the most popular benchmarks.⁠[11] The lesson generalises past any single method: a score averaged over a skewed test set says more about which entities were tested than about how well the model reasons. A reader judging a completion result needs to know not only the average but how the errors are distributed, because a model that is right about famous entities and wrong about obscure ones will fail exactly where a graph is most needed, in the sparse regions where the missing links have not already been guessed by everyone.

Biomedicine shows the same problem in a form that matters clinically. Knowledge graphs have emerged as attractive methods of data storage and hypothesis generation as heterogeneous data has grown and the field has shifted toward a systems view, with target identification and drug repurposing the two areas showing particular promise.⁠[12] Against that promise sits a set of cautions.

Many popular link prediction algorithms fail to address strong biases in biomedical data, and they highlight biological associations while failing to model causal relationships in complex dynamic biological systems.⁠[12] The distinction between association and causation is the crux. A graph can record that a compound binds a protein and that the protein is associated with a disease, and a path through those edges is genuine evidence of a relationship, but it is not evidence that the compound will alter the disease. The direction of an effect, and whether there is one at all, is a further question the graph does not settle.

The dangers of degree and literature bias are well known in this setting, and mitigation strategies for them are discussed.⁠[12] Both are properties of the data rather than of any one algorithm, and both are difficult to correct after the fact, since the missing information is missing precisely because nobody looked.

The tools themselves are also young. Knowledge graphs and graph-based machine learning have shown promise, yet they remain relatively immature technologies, and the problems of bias and causal modelling need to be addressed before knowledge graphs reach their true potential in drug discovery.⁠[12] That assessment is a statement about the state of the methods, not a verdict on the idea. The systems described earlier in this chapter produced predictions that were enriched over chance and, in places, supported by independent evidence, which is what a candidate-generation tool should do. What they did not produce is a demonstration that the relations they learned to trust correspond to mechanisms.

Holding these limits together gives a fair picture. A knowledge graph is a structured record of what has been asserted, assembled by methods with known failure modes, and used to rank possibilities that still need checking. Its incompleteness is structural, its biases are inherited from the material it was built from, and its predictions are associations until someone tests them. None of that makes it useless; it makes it a tool whose output has to be read with its provenance in mind. The directions now being pursued to extend the structure itself, including attaching time to facts and learning directly on graph structure, are covered later.

A knowledge graph reports what has been recorded, not what is true; its gaps and biases travel with every prediction it makes.

Later developments

Temporal graphs and graph neural networks

The graphs described so far treat a fact as permanent. A triple says that a relation holds, without saying when, and the model that learns from it has no way to tell a fact that has always been true from one that was true for a year and then stopped. Real knowledge is full of such change. A person holds a job, then leaves it; a drug is approved, then withdrawn. A temporal knowledge graph is one that records facts together with the times at which they hold, so that the same pair of entities can be connected differently at different moments.

A three-stage flow diagram with boxes, arrows, circular graph nodes connected by colored edges, a legend of node and edge types, and a classification block with labels.
A three-stage flow diagram with boxes, arrows, circular graph nodes connected by colored edges, a legend of node and edge types, and a classification block with labels. View full-size image.DialogueGCN framework by Deepanway Ghosal, Navonil Majumder, Soujanya Poria, Niyati Chhaya, and Alexander Gelbukh. CC BY-SA 4.0, via Wikimedia Commons. Scaled to 960 pixels wide; no crop or other changes by Atlas Nova.

The problem this creates is that the standard embedding methods were built for static graphs. Knowledge graph embedding approaches have proved effective for completion, but they have been developed mostly for static graphs, and developing temporal embedding models is an increasingly important problem.⁠[13] A static model gives each entity one vector for all time, which cannot express the fact that an entity's characteristics change. One response is to equip a static model with a diachronic entity embedding function, a function that returns an entity's characteristics at any chosen point in time rather than a single fixed vector. The function is model-agnostic, so it can in principle be combined with any static model, and combining it with one particular static model, SimplE, was proved to yield a model that is fully expressive for temporal completion.⁠[13]

A different line of work treats time as part of the transformation rather than as a property of the entity. ChronoR learns a rotation transformation parametrised by both the relation and the time, so that after a fact's head entity is rotated it lands near its tail entity. Inference over temporal graphs is difficult because of data non-stationarity, data heterogeneity and complex temporal dependencies, and the rotation approach is designed to capture the interaction between the temporal and multi-relational character of such a graph.⁠[14] The practical difference between these approaches is where the time information enters: in the entity's representation, or in the operation that relates one entity to another.

Learning on the graph itself

A second direction changes not what is stored but how the model reads it. The embedding methods described earlier score a triple largely from the three items in it, treating the graph as a collection of statements. A graph convolutional network instead learns by aggregating node information from the neighbourhood in a convolutional fashion, so that a node's representation is built from the representations of the nodes connected to it.⁠[15]

The obstacle is that graphs do not have the regular structure that makes ordinary convolution easy. Images sit on a grid, so a filter can scan every pixel and combine it with its neighbours; the non-Euclidean, irregular structure of graphs makes convolutions and filtering on graphs not as well-defined as on images.⁠[15] Two families of solution emerged. Spectral methods define the convolution in a spectral domain using a graph Fourier transform, an analogue of the ordinary Fourier transform, and compute it by multiplying the transformed signals and taking the inverse transform. Spatial methods define the convolution directly on the graph as an aggregation of node representations from each node's neighbourhood.⁠[15]

Attention mechanisms extend the same idea by weighting neighbours differently rather than treating them alike. The broader family of graph neural networks has grown to include, besides graph convolutional networks, graph auto-encoders, graph generative models, graph attention models and graph recurrent neural networks.⁠[15] The appeal across all of them is the same: the graph's structure becomes part of the model rather than a preprocessing step that turns it into a flat table.

Fusing knowledge from many sources

The third open problem is older and less tractable. A graph assembled from many sources will contain the same entity more than once, described differently in each, and knowledge fusion is the work of capturing knowledge from different sources and integrating it into a single graph. Entity alignment, the task of deciding when two records from different graphs refer to the same real-world thing, has become the primary method for implementing it.⁠[1] The difficulty is that sources disagree, name things differently and overlap only partly, so alignment must be judged on incomplete evidence. Fusion is useful for both generating and completing graphs, which is why it sits at the centre of the remaining challenges rather than at the edge.⁠[1]

Time, structure and source are the three things a static triple cannot express, and each is now a research direction in its own right.

Key studies

YearStudySampleDesignFinding
2015Lin et al.⁠[7]three tasks: link prediction, triple classification and relational fact extractionembedding model with separate entity space and relation spacesAcross the experiments, TransR improved on strong baselines such as TransE and TransH, and the gains were large and held consistently.
2017Himmelstein et al.⁠[2]47,031 nodes of 11 types and 2,250,197 relationships of 24 types from 29 public resourcesintegrative network construction and prediction of 209,168 compound-disease pairsThe predictions were checked against two independent sets of known treatments, and the study drew pharmacological observations about epilepsy.
2018Zitnik et al.⁠[3]964 side effect typesgraph convolutional neural network for multirelational link prediction on a multimodal graphDecagon outperformed alternative approaches by 19.7% (AUROC), 22.0% (AUPRC) and 36.3% (AP@50).
2018Kulmanov et al.⁠[9]proteins with manually curated GO annotations in SwissProt, split 80% training and 20% evaluationDeepGO, a deep ontology-aware classifier that predicts protein function from sequenceDeepGOSeq outperformed BLAST in predicting cellular locations but did not improve on BLAST in the Molecular Function and Biological Process ontologies.
2020Goel et al.⁠[13]ICEWS14, ICEWS05-15 and GDELT subsetstemporal knowledge graph completion with a diachronic entity embedding functionWhen the embedding function is paired with SimplE, the resulting model can express any temporal knowledge graph, and the experiments show it beating existing baselines.
2021Rossi et al.⁠[11]18 state-of-the-art embedding methods plus a rule-based baselineexperimental comparison of effectiveness and efficiency on popular benchmarksThe analysis extends the dimensions of comparison beyond what is commonly available and reports detailed analysis over the most popular benchmarks.
2021Sadeghian et al.⁠[14]ICEWS14, ICEWS05-15 and Yago15K benchmarkstemporal knowledge graph embedding model evaluated on temporal link predictionOn benchmark datasets for temporal knowledge graph link prediction, ChronoR beat many competing methods.
2021Zhang et al.⁠[4]3632 drugs and 4286 targets from DrugBank, matched to 5589 types of side effects and 2598 types of indications in SIDERknowledge graph embedding with Word2Vec and a logistic regression classifierThe classification model's AUC peaked at 0.87, with a mean of 0.863.
2021MacLean⁠[12]review of knowledge graph applications in drug discoveryreview with a case study on COVID-19Target identification and drug repurposing are highlighted as two areas showing particular promise, while the technologies remain relatively immature.
2022Santos et al.⁠[5]close to 20 million nodes and 220 million relationshipsopen-source platform with proof-of-concept biomarker studiesThe CKG may add context to proteomics data and support decisions made in clinical care.

See also

References

  1. Peng, C., Xia, F., Naseriparsa, M., & Osborne, F. (2023). Knowledge Graphs: Opportunities and Challenges. Artificial Intelligence Review, 56(11), 13071-13102. doi:10.1007/s10462-023-10465-9
  2. Himmelstein, D. S., Lizee, A., Hessler, C., Brueggeman, L., Chen, S. L., Hadley, D., Green, A., Khankhanian, P., & Baranzini, S. E. (2017). Systematic integration of biomedical knowledge prioritizes drugs for repurposing. eLife, 6. doi:10.7554/elife.26726
  3. Zitnik, M., Agrawal, M., & Leskovec, J. (2018). Modeling polypharmacy side effects with graph convolutional networks. Bioinformatics, 34(13), i457-i466. doi:10.1093/bioinformatics/bty294
  4. Zhang, F., Sun, B., Diao, X., Zhao, W., & Shu, T. (2021). Prediction of adverse drug reactions based on knowledge graph embedding. BMC Medical Informatics and Decision Making, 21(1). doi:10.1186/s12911-021-01402-3
  5. Santos, A., Colaço, A. R., Nielsen, A. B., Niu, L., Strauss, M., Geyer, P. E., Coscia, F., Albrechtsen, N. J. W., Mundt, F., Jensen, L. J., & Mann, M. (2022). A knowledge graph to interpret clinical proteomics data. Nature Biotechnology, 40(5), 692-702. doi:10.1038/s41587-021-01145-6
  6. Nicholson, D. N., & Greene, C. S. (2020). Constructing knowledge graphs and their biomedical applications. Computational and Structural Biotechnology Journal, 18, 1414-1428. doi:10.1016/j.csbj.2020.05.017
  7. Lin, Y., Liu, Z., Sun, M., Liu, Y., & Zhu, X. (2015). Learning Entity and Relation Embeddings for Knowledge Graph Completion. Proceedings of the AAAI Conference on Artificial Intelligence, 29(1). doi:10.1609/aaai.v29i1.9491
  8. Wang, Q., Mao, Z., Wang, B., & Guo, L. (2017). Knowledge Graph Embedding: A Survey of Approaches and Applications. IEEE Transactions on Knowledge and Data Engineering, 29(12), 2724-2743. doi:10.1109/tkde.2017.2754499
  9. Kulmanov, M., Khan, M. A., & Hoehndorf, R. (2018). DeepGO: predicting protein functions from sequence and interactions using a deep ontology-aware classifier. Bioinformatics, 34(4), 660-668. doi:10.1093/bioinformatics/btx624
  10. Nickel, M., Murphy, K., Tresp, V., & Gabrilovich, E. (2016). A Review of Relational Machine Learning for Knowledge Graphs. Proceedings of the IEEE, 104(1), 11-33. doi:10.1109/jproc.2015.2483592
  11. Rossi, A., Barbosa, D., Firmani, D., Matinata, A., & Merialdo, P. (2021). Knowledge Graph Embedding for Link Prediction: A Comparative Analysis. ACM Transactions on Knowledge Discovery from Data, 15(2), 1-49. doi:10.1145/3424672
  12. MacLean, F. (2021). Knowledge graphs and their applications in drug discovery. Expert Opinion on Drug Discovery, 16(9), 1057-1069. doi:10.1080/17460441.2021.1910673
  13. Goel, R., Kazemi, S. M., Brubaker, M., & Poupart, P. (2020). Diachronic Embedding for Temporal Knowledge Graph Completion. Proceedings of the AAAI Conference on Artificial Intelligence, 34(04), 3988-3995. doi:10.1609/aaai.v34i04.5815
  14. Sadeghian, A., Armandpour, M., Colas, A., & Wang, D. Z. (2021). ChronoR: Rotation Based Temporal Knowledge Graph Embedding. Proceedings of the AAAI Conference on Artificial Intelligence, 35(7), 6471-6479. doi:10.1609/aaai.v35i7.16802
  15. Zhang, S., Tong, H., Xu, J., & Maciejewski, R. (2019). Graph convolutional networks: a comprehensive review. Computational Social Networks, 6(1). doi:10.1186/s40649-019-0069-y

Cite this page: Atlas Nova editors. (2026). Knowledge graph. Atlas Nova. https://velocer.io/atlas/knowledge-graphs/