liveBook · Manning

Knowledge graph completion

As explained in Graph Algorithms for Data Science

Knowledge graph completion is the task of inferring missing entity relationships and their relationship types from an incomplete knowledge graph.

Knowledge graph completion infers missing links and their relationship types in a graph containing multiple node and relationship types. It is a multiclass form of link prediction: link prediction forecasts future links, while completion fills missing ones. Unlike homogeneous-graph features such as common-neighbor counts, completion distinguishes entities and relationship types. section 11.0 section 11.2

A knowledge graph embedding model encodes nodes and relationships in an embedding space. It learns representations in which the head and relationship of an existing triple align with its tail, then scores possible missing triples. section 11.4

A practical completion workflow follows these steps:

  • Start with a rich, heterogeneous graph containing entities and typed relationships. section 11.2
  • Load relationship data, such as a CSV file, into a pandas dataframe when needed. section 11.2.1
  • Train a knowledge graph embedding model to represent nodes and relationships. section 11.2
  • Rank candidate links and their types, such as new TREATS relationships for a known drug. section 11.2.1
  • Validate promising predictions with literature or domain experts before clinical evaluation. section 11.2.5 section 11.4

Drug repurposing with Hetionet

Use the Hetionet biomedical graph to predict new TREATS relationships from acetylsalicylic acid to diseases. Its full dataset contains 47,031 nodes across 11 types and 2,250,197 relationships across 24 types; the workflow uses a smaller subset. PyKEEN supplies embedding models and prediction methods, while supporting paths between aspirin and a candidate disease help experts assess the result. Knowledge graph completion prioritizes candidates; it does not replace clinical trials. section 11.2 section 11.2.1 section 11.2.5 section 11.4

Figure 11.11 Drug repurposing workflow
11-11

Use the drug-repurposing workflow diagram to connect graph data, embedding-model training, candidate prediction, and evaluation. section 11.2

How Graph Algorithms for Data Science covers it

How deep it goes
Explains heterogeneous graphs, triples, embeddings, prediction, and validation, but stops short of optimization details and clinical approval.
Examples
Demonstrates Hetionet, aspirin, TREATS relationships, PyKEEN, pandas, and short paths connecting aspirin with pancreatic cancer.
What it assumes
Assumes basic graph and data-handling familiarity while explaining typed triples, embeddings, and heterogeneous graphs from the workflow.
What you can do after
Apply it via PyKEEN to rank candidate relationships, then diagnose predictions through literature, graph paths, and expert review.
How it connects
Connects heterogeneous graphs, knowledge graph embeddings, multiclass link prediction, drug repurposing, and clinical trials.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Graph Algorithms for Data Science. The section links point to the parts of the book it draws on.