Part IV: Discovery Through Knowledge
Chapter 38: Knowledge Graph Discovery

Knowledge Graph Discovery

"I have 47 million edges and exactly zero of them say 'I don't know.' That is both my greatest strength and my most dangerous limitation."

A Knowledge Graph With Trust Issues

Overview

A knowledge graph encodes structured facts as triples: (subject, relation, object). "Aspirin inhibits COX-2." "TP53 activates apoptosis." "Graphene exhibits high conductivity." Each triple is an edge in a vast relational graph, and the graph as a whole represents a machine-readable map of what we know about a scientific domain. The discovery question is: what edges are missing? If we can predict which triples are plausible but absent, we have a systematic engine for generating scientific hypotheses.

This chapter teaches three layers of that prediction engine. First, knowledge graph embedding models (TransE, RotatE, ComplEx) learn vector representations of entities and relations such that the geometry of the embedding space encodes the plausibility of any triple. Second, graph neural networks refine these representations by passing messages along the graph structure, aggregating neighborhood context to predict missing links. Third, we assemble a complete pipeline: extracting relations from scientific papers, embedding them with RotatE, scoring candidate links, and surfacing the highest-scoring missing connections as discovery hypotheses.

Knowledge representation was introduced abstractly in Chapter 3. The representation learning techniques from Chapter 26 provide the mathematical foundation for embedding entities into continuous spaces. The literature mining pipeline from Chapter 36 supplies the raw relation triples that populate our graph. And the hypotheses we generate here feed directly into Chapter 39: Hypothesis Generation, where link predictions become testable scientific claims.

Prerequisites

Readers should be comfortable with the representation learning concepts from Chapter 26 (embedding spaces, contrastive objectives, evaluation metrics) and the relation extraction techniques from Chapter 36: Literature Mining. Familiarity with basic graph theory (nodes, edges, adjacency matrices) is assumed; see Appendix A for a refresher. The code examples use PyTorch, PyTorch Geometric (PyG), and NetworkX; installation instructions are in Appendix B.

Learning Outcomes

Sections

38.1 Link Prediction and Graph Embeddings

Knowledge graph embedding models: TransE (translation), RotatE (rotation), ComplEx (complex-valued). Scoring functions, negative sampling, and training. MRR and Hits@k evaluation. Scientific relation types: causes, inhibits, activates, binds.

38.2 GNNs for Knowledge Completion

Message passing on relational graphs. R-GCN for multi-relational data. Neighborhood aggregation as implicit link prediction. Combining GNN encoders with embedding decoders. Scalability to million-node scientific graphs.

38.3 Building a Scientific Knowledge Graph

End-to-end recipe: relation extraction from papers, graph construction with Neo4j and NetworkX, RotatE training with PyKEEN, link prediction scoring, and hypothesis ranking. The Discovery Workbench KG module.

What's Next

The link predictions from this chapter are ranked scores, not scientific claims. A triple like (Drug X, treats, Disease Y) with a high RotatE score is a statistical pattern, not a validated hypothesis. Chapter 39: Hypothesis Generation takes these ranked candidates and transforms them into structured, testable hypotheses with supporting evidence chains, confidence estimates, and experimental designs. You will see how the knowledge graph becomes one of several "hypothesis sources" that feed into a unified generation and ranking pipeline.

Bibliography

Foundational Papers

Bordes, A., Usunier, N., Garcia-Duran, A., Weston, J., & Yakhnenko, O. (2013). Translating embeddings for modeling multi-relational data. NeurIPS 2013.

Introduced TransE, the translation-based embedding model that treats relations as translations in vector space. The simplicity and effectiveness of TransE established knowledge graph embeddings as a field.

Sun, Z., Deng, Z.-H., Nie, J.-Y., & Tang, J. (2019). RotatE: Knowledge graph embedding by relational rotation in complex space. ICLR 2019.

Proposed modeling relations as rotations in complex vector space, enabling RotatE to capture symmetry, antisymmetry, inversion, and composition patterns that TransE cannot represent.

Trouillon, T., Welbl, J., Riedel, S., Gaussier, E., & Bouchard, G. (2016). Complex embeddings for simple link prediction. ICML 2016.

Introduced ComplEx, which uses complex-valued embeddings and the Hermitian dot product to model asymmetric relations, achieving strong results on standard benchmarks.

Schlichtkrull, M., Kipf, T. N., Bloem, P., van den Berg, R., Titov, I., & Welling, M. (2018). Modeling relational data with graph convolutional networks. ESWC 2018.

Proposed R-GCN, extending graph convolutional networks to multi-relational data with relation-specific weight matrices and basis decomposition for parameter efficiency.

Scientific Knowledge Graphs

Himmelstein, D. S., et al. (2017). Systematic integration of biomedical knowledge prioritizes drugs for repurposing. eLife, 6, e26726.

Built Hetionet, a heterogeneous biomedical knowledge graph with 47,031 nodes and 2,250,197 edges, demonstrating systematic drug repurposing through network-based link prediction.

Wishart, D. S., et al. (2020). DrugBank 5.0. Nucleic Acids Research, 48(D1), D573-D580.

The premier curated database of drug-target interactions, providing gold-standard relation triples for training and evaluating biomedical link prediction models.

Tools & Libraries

Ali, M., et al. (2021). PyKEEN 1.0: A Python library for training and evaluating knowledge graph embeddings. JMLR, 22(82), 1-6.

A comprehensive library for training TransE, RotatE, ComplEx, and 30+ other KG embedding models with standardized evaluation, used throughout this chapter's code examples.

Fey, M. & Lenssen, J. E. (2019). Fast graph representation learning with PyTorch Geometric. ICLR Workshop on Representation Learning on Graphs and Manifolds.

PyTorch Geometric provides efficient message passing implementations for R-GCN and other graph neural networks used in Section 38.2.

Neo4j, Inc. Neo4j Graph Database.

The leading graph database for storing and querying knowledge graphs at scale, used in the end-to-end pipeline in Section 38.3.

Hagberg, A. A., Schult, D. A., & Swart, P. J. (2008). Exploring network structure, dynamics, and function using NetworkX. SciPy 2008.

Python library for graph analysis and visualization, used for knowledge graph construction and exploratory analysis before scaling to Neo4j.

RDFLib Team. RDFLib: A Python library for working with RDF.

Provides RDF graph construction and SPARQL query support, enabling interoperability with semantic web standards for scientific knowledge representation.

Surveys

Ali, M., et al. (2021). Bringing light into the dark: A large-scale evaluation of knowledge graph embedding models under a unified framework. IEEE TPAMI, 44(12), 8825-8845.

A comprehensive benchmark of 21 KG embedding models on 4 datasets with standardized evaluation, providing the empirical grounding for the model comparisons in this chapter.