System and method of translating a universal query language to SQL
First Claim
1. A method of translating a query based on a resource-property model into a statement for querying a relational database, comprising:
- for each rule property in or derived from the resource-property query, substituting the rule string for the rule property;
for each resource and resource property in or derived from the query, assigning a relational table having an id to the resource or resource property and entering the assigned table id into a table list;
for each resource property in or derived from the query, determining any implied conditions based on the resource property and entering the implied conditions into a condition list;
for each primitive property in or derived from the query, assigning a table and column to the primitive property and entering the table and column into a column list;
for each predicate in or derived from the query, resolving the predicate into one or more conditions and entering the one or more conditions into the condition list; and
forming an a relational query statement from the column list, the table list and the condition list.
1 Assignment
0 Petitions
Accused Products
Abstract
A system and method for translating a universal query language UQL into a relational query language such as SQL. The method first determines whether there are any UQL rule properties. If so, the rule is substituted for the rule property. Next, for each resource and resource property, a relational table is assigned and given an ID. Assigned tables are placed into a table list. Following this step, for each resource property, implied conditions are generated and placed into a condition list and, if needed, additional tables are generated and assigned ids. Then, for each UQL primitive property, a table and column is identified according to a table.column format and placed into a column list. Finally, any predicates are resolved into explicit conditions and the conditions are placed into the condition list. From the column list, the table list and the condition list an SQL statement is formed for querying the relational database.
218 Citations
19 Claims
-
1. A method of translating a query based on a resource-property model into a statement for querying a relational database, comprising:
-
for each rule property in or derived from the resource-property query, substituting the rule string for the rule property;
for each resource and resource property in or derived from the query, assigning a relational table having an id to the resource or resource property and entering the assigned table id into a table list;
for each resource property in or derived from the query, determining any implied conditions based on the resource property and entering the implied conditions into a condition list;
for each primitive property in or derived from the query, assigning a table and column to the primitive property and entering the table and column into a column list;
for each predicate in or derived from the query, resolving the predicate into one or more conditions and entering the one or more conditions into the condition list; and
forming an a relational query statement from the column list, the table list and the condition list.
-
-
2. A system for translating a query language, comprising:
-
a query translator;
a first input coupled to said translator for receiving a universal query language statement;
a second input coupled to said translator for receiving a configuration information; and
an output coupled to said translator for generating a structured query language statement. - View Dependent Claims (3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 18)
-
-
15. A method of translating a query based on a resource-property modelstring into a statement for querying a relational database, wherein the resource-property having at least one rule and said query having at least one rule string, comprising:
-
providing at least one resource in said model;
providing at least one property in each resource;
substituting the rule string for a rule property in the resource-property query;
assigning a relational table having an ID to the resource and entering the assigned table ID into a table list for each resource and resource property in the query;
determining any link element based on the resource property and entering the link element into a link list for each resource property in the query;
assigning a table and column to a primitive property and entering the table and column into a column list for each primitive property in the query; and
forming a relational query statement from the column list, the table list and the link list.
-
-
17. A method of translating a query based on a resource-property modelstring into a statement for querying a relational database, wherein the resource-property having at least one rule and said query having at least one rule string, comprising:
-
providing at least one resource in said model;
providing at least one property in each resource;
substituting the rule string for a rule property derived from the resource-property query;
assigning a relational table having an ID to the resource and entering the assigned table ID into a table list for each resource and resource property derived from the query;
determining any link element based on the resource property and entering the link element into a link list for each resource property derived from the query;
assigning a table and column to a primitive property and entering the table and column into a column list for each primitive property derived the query; and
forming a relational query statement from the column list, the table list and the link list.
-
-
19. A computer program product embodying a program of instructions executable by a machine to perform method steps for translating a query based on a resource-property model having a rule string into a statement for querying a relational database, wherein the resource-property having at least one rule and said query having at least one rule string, comprising:
-
substituting the rule string for the rule property for each rule property in or derived from the resource-property query;
assigning a relational table having an ID to the resource or resource property and entering the assigned table id into a table list for each resource and resource property in or derived from the query;
determining any implied conditions based on the resource property and entering the implied conditions into a condition list for each resource property in or derived from the query;
assigning a table and column to the primitive property and entering the table and column into a column list for each primitive property in or derived from the query;
resolving the predicate into one or more conditions and entering the one or more conditions into the condition list for each predicate in or derived from the query; and
forming an a relational query statement from the column list, the table list and the condition list.
-
Specification