SQL-Gremlin Query Engine for Unified Graph-Relational Queries

Resolve Bottlenecks,
Find Innovative Solutions
Generate 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

VSEngineering 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

Engineering Contradiction:
Improvequery language compatibilityVSAvoidsystem integration complexity
Core Design Contradiction:
Adaptability or versatilityVSDevice complexity

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.

Inventive Principle:
Principle #5Merging (Combining)

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.

Inventive Principle:
Principle #6Universality (Multi-functionality)

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

Engineering Contradiction:
Improvegraph query capabilityVSAvoidquery syntax compatibility
Core Design Contradiction:
Adaptability or versatilityVSEase of operation

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.

Inventive Principle:
Principle #5Merging (Combining)

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.

Inventive Principle:
Principle #24Intermediary (Mediator)

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

Engineering Contradiction:
Improvegraph data storage efficiencyVSAvoiddata storage structure
Core Design Contradiction:
ProductivityVSDevice complexity

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.

Inventive Principle:
Principle #6Universality (Multi-functionality)

Data Source

PatentUS20250209072A1Data query method and query engine
Publication Date: 2025.06.26 ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
  • US20250209072A1 patent drawing
  • US20250209072A1 patent drawing
  • US20250209072A1 patent drawing

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.