CodeGraph: Open-Taxonomy Knowledge Graph for Source Code with Wikidata Grounding
Federico Pennino, Andrea Gurioli, Stefano Zacchiroli, Maurizio Gabbrielli, Paolo Ferragina
Università di Bologna · Télécom Paris, Institut Polytechnique de Paris · Sant'Anna School of Advanced Studies
Published September 24, 2026 · on the feed September 28, 2026 · ▲ 4 · arXiv 2609.29474
The abstract
Public software repositories, like GitHub and Software Heritage Archive, store billions of files, yet extracting their implicit engineering knowledge ---i.e., the algorithms they implement, the paradigms they follow, the patterns they instantiate, and the application domains they serve--- remains challenging, as current tools are constrained to syntactic and token-level analysis. We present a pipeline for building an open-taxonomy semantic annotation of source code using a code-specialised Large Language Model. The extracted entities are grounded in Wikidata through a three-stage linking procedure: a deterministic SPARQL stage handles unambiguous entities, a Deep Research Agent resolves the residual long tail, and a hierarchy-rollup stage imports the parent-of closure of each resolved Wikidata identifier. The resulting annotations are materialised as a source-code-specific open-taxonomy knowledge graph. We further introduce a calibrated quality-assurance protocol that quantifies annotation precision by combining a small human gold set with an LLM-as-a-judge filter. We applied our pipeline to the 167 million files of the Stack-Edu corpus, creating the first known large-scale open-taxonomy knowledge graph for source code. Our graph, named CodeGraph, contains approximately 158 million nodes, which include around 145 million files, about 63,000 extracted concept entities (such as algorithms, paradigms, design patterns, and application domains), and roughly 19,800 grounded Wikidata entities. Furthermore, CodeGraph features approximately 1 billion typed edges that connect files to their respective concepts, link these concepts to their grounded Wikidata identifiers, and relate them to their parent categories, covering 14 programming languages.
The Brief
2:49A short podcast summary of the paper. Written and voiced by AI.
Transcript
CodeGraph. Open-Taxonomy Knowledge Graph for Source Code with Wikidata Grounding. By Federico Pennino and four others, from the University of Bologna, Télécom Paris, and one other institution. Published on the twenty-fourth of September. Its code repository is public and real: about thirty source files.
CodeGraph is a knowledge graph about what source code does, rather than how it is written. It records which algorithms a file implements, which paradigms it follows, which design patterns it instantiates, and which application domains it serves. The authors describe it as the first known large-scale open-taxonomy knowledge graph for source code. Its concepts are extracted from the code itself, and then tied to Wikidata.
The graph has approximately one hundred and fifty-eight million nodes. Around one hundred and forty-five million of those are files. About sixty-three thousand are extracted concept entities, things like algorithms, paradigms, design patterns, and application domains. Roughly nineteen thousand eight hundred are grounded Wikidata entities.
Connecting them are approximately one billion typed edges. They link files to their concepts, concepts to their grounded Wikidata identifiers, and those to their parent categories. The files cover fourteen programming languages.
It was built from the one hundred and sixty-seven million files of the Stack-Edu corpus. A code-specialised large language model produces the semantic annotations. Those extracted entities are then grounded in Wikidata through three stages. A deterministic SPARQL stage handles the unambiguous entities. A Deep Research Agent resolves the long tail that remains. A hierarchy-rollup stage then imports, for each resolved Wikidata identifier, the full closure of its parents.
To say how accurate the annotations are, the authors add a calibrated quality-assurance protocol. It combines a small human gold set with an LLM-as-a-judge filter to quantify annotation precision. The division of labour mirrors the linking stages: a small amount of careful human judgment, and an automated judge to carry that judgment across a corpus far too large for people to check by hand.
The motivation is the scale of public software repositories such as GitHub and the Software Heritage Archive, which store billions of files. The engineering knowledge in those files is implicit, and current tools are limited to syntactic and token-level analysis. Those tools can tell you what a file says, token by token, but not which algorithm it implements or which domain it serves. CodeGraph is for anyone who wants to ask questions at the level of concepts instead, and to connect the answers to an identifier that means the same thing outside this one graph.
What separates this from a pile of labels is the grounding. Each extracted concept is tied to a Wikidata identifier and to the parent categories above it, so the graph links a single file, through its concepts, to a shared public vocabulary.
Paper Quest · 7 chapters · about 40 min
Play this paper
Learn it by doing: make the calls the authors made, guess the result before you see it, and defend it in a viva graded on your own words. Chapter 1 is right here.
Chapter 1 🧩 · The problem
Billions of files, and no tool that knows what any of them actually does.
You have a corpus of 167 million source files. You want to ask which files implement a given algorithm, follow a paradigm, or serve an application domain.
The road ahead
- 1 · The problem ~6 min Millions of code files hide which algorithms, paradigms and domains they embody, and today's tools only read their syntax and tokens.
- 2 · What came before ~3 min
- 3 · The key idea ~9 min A code language model names each file's concepts freely, those names are tied to Wikidata identifiers with parents, and a calibrated LLM judge measures precision.
- 4 · Choose your own research ~3 min
- 5 · Build the method ~8 min Annotate files with a code model, ground unambiguous concepts with SPARQL, send leftovers to a research agent, then import each identifier's parents.
- 6 · The experiment ~6 min You’ll guess: Of the concept entities extracted from the code, roughly how many distinct Wikidata entities did grounding import?
- 7 · The viva ~5 min Three questions from the examiners, answered in your own words. Win it for the paper’s trophy.
Free, with Google or an email address. Your stars and progress are kept.