SQL-Gremlin Query Engine for Unified Graph-Relational Queries
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Conventional SQL and Gremlin graph query languages are incompatible, leading to difficulties in performing union queries across relational and graph databases due to type mismatches and differing computational paradigms, limiting their joint use in data query scenarios.
Innovation Solution
A query engine that extends SQL types to include graph elements (point, edge, path types) and performs mutual operator translation to integrate Gremlin graph queries within SQL, enabling syntax fusion and optimized execution plans for combined queries.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If SQL and Gremlin are used separately for relational and graph data queries, then each query language can operate independently with its own syntax and logic, but they cannot be fused together to perform joint graph union queries
Solution Approach 1:
The patent merges SQL and Gremlin into a unified query language that supports both relational and graph operations. The system allows embedding Gremlin graph query statements within SQL query statements, enabling joint execution of relational and graph operations in a single query without requiring separate systems or complex integration layers.
Solution Approach 2:
The unified query language serves multiple functions by supporting both traditional SQL operations for relational data and Gremlin operations for graph data. The system can parse and execute mixed query statements that contain both SQL syntax for table operations and Gremlin syntax for graph pattern matching, making the query engine universally applicable to both data models.
2Adaptability or versatility
If Gremlin is used for graph queries with pattern matching, then complex association relationships can be queried, but the entirely different data types and query logic make it incompatible with SQL
Solution Approach 1:
The patent combines Gremlin's graph pattern matching capabilities with SQL's relational query structure. Users can write unified query statements that embed Gremlin graph operations within SQL syntax, allowing complex association queries while maintaining SQL's ease of use and compatibility.
Solution Approach 2:
The unified query language acts as an intermediary layer between SQL and Gremlin. It translates and coordinates both query types, allowing SQL statements to invoke Gremlin graph operations and vice versa, thereby bridging the compatibility gap between the two fundamentally different query languages.
3Productivity
If dedicated graph databases are designed to store graph data, then graph data can be stored efficiently, but the data storage form becomes different from conventional relational data
Solution Approach 1:
The query engine is designed to handle multiple data storage forms universally. It can query both conventional relational table data and graph database data using a unified query language, supporting different storage structures without requiring separate query systems or complex data transformation layers.
Data Source
AI summary
A data query method is performed by a query engine, and includes: receiving a user query, wherein the user query includes an SQL query statement and a Gremlin graph query statement embedded into the SQL query statement, the Gremlin graph query statement indicates to perform matching on one or more types of graph elements in a target graph, and the one or more types of graph elements include at least one of a point type, an edge type, or a path type; parsing the user query, to determine an execution plan; and performing a data query based on the execution plan.


