# US 2021/0286848 A1 · Query language interoperability in a graph database

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

- Number: US 2021/0286848 A1
- Document ID: US20210286848A1
- Status: Published application
- Kind: A1
- Application number: 17/214,334
- Filed: 2021-03-26
- Published: 2021-09-16
- Earliest claimed: 2017-01-20
- Assignees: Amazon Technologies, Inc.
- Applicants: Amazon Technologies, Inc.
- Inventors: Kawarjit Bedi; Piyush Gupta; Sainath Chowdary Mallidi; Divij Vaidya; Andi Gutmans
- Web page: https://patentgrep.com/patent/US20210286848A1

## CPC

- G06F 16/9024: {Graphs; Linked lists (G06F16/9027 takes precedence)}
- G06F 16/2452: Query translation
- G06F 16/24522: {Translation of natural language queries to structured queries}
- G06F 16/24542: {Plan optimisation}
- G06F 16/90335: {Query processing}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Methods, systems, and computer-readable media for query language interoperability in a graph database are disclosed. Data elements are inserted into a graph database using one or more of a plurality of graph database query languages. The graph database query languages comprise a first graph database query language associated with a first data model and a second graph database query language associated with a second data model. The data elements are stored in the graph database using an internal data model that differs from the first and second data models. One or more of the data elements are retrieved from the graph database based at least in part on a query. The query is expressed using a different graph database query language than the graph database query language used to insert the one or more retrieved data elements.

## Claims

### Claim 1

A system, comprising:
one or more processors;
memory to store computer-executable instructions that, if executed, cause the one or more processors to:
insert a plurality of data elements into a graph database using one or more of a plurality of graph database query languages, wherein the graph database query languages comprise a first graph database query language associated with a first data model and a second graph database query language associated with a second data model;
store the data elements in the graph database using an internal data model, wherein the internal data model differs from the first data model and the second data model, and wherein the internal data model represents the data elements using subject identifiers, column names, and values for the column names; and
retrieve one or more of the data elements from the graph database based at least in part on a query, wherein the query is expressed using the first graph database query language and retrieves one or more data elements inserted using the second graph database query language, or wherein the query is expressed using the second graph database query language and retrieves one or more data elements inserted using the first graph database query language.

### Claim 2 (depends on 1)

The system as recited in claim 1, wherein the first data model represents data elements using resource description framework (RDF) triples comprising subjects, predicates, and objects, and wherein the second data model represents data elements using property graphs.

### Claim 3 (depends on 2)

The system as recited in claim 2, wherein a set of the data elements are inserted into the graph database based at least in part on mapping one or more RDF triples to the internal data model, and wherein the set of the data elements are retrieved from the graph database based at least in part on mapping the internal data model to one or more property graphs.

### Claim 4 (depends on 2)

The system as recited in claim 2, wherein a set of the data elements are inserted into the graph database based at least in part on mapping one or more property graphs to the internal data model, and wherein the set of the data elements are retrieved from the graph database based at least in part on mapping the internal data model to one or more RDF triples.

### Claim 5

A method, comprising:
inserting a plurality of data elements into a graph database using one or more of a plurality of query languages, wherein the query languages comprise a first query language associated with a first data model and a second query language associated with a second data model, and wherein the data elements are stored in the graph database using an internal data model that differs from the first data model and the second data model; and
retrieving one or more of the data elements from the graph database based at least in part on a query, wherein the query is expressed using a different one of the query languages than was used in inserting the one or more of the data elements.

### Claim 6 (depends on 6)

The method as recited in claim 6, wherein the first data model represents data elements using resource description framework (RDF) triples comprising subjects, predicates, and objects, and wherein the second data model represents data elements using property graphs.

### Claim 7 (depends on 6)

The method as recited in claim 6, wherein a set of the data elements are inserted into the graph database based at least in part on mapping one or more RDF triples to the internal data model, and wherein the set of the data elements are retrieved from the graph database based at least in part on mapping the internal data model to one or more property graphs.

### Claim 8 (depends on 6)

The method as recited in claim 6, wherein a set of the data elements are inserted into the graph database based at least in part on mapping one or more property graphs to the internal data model, and wherein the set of the data elements are retrieved from the graph database based at least in part on mapping the internal data model to one or more RDF triples.

### Claim 9 (depends on 5)

The method as recited in claim 5, further comprising:
retrieving an additional one or more of the data elements from the graph database based at least in part on an additional query, wherein the query and the additional query are expressed using different ones of the query languages.

### Claim 10 (depends on 9)

The method as recited in claim 9, further comprising:
generating a query execution plan based at least in part on the query;
generating an additional query execution plan based at least in part on the additional query; and
executing the query execution plan and the additional query execution plan using an execution engine.

### Claim 11 (depends on 5)

The method as recited in claim 5, wherein the internal data model represents the data elements using subject identifiers, column names, and values for the column names, wherein the column names are globally scoped in the graph database, and wherein the column names are associated with respective data types for the values.

### Claim 12 (depends on 11)

The method as recited in claim 11, further comprising:
creating indices corresponding to the column names, wherein an individual one of the indices comprises one or more of the values associated with the corresponding column name, and wherein the query is performed using one or more of the indices corresponding to one of more of the column names associated with the query.

### Claim 13

A computer-readable storage medium to store program instructions that, if executed, cause one or more processors to perform:
inserting a plurality of data elements into a graph database using one or more of a plurality of graph database query languages, wherein the graph database query languages comprise a first graph database query language associated with a first data model and a second graph database query language associated with a second data model, and wherein the data elements are stored in the graph database using an internal data model that differs from the first data model and the second data model; and
retrieving one or more of the data elements from the graph database based at least in part on a query, wherein the query is expressed using the first graph database query language and retrieves one or more data elements inserted using the second graph database query language, or wherein the query is expressed using the second graph database query language and retrieves one or more data elements inserted using the first graph database query language.

### Claim 14 (depends on 13)

The computer-readable storage medium as recited in claim 13, wherein the first data model represents data elements using resource description framework (RDF) triples comprising subjects, predicates, and objects, and wherein the second data model represents data elements using property graphs.

### Claim 15 (depends on 14)

The computer-readable storage medium as recited in claim 14, wherein a set of the data elements are inserted into the graph database based at least in part on mapping one or more RDF triples to the internal data model, and wherein the set of the data elements are retrieved from the graph database based at least in part on mapping the internal data model to one or more property graphs.

### Claim 16 (depends on 14)

The computer-readable storage medium as recited in claim 14, wherein a set of the data elements are inserted into the graph database based at least in part on mapping one or more property graphs to the internal data model, and wherein the set of the data elements are retrieved from the graph database based at least in part on mapping the internal data model to one or more RDF triples.

### Claim 17 (depends on 13)

The computer-readable storage medium as recited in claim 13, wherein the program instructions are further computer-executable to perform:
retrieving an additional one or more of the data elements from the graph database based at least in part on an additional query, wherein the query and the additional query are expressed using different ones of the graph database query languages.

### Claim 18 (depends on 17)

The computer-readable storage medium as recited in claim 17, wherein the program instructions are further computer-executable to perform:
generating a query execution plan based at least in part on the query;
generating an additional query execution plan based at least in part on the additional query; and
executing the query execution plan and the additional query execution plan using an execution engine.

### Claim 19 (depends on 13)

The computer-readable storage medium as recited in claim 13, wherein the internal data model represents the data elements using subject identifiers, column names, and values for the column names, wherein the column names are globally scoped in the graph database, and wherein the column names are associated with respective data types for the values.

### Claim 20 (depends on 19)

The computer-readable storage medium as recited in claim 19, wherein the program instructions are further computer-executable to perform:
creating indices corresponding to the column names, wherein an individual one of the indices comprises one or more of the values associated with the corresponding column name, and wherein the query is performed using one or more of the indices corresponding to one of more of the column names associated with the query.
