Source Code Knowledge Graph Construction
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Source code for software programs often becomes complex and difficult to understand due to its large size and longevity, making it challenging to extract knowledge from, which is essential for tasks like question answering.
Innovation Solution
A method and system for constructing or augmenting a knowledge graph from source code by extracting concepts and relationships, performing entity and relation completion, and identifying repeated patterns across the code, utilizing a processor and memory to generate a knowledge graph that integrates with natural language processing and dynamic analysis.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Duration of action of stationary object
If source code is maintained for long periods and programs grow in size, then the program's functionality and history are preserved, but the code becomes difficult to understand and knowledge extraction becomes challenging
Solution Approach 1:
The patent introduces knowledge graphs as an intermediary layer between the source code and human users. The knowledge graph extracts and structures semantic information from the code, creating a mediator that makes the code's meaning accessible without requiring direct reading of the complex source code. This intermediary captures entities, relationships, and patterns, presenting them in a comprehensible format that bridges the gap between long-lived complex code and human understanding.
2Adaptability or versatility
If source code becomes large and complex, then more functionality can be implemented, but no single individual can understand the entire codebase
Solution Approach 1:
The patent applies segmentation by breaking down the complex codebase into discrete entities and relationships that can be independently analyzed and represented in the knowledge graph. Code elements such as classes, functions, variables, and their interrelationships are segmented and modeled as separate nodes and edges, making the overall system manageable despite its scale and complexity.
Solution Approach 2:
The patent transitions from analyzing code in its traditional linear textual form to representing it in a graphical knowledge graph dimension. This dimensional change allows complex relationships to be visualized and queried in a structured space where semantic connections are explicit, enabling understanding of large codebases through graph-based navigation rather than linear reading.
3Ease of manufacture
If traditional code analysis methods are used, then implementation is straightforward, but extraction of embedded knowledge and semantic relationships is insufficient
Solution Approach 1:
The patent replaces traditional mechanical text-based code analysis methods with a semantic knowledge graph system. Instead of relying on keyword searching or static code analysis, the system uses entity recognition, relationship extraction, and pattern matching algorithms that operate on the semantic structure of the code, substituting superficial textual analysis with deeper semantic understanding.
Data Source
AI summary
Entities and relations associated with source code of a program are extracted. An entity completion on the extracted entities and relationships is performed to produce a knowledge graph of the source code. Repeated patterns of relationships are identified from the knowledge graph across the source code.


