A Toolkit for Generating Code Knowledge Graphs

Ibrahim Abdelaziz, Julian Dolby, Jamie McCusker, Kavitha Srinivas
2/21/2020
cs.DBcs.AI

Official code: wala/graph4code (370 stars, Jupyter Notebook, EPL-2.0, last commit 2025-12-03).

Abstract

Knowledge graphs have been proven extremely useful in powering diverse applications in semantic search and natural language understanding. In this paper, we present GraphGen4Code, a toolkit to build code knowledge graphs that can similarly power various applications such as program search, code understanding, bug detection, and code automation.

Show full abstract

GraphGen4Code uses generic techniques to capture code semantics with the key nodes in the graph representing classes, functions, and methods. Edges indicate function usage (e.g., how data flows through function calls, as derived from program analysis of real code), and documentation about functions (e.g., code documentation, usage documentation, or forum discussions such as StackOverflow). Our toolkit uses named graphs in RDF to model graphs per program, or can output graphs as JSON. We show the scalability of the toolkit by applying it to 1.3 million Python files drawn from GitHub, 2,300 Python modules, and 47 million forum posts. This results in an integrated code graph with over 2 billion triples. We make the toolkit to build such graphs as well as the sample extraction of the 2 billion triples graph publicly available to the community for use.

View on arXivView PDF

Code Implementations(1)

wala/graph4codeOfficial100%
EPL-2.0

GraphGen4Code: a toolkit for creating code knowledge graphs based on WALA code analysis and extraction of documentation and forum content.

37047Jupyter Notebook, JavaApr 9, 202012 months agoEPL-2.0
code-understandingknowledge-graph

Similar Papers

Cite this paper

@article{abdelaziz2020toolkit,
  title  = {A Toolkit for Generating Code Knowledge Graphs},
  author = {Ibrahim Abdelaziz and Julian Dolby and Jamie McCusker and Kavitha Srinivas},
  year   = {2020},
  eprint = {2002.09440},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2002.09440}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2002.09440.svg)](https://codeofpaper.com/paper/2002.09440)

Discussion