Generating sql queries from declarative queries for semi-structured data
Abstract
A method for generating database queries from declarative queries having a known syntax. The method includes a query preparation software receiving a declarative query for a relational database management system, in a known system form. The query preparation software then analyzes the declarative query to build a set of generic query tasks with identified data types. The query preparation software then optimizes the set of generic query tasks and builds a target database query from the optimized generic query tasks reflecting features of a target database. The method further includes submitting the target database query to the targeted database and receiving results from the target database query.
Claims
exact text as granted — not AI-modifiedWhat is claimed is:
1 . A method for generating database queries from declarative queries having a known syntax comprising:
receiving, by one or more processors, a declarative query in a known system form; analyzing, by one or more processors, the declarative query to build a set of generic query tasks with identified data types; optimizing, by one or more processors, the set of generic query tasks; and building, by one or more processors, a target database query from the optimized generic query tasks reflecting features of a target database.
2 . The method of claim 1 , further comprising:
submitting, by one or more processors, the target database query to the targeted database; and receiving, by one or more processors, results from the target database query.
3 . The method of claim 1 , wherein the optimizing of the set of generic query tasks comprises performing actions selected from a group comprising adding tasks, re-arranging tasks, and combining subsets of tasks.
4 . The method of claim 1 , wherein the declarative query in the known system form is a set of JavaScript Object Notation (JSON) query statements and the target database supports Structured Query Language (SQL) queries.
5 . The method of claim 4 , further comprising:
providing, by one or more processors, a validation of mappings between fields in the set of JSON query statements to attributes in the generated language-independent query tasks; and assigning, by one or more processors, one or more data types to attributes in the generated query tasks.
6 . The method of claim 1 , further comprising:
providing, by one or more processors, a user with an interface for adjusting specific features and/or properties in order to customize generation of the target database query.
7 . The method of claim 1 , further comprising:
receiving, by one or more processors, a second declarative query in a second known system form; analyzing, by one or more processors, the second declarative query to build a set of second generic query tasks with identified data types; optimizing, by one or more processors, the set of second generic query tasks; and building, by one or more processors, a second target database query from the optimized set of second generic query tasks reflecting features of the target database.
8 . A computer program product for generating database queries from declarative queries having a known syntax, the computer program product comprising:
one or more computer readable storage media and program instructions stored on the one or more computer readable storage media, the program instructions comprising: program instructions to receive a declarative query in a known system form; program instructions to analyze the declarative query to build a set of generic query tasks with identified data types; program instructions to optimize the set of generic query tasks; and program instructions to build a target database query from the optimized generic query tasks reflecting features of a target database.
9 . The computer program product of claim 8 , further comprising:
program instructions to submit the target database query to the targeted database; and program instructions to receive results from the target database query.
10 . The computer program product of claim 8 , wherein the optimizing of the set of generic query tasks comprises performing actions selected from a group comprising adding tasks, re-arranging tasks, and combining subsets of tasks.
11 . The computer program product of claim 8 , wherein the declarative query in the known system form is a set of JavaScript Object Notation (JSON) query statements and the target database supports Structured Query Language (SQL) queries.
12 . The computer program product of claim 11 , further comprising:
program instructions to provide a validation of mappings between fields in the set of JSON query statements to attributes in the generated language-independent query tasks; and program instructions to assign one or more data types to attributes in the generated query tasks.
13 . The computer program product of claim 8 , further comprising:
program instructions to provide a user with an interface for adjusting specific features and/or properties in order to customize generation of the target database query.
14 . The computer program product of claim 8 , further comprising:
program instructions to receive a second declarative query in a second known system form; program instructions to analyze the second declarative query to build a set of second generic query tasks with identified data types; program instructions to optimize the set of second generic query tasks; and program instructions to build a second target database query from the optimized set of second generic query tasks reflecting features of the target database.
15 . A computer system for generating database queries from declarative queries having a known syntax, the computer system comprising:
one or more computer processors; one or more computer readable storage media; program instructions stored on the computer readable storage media for execution by at least one of the one or more processors, the program instructions comprising: program instructions to receive a declarative query in a known system form; program instructions to analyze the declarative query to build a set of generic query tasks with identified data types; program instructions to optimize the set of generic query tasks; and program instructions to build a target database query from the optimized generic query tasks reflecting features of a target database.
16 . The computer system of claim 15 , further comprising:
program instructions to submit the target database query to the targeted database; and program instructions to receive results from the target database query.
17 . The computer system of claim 15 , wherein the optimizing of the set of generic query tasks comprises performing actions selected from a group comprising adding tasks, re-arranging tasks, and combining subsets of tasks.
18 . The computer system of claim 15 , wherein the declarative query in the known system form is a set of JavaScript Object Notation (JSON) query statements and the target database supports Structured Query Language (SQL) queries.
19 . The computer system of claim 18 , further comprising:
program instructions to provide a validation of mappings between fields in the set of JSON query statements to attributes in the generated language-independent query tasks; and program instructions to assign one or more data types to attributes in the generated query tasks.
20 . The computer system of claim 15 , further comprising:
program instructions to receive a second declarative query in a second known system form; program instructions to analyze the second declarative query to build a set of second generic query tasks with identified data types; program instructions to optimize the set of second generic query tasks; and program instructions to build a second target database query from the optimized set of second generic query tasks reflecting features of the target database.Join the waitlist — get patent alerts
Track US2017024432A1 — get alerts on status changes and closely related new filings.
We store only your email — no account needed. See our privacy policy.