# US 2024/0202191 A1 · Unified query engine for graph and relational data

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2024/0202191 A1
- Document ID: US20240202191A1
- Status: Published application
- Kind: A1
- Application number: 18/544,175
- Filed: 2023-12-18
- Published: 2024-06-20
- Earliest claimed: 2022-12-16
- Assignees: Dassault Systemes
- Applicants: Dassault Systemes
- Inventors: Jean-Philippe SAHUT D'IZARN; Frédéric LABBATE; Alban ROULLIER; Eric VALLET GLENISSON
- Web page: https://patentgrep.com/patent/US20240202191A1

## CPC

- G06F 16/2452: Query translation
- G06F 16/24537: {of operators}
- G06F 16/24539: {using cached or materialised query results}
- G06F 16/9024: {Graphs; Linked lists (G06F16/9027 takes precedence)}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A computer-implemented method for querying by a query engine on a database including relational data and graph data, the method including receiving a query by the query engine, the query being in a language compatible with a first order logic paradigm. The method further includes generating an intermediate representation, the IR being compatible with a first order logic paradigm. The method further includes using the intermediate representation of the query for executing the query on the relational data and the graph data of the database.

## Claims

### Claim 1

A computer-implemented method for querying by a query engine on a database having relational data and graph data, the method comprising:
receiving a query by the query engine, the query being in a language compatible with a first order logic paradigm;
generating an intermediate representation (IR), the IR being compatible with a first order logic paradigm; and
using the intermediate representation of the query for executing the query on the relational data and the graph data of the database.

### Claim 2 (depends on 1)

The computer-implemented method of claim 1, wherein:
if the query is a SPARQL query, the generated intermediate representation is translated into a predicate calculus of a first order logic of the SPARQL query;
if the query is a SQL query, the generated intermediate representation is translated into a predicate calculus of a first order logic of the SQL query; and/or
the relational data of the database comprises one or more tables and the graph data of the database comprises one or more adjacency matrices.

### Claim 3 (depends on 1)

The computer-implemented method of claim 1, wherein the query is a first SQL query, and the using of the intermediate representation of the query for executing the query on the graph data of the database includes:
executing a SPARQL SELECT query on the graph data of the database thereby outputting tuples;
creating a materialized view of the executed query; and
executing the first SQL query on the created materialized view.

### Claim 4 (depends on 3)

The computer-implemented method of claim 3, further comprising:
receiving a second SQL query,
wherein the executing of the second SQL query is based on the created materialized view of the first SQL query.

### Claim 5 (depends on 3)

The computer-implemented method of claim 3, wherein the creating of the materialized view includes creating a table, wherein
rows of said table are associated to the tuples; and
columns of said table are associated to respective variables of the query.

### Claim 6 (depends on 1)

The computer-implemented method of claim 1, wherein the received query has at least one JOIN clause in SPARQL or in SQL, the generated intermediate representation being described with Backus-Naur Form (BNF) grammar of type:
<joined table> ::=
<cross join>
| <qualified join>
| <left paren> <joined table> <right paren>
<cross join> ::=
<table reference> CROSS JOIN <table reference>
<qualified join> ::=
<table reference> [ NATURAL ] [ <join type> ] JOIN <table
reference>
[ <join specification> ]
<join type> ::=
INNER
| <outer join type> [ OUTER ]
| UNION
<outer join type> ::= LEFT | RIGHT | FULL
<join specification> ::= < join condition> | <named columns join>
<join condition> ::= ON <search condition>
<named columns join> ::= USING <left paren> <join column list>
<right paren>
<join column list> ::= < column name list>

### Claim 7 (depends on 1)

The computer-implemented method of claim 1, wherein the received query has a FROM clause in SPARQL or in SQL, the generated intermediate representation being described with BNF grammar of type:
<from clause> ::= FROM <table reference> [ { <comma> <table
reference> }... ]
<table reference> ::=
<table name> [ <correlation specification> ]
| <derived table> <correlation specification>
| <joined table>

### Claim 8 (depends on 7)

The computer-implemented method of claim 7, wherein the FROM clause includes an AS clause, the generated intermediate representation being described with the BNF grammar of type:
<correlation specification> ::=
[ AS ] <correlation name> [ <left paren> <derived column list>
<right paren> ]
<derived column list> ::= <column name list>

### Claim 9 (depends on 1)

The computer-implemented method of claim 1, wherein the received query has a WHERE clause in SPARQL or in SQL, the generated intermediate representation being described with BNF grammar of type:
<where clause> ::= WHERE <search condition>
<search condition> ::=
<boolean term>
| <search condition> OR <boolean term>
<boolean term> ::=
<boolean factor>
| <boolean term> AND <boolean factor>
<boolean factor> ::= [ NOT ] <boolean test>
<boolean test> ::= < boolean primary> [ IS [ NOT ] <truth value> ]
<boolean primary> ::= < predicate> | <left paren> <search condition>
<right paren>
<predicate> ::=
<comparison predicate>
| <between predicate>
| <in predicate>
| <like predicate>
| <null predicate>
| <quantified comparison predicate>
| <exists predicate>
| <match predicate>
| <overlaps predicate>

### Claim 10 (depends on 1)

The computer-implemented method of claim 1, wherein the generated intermediate representation comprises at least one first FIND operator with at least an input, the method further comprising:
updating the generated intermediate representation by replacing the first find operator with a second find operator, the second find operator being configured to return undefined value when said input is null.

### Claim 11 (depends on 1)

A non-transitory computer readable storage medium having recorded thereon a computer program implementing the method of claim 1.

### Claim 12

A system comprising:
a processor coupled to a memory, the memory having recorded thereon a computer program for querying by a query engine on a database having relational data and graph data that when executed by the processor causes the processor to be configured to:
receive a query by the query engine, the query being in a language compatible with a first order logic paradigm,
generate an intermediate representation (IR), the IR being compatible with a first order logic paradigm, and
use the intermediate representation of the query for executing the query on the relational data and the graph data of the database.

### Claim 13 (depends on 2)

The computer-implemented method of claim 2, wherein the query is a first SQL query, and the using of the intermediate representation of the query for executing the query on the graph data of the database includes:
executing a SPARQL SELECT query on the graph data of the database thereby outputting tuples;
creating a materialized view of the executed query; and
executing the first SQL query on the created materialized view.

### Claim 14 (depends on 3)

The computer-implemented method of claim 3, wherein the creating of the materialized view includes creating a table, wherein
rows of said table are associated to the tuples; and
columns of said table are associated to respective variables of the query.

### Claim 15 (depends on 2)

The computer-implemented method of claim 2, wherein the received query has at least one JOIN clause in SPARQL or in SQL, the generated intermediate representation being described with Backus-Naur Form (BNF) grammar of type:
<joined table> ::=
<cross join>
| <qualified join>
| <left paren> <joined table> <right paren>
<cross join> ::=
<table reference> CROSS JOIN <table reference>
<qualified join> ::=
<table reference> [ NATURAL ] [ <join type> ] JOIN <table
reference>
[ <join specification> ]
<join type> ::=
INNER
| <outer join type> [ OUTER ]
UNION
<outer join type> ::= LEFT | RIGHT | FULL
<join specification> ::= <join condition> | <named columns join>
<join condition> ::= ON <search condition>
<named columns join> ::= USING <left paren> <join column list>
<right paren>
<join column list> ::= < column name list>

### Claim 16 (depends on 3)

The computer-implemented method of claim 3, wherein the received query has at least one JOIN clause in SPARQL or in SQL, the generated intermediate representation being described with Backus-Naur Form (BNF) grammar of type:
<joined table> ::=
<cross join>
| <qualified join>
| <left paren> <joined table> <right paren>
<cross join> ::=
<table reference> CROSS JOIN <table reference>
<qualified join> ::=
<table reference> [ NATURAL ] [ <join type> ] JOIN <table
reference>
[ <join specification> ]
<join type> ::=
INNER
| <outer join type> [ OUTER ]
| UNION
<outer join type> ::= LEFT | RIGHT | FULL
<join specification> ::= <join condition> | <named columns join>
<join condition> ::= ON <search condition>
<named columns join> ::= USING <left paren> <join column list>
<right paren>
<join column list> ::= <column name list>

### Claim 17 (depends on 4)

The computer-implemented method of claim 4, wherein the received query has at least one JOIN clause in SPARQL or in SQL, the generated intermediate representation being described with Backus-Naur Form (BNF) grammar of type:
<joined table> ::=
<cross join>
| <qualified join>
| <left paren> <joined table> <right paren>
<cross join> ::=
<table reference> CROSS JOIN <table reference>
<qualified join>
<table reference> [ NATURAL ] [ <join type> ] JOIN
<table reference>
[ <join specification> ]
<join type> ::=
INNER
| <outer join type> [ OUTER ]
| UNION
<outer join type> ::= LEFT | RIGHT | FULL
<join specification> ::= <join condition> | <named columns join>
<join condition> ::= ON <search condition>
<named columns join> ::= USING <left paren> <join column list>
<right paren>
<join column list> ::= <column name list>

### Claim 18 (depends on 5)

The computer-implemented method of claim 5, wherein the received query has at least one JOIN clause in SPARQL or in SQL, the generated intermediate representation being described with Backus-Naur Form (BNF) grammar of type:
<joined table> ::=
<cross join>
| <qualified join>
| <left paren> <joined table> <right paren>
<cross join> ::=
<table reference> CROSS JOIN <table reference>
<qualified join> ::=
<table reference> [ NATURAL ] [ <join type> ] JOIN <table
reference>
[ <join specification> ]
<join type> ::=
INNER
| <outer join type> [ OUTER ]
| UNION
<outer join type> ::= LEFT | RIGHT | FULL
<join specification> ::= < join condition> | <named columns join>
<join condition> ::= ON <search condition>
<named columns join> ::= USING <left paren> <join column list>
<right paren>
<join column list> ::= < column name list>

### Claim 19 (depends on 13)

The computer-implemented method of claim 13, further comprising:
receiving a second SQL query,
wherein the executing of the second SQL query is based on the created materialized view of the first SQL query.

### Claim 20 (depends on 13)

The computer-implemented method of claim 13, wherein the creating of the materialized view includes creating a table, wherein
rows of said table are associated to the tuples; and
columns of said table are associated to respective variables of the query.
