| CPC G06F 16/24566 (2019.01) [G06F 16/2433 (2019.01)] | 22 Claims |

|
1. A method comprising:
a database management system (DBMS) compiling a graph pattern matching query that includes a bounded recursive pattern query into a main SQL query, wherein:
the bounded recursive pattern query specifies a start variable, an end variable, a recursive pattern, and a bound expression defining at least a maximum number of repetitions of the recursive pattern;
the graph pattern matching query is issued against a heterogenous graph having vertices and edges stored in a plurality of tables;
compiling the graph pattern matching query into the main SQL query comprises:
unfolding the bounded recursive pattern query into a set of pattern specializations, wherein:
the set of pattern specializations is bounded by the bound expression; and
each of the pattern specializations is a mapping of each variable in the bounded recursive pattern query to a respective table of the plurality of tables;
generating individual SQL query blocks for the set of pattern specializations;
the main SQL query includes a UNION ALL condition between the individual SQL query blocks;
the DBMS executing the main SQL query, wherein executing the main SQL query generates a result for the graph pattern matching query.
|