# US 10,956,504 B2 · Graph database query classification based on previous queries stored in repository

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

- Number: US 10,956,504 B2
- Document ID: US10956504B2
- Status: Granted
- Kind: B2
- Application number: 15/760,378
- Filed: 2015-09-23
- Published: 2018-09-20
- Granted: 2021-03-23
- Earliest claimed: 2015-09-23
- Assignees: Micro Focus LLC
- Applicants: ENTIT Software LLC
- Inventors: Mahashweta Das; Alkis Simitsis; William K. Wilkinson
- Web page: https://patentgrep.com/patent/US10956504B2

## CPC

- G06F 16/90335: {Query processing}
- G06F 16/28: Databases characterised by their database models, e.g. relational or object models
- G06F 16/9024: {Graphs; Linked lists (G06F16/9027 takes precedence)}
- G06F 17/18: for evaluating statistical data {, e.g. average values, frequency distributions, probability functions, regression analysis (forecasting specially adapted for a specific administrative, business or logistic context G06Q10/04)}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Examples for graph database query classification include receiving a graph query and determining if the graph query matches benchmark data. In the event that the graph query does not match benchmark data, the query may be parsed, a canonical internal representation of the query may be determined, the representation may be mapped to a rule, and the query may be classified based on the rule. In the event that the confidence score for the query classification does not exceed a threshold, the query may be sent to a synthetic graph or synopsis for simulation. In some examples, the simulation may include selecting computationally expensive graph operators in the query for simulation.

## Claims

### Claim 1

A graph database query classification system, comprising:
a repository of benchmark data;
a graph processor engine; and
a memory storing instructions that when executed cause the graph processor engine to:
receive a graph query from an application;
determine whether the graph query matches a previously submitted query stored in the repository of benchmark data;
in response to a determination that the graph query matches a previously submitted query stored in the repository of benchmark data, classify the graph query to a classification associated with the previously submitted query;
in response to a determination that the graph query does not match a previously submitted query stored in the repository of benchmark data, determine a canonical internal representation of the graph query, map the canonical internal representation of the graph query to a rule, and classify the graph query to a classification associated with the rule;
determine a confidence score of the classification of the graph query;
in response to a determination that the confidence score of the classification of the graph query is less than a threshold score, determine that the classification of the graph query does not meet a predetermined condition; and
in response to a determination that the classification of the graph query does not meet the predetermined condition, simulate an execution of the graph query on a synthetic graph.

### Claim 2 (depends on 1)

The graph database query classification system of claim 1, wherein the rule is determined based on historical logs of queries stored in the repository of benchmark data.

### Claim 3 (depends on 1)

The graph database query classification system of claim 1, wherein, to simulate the execution of the graph query, the instructions are executable to cause the graph processor engine to:
select an operator in the graph query; and
simulate the execution of the graph query on the synthetic graph for the selected operator.

### Claim 4 (depends on 3)

The graph database query classification system of claim 3, wherein the instructions are executable to cause the graph processor engine to:
determine whether a total number of graph nodes accessed during the simulated execution of the graph query is greater than a threshold number of nodes; and
in response to a determination that the total number of graph nodes accessed in the simulated execution of the graph query is greater than the threshold number of nodes, classify the graph query as a graph analytic query.

### Claim 5 (depends on 4)

The graph database query classification system of claim 4, wherein the instructions are executable to cause the graph processor engine to:
in response to a determination that the total number of graph nodes accessed in the simulated execution of the graph query is less than the threshold number of nodes, classify the graph query as a graph navigation query.

### Claim 6 (depends on 3)

The graph database query classification system of claim 3, wherein the selected operator is an operator that demands more computing resources than other operators in the graph query.

### Claim 7

A method for classifying a graph database query, comprising:
receiving a graph query;
determining whether the graph query matches a previously submitted query stored in a repository of benchmark data;
in response to a determination that the graph query matches a previously submitted query stored in the repository of benchmark data, classifying the graph query to a classification associated with the previously submitted query;
in response to a determination that the graph query does not match a previously submitted query stored in the repository of benchmark data, parsing the graph query, determining a canonical internal representation of the graph query, mapping the canonical internal representation of the graph query to a rule, and classifying the graph query into a classification associated with the rule;
determining a confidence score for the classification of the graph query; and
in response to a determination that the confidence score does not exceed a threshold score, sending the graph query to a synthetic graph for simulation.

### Claim 8 (depends on 7)

The method of claim 7, further comprising:
selecting operators in the graph query; and
simulating an execution of the graph query on the synthetic graph for the selected operators.

### Claim 9 (depends on 8)

The method of claim 8, further comprising:
determining whether a total number of graph nodes accessed in the simulated execution of the graph query is greater than a threshold number of nodes; and
in response to a determination that the total number of graph nodes accessed in the simulated execution is greater than the threshold number of nodes, classifying the graph query as a graph analytic query.

### Claim 10 (depends on 9)

The method of claim 9, further comprising:
in response to a determination that the total number of graph nodes accessed in the simulated execution is less than the threshold number of nodes, classifying the graph query as a graph navigation query.

### Claim 11 (depends on 8)

The method of claim 8, wherein the selected operators are operators that demand more computing resources than other operators in the graph query.

### Claim 12

An article comprising at least one non-transitory machine-readable storage medium that stores instructions executable by a processing resource of a graph database classification system to:
determine whether a received query matches a previously submitted query stored in a repository of benchmark data;
in response to a determination that the received query matches a previously submitted query stored in the repository of benchmark data, classify the received query to a classification associated with the previously submitted query;
in response to a determination that the received query does not match a previously submitted query stored in the repository of benchmark data, determine a canonical internal representation of the received query, map the canonical internal representation of the received query to a rule, and classify the received query to a classification associated with the rule;
determine a confidence score of the classification of the received query; and
in response to a determination that the confidence score is less than a threshold score, simulate an execution of the received query on a synthetic graph.

### Claim 13 (depends on 12)

The article of claim 12, wherein, to simulate the execution of the received query, the instructions are executable to cause the processing resource to:
select an operator in the received query; and
simulate the execution of the received query with the selected operator.

### Claim 14 (depends on 13)

The article of claim 13, wherein the instructions are executable to cause the processing resource to:
determine whether a total number of graph elements accessed in the simulated execution is greater than a threshold number; and
in response to a determination that the total number of graph elements accessed in the simulated execution is greater than the threshold number, classify the received query as a graph analytic query.

### Claim 15 (depends on 14)

The article of claim 14, wherein the instructions are executable to cause the processing resource to:
in response to a determination that the total number of graph elements is less than the threshold number, classify the received query as a graph navigation query.

### Claim 16 (depends on 15)

The article of claim 15, wherein the graph elements are a plurality of graph edges or a plurality of graph nodes.
