Graph-Based API Extension Reducing Code Duplication
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
As application programming interfaces (APIs) grow with additional features, they often duplicate code, increasing maintenance and update work due to the manual creation of new functions and RESTful paths, which can lead to inefficiencies in managing and extending API functionality.
Innovation Solution
The method involves using a graph representation of APIs, where schema definitions define nodes and relationships, allowing for the extension of APIs by adding new nodes and navigable paths, enabling software developers to interact with the system without building custom APIs for specific functions, and decomposing requests into subqueries to access data sources.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If developers add additional API functions to extend functionality, then the API capabilities are improved, but the amount of duplicated code increases and maintenance complexity worsens
Solution Approach 1:
The patent implements a universal graph projection structure that serves multiple API functions through a single cohesive framework. Instead of creating separate code for each API function, the system uses a unified graph representation where nodes and edges can represent different API operations, enabling one structure to fulfill multiple functional roles and eliminating code duplication.
Solution Approach 2:
The patent segments the API into discrete graph components (nodes representing entities, edges representing relationships) that can be independently defined and combined. This segmentation allows the API to be built from reusable atomic units rather than duplicating entire function implementations, reducing maintenance complexity while preserving functionality.
2Adaptability or versatility
If developers manually create new functions and RESTful paths for API extensions, then new features are added, but the work required to maintain and update the API increases
Solution Approach 1:
The system enables self-service API extension through the graph projection mechanism. Developers can define new API functionality by simply adding nodes and edges to the graph structure according to established conventions, and the system automatically generates the corresponding API endpoints and handling logic. This eliminates the need for manual creation and maintenance of repetitive API boilerplate code.
Solution Approach 2:
The patent establishes a preliminary graph projection framework that pre-defines the structure and relationships for API operations. By setting up this framework in advance with standardized node types, edge relationships, and projection rules, the system prepares the groundwork for future extensions, allowing new features to be added by leveraging existing structures rather than creating everything from scratch.
3Adaptability or versatility
If the number of functions in an extended API grows significantly, then API versatility is improved, but code duplication and maintenance burden increase
Solution Approach 1:
The patent merges multiple API function definitions into a single graph projection structure. Instead of maintaining separate codebases for different API functions, the system combines them into one unified graph where shared entities, relationships, and operations are defined once and reused across multiple functions. This merging dramatically reduces maintenance burden while supporting significant API versatility.
Data Source
Figure 1
Figure 2
Figure 3
AI summary
The present disclosure relates to extending object-schema-based application programming interfaces (APIs). According to one embodiment, a method generally includes receiving, from a user, a schema defining an extension to the API and a reference to a parent node in a graph projection of the API. An API system updates the graph projection of the API to include a node representing the extension and navigable path to the node representing the extension. The API system processes a request from the user by traversing through the updated graph projection of the API, the request representing the navigable path to the node representing the extension.