CodeGraph: Open-Taxonomy Knowledge Graph for Source Code with Wikidata Grounding

Hugging Face Daily Papers Papers

Summary

The paper introduces CodeGraph, a large-scale open-taxonomy knowledge graph for source code, built using a specialized LLM and grounded in Wikidata, covering millions of files and entities.

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.
Original Article
View Cached Full Text

Cached at: 09/28/26, 04:05 PM

Paper page - CodeGraph: Open-Taxonomy Knowledge Graph for Source Code with Wikidata Grounding

Source: https://huggingface.co/papers/2609.29474

Abstract

Publicsoftwarerepositories,likeGitHubandSoftwareHeritageArchive,storebillionsoffiles,yetextractingtheirimplicitengineeringknowledge---i.e.,thealgorithmstheyimplement,theparadigmstheyfollow,thepatternstheyinstantiate,andtheapplicationdomainstheyserve---remainschallenging,ascurrenttoolsareconstrainedtosyntacticandtoken-levelanalysis.Wepresentapipelineforbuildinganopen-taxonomysemanticannotationofsourcecodeusingacode-specialisedLargeLanguageModel.TheextractedentitiesaregroundedinWikidatathroughathree-stagelinkingprocedure:adeterministicSPARQLstagehandlesunambiguousentities,aDeepResearchAgentresolvestheresiduallongtail,andahierarchy-rollupstageimportstheparent-ofclosureofeachresolvedWikidataidentifier.Theresultingannotationsarematerialisedasasource-code-specificopen-taxonomyknowledgegraph.Wefurtherintroduceacalibratedquality-assuranceprotocolthatquantifiesannotationprecisionbycombiningasmallhumangoldsetwithanLLM-as-a-judgefilter.Weappliedourpipelinetothe167millionfilesoftheStack-Educorpus,creatingthefirstknownlarge-scaleopen-taxonomyknowledgegraphforsourcecode.Ourgraph,namedCodeGraph,containsapproximately158millionnodes,whichincludearound145millionfiles,about63,000extractedconceptentities(suchasalgorithms,paradigms,designpatterns,andapplicationdomains),androughly19,800groundedWikidataentities.Furthermore,CodeGraphfeaturesapproximately1billiontypededgesthatconnectfilestotheirrespectiveconcepts,linktheseconceptstotheirgroundedWikidataidentifiers,andrelatethemtotheirparentcategories,covering14programminglanguages.

View arXiv pageView PDFGitHub0Add to collection

Models citing this paper0

No model linking this paper

Cite arxiv.org/abs/2609.29474 in a model README.md to link it from this page.

Datasets citing this paper1

#### halykoss/CodeGraph Viewer• Updated3 days ago • 1.18B • 4.88k

Spaces citing this paper0

No Space linking this paper

Cite arxiv.org/abs/2609.29474 in a Space README.md to link it from this page.

Collections including this paper0

No Collection including this paper

Add this paper to acollectionto link it from this page.

Similar Articles

colbymchenry/codegraph

GitHub Trending (daily)

CodeGraph is an open-source tool that creates a pre-indexed knowledge graph of a codebase, enabling Claude Code's exploration agents to query symbol relationships and call graphs instantly, reducing tool calls by up to 96% and exploration time by 77%.

vitali87/code-graph-rag

GitHub Trending (daily)

Code-Graph-RAG is an open-source tool that parses multi-language codebases with Tree-sitter, builds a knowledge graph in Memgraph, and lets you query, edit, and optimize code using plain English. It supports monorepos with mixed languages under a unified graph schema.