Utilization of logical fields with conditional constraints in abstract queries
First Claim
Patent Images
1. A computer readable storage medium containing instructions of a program which, when executed by a processor, performs operations for retrieving data comprising:
- in response to receiving a query, determining whether the query satisfies at least one of a plurality of conditional constraints, wherein each constraint is programmatically generated by execution of a constraint generation routine that performs a constraint generation operation, comprising;
issuing a first query to retrieve distinct values for a first field;
receiving results for the first query, the results comprising the distinct values for the first field;
for each of the distinct values for the first field,issuing a second query configured to retrieve, for a second field, a result set that satisfies a first condition comprising the first field related to the distinct value by an operator;
determining whether a correlation exists between (i) the respective distinct value of the first field and (ii) a respective result set value of the second field; and
if a correlation exists, defining a conditional constraint for the first field based on the correlation, wherein the conditional constraint specifies the addition of a second condition to a query if the query includes the respective first condition, wherein the second condition includes the second field related to the respective result set value by an operator; and
for each conditional constraint satisfied, adding the respective second condition corresponding to the satisfied conditional constraint to the received query to produce a modified query.
2 Assignments
0 Petitions
Accused Products
Abstract
Methods, systems, and articles of manufacture are provided for enhancing abstract queries by utilizing logical fields with conditional constraints. Building abstract queries with logical fields configured with conditional constraints allows for optimized physical queries to be generated from corresponding abstract queries.
-
Citations
13 Claims
-
1. A computer readable storage medium containing instructions of a program which, when executed by a processor, performs operations for retrieving data comprising:
-
in response to receiving a query, determining whether the query satisfies at least one of a plurality of conditional constraints, wherein each constraint is programmatically generated by execution of a constraint generation routine that performs a constraint generation operation, comprising; issuing a first query to retrieve distinct values for a first field; receiving results for the first query, the results comprising the distinct values for the first field; for each of the distinct values for the first field, issuing a second query configured to retrieve, for a second field, a result set that satisfies a first condition comprising the first field related to the distinct value by an operator; determining whether a correlation exists between (i) the respective distinct value of the first field and (ii) a respective result set value of the second field; and if a correlation exists, defining a conditional constraint for the first field based on the correlation, wherein the conditional constraint specifies the addition of a second condition to a query if the query includes the respective first condition, wherein the second condition includes the second field related to the respective result set value by an operator; and for each conditional constraint satisfied, adding the respective second condition corresponding to the satisfied conditional constraint to the received query to produce a modified query.
-
-
2. The computer readable medium of claim 1, further comprising:
-
determining whether the modified query satisfies at least one conditional constraint of the plurality of conditional constraints; and if so, adding the respective second condition corresponding to the at least one conditional constraint to the modified query to produce another modified query.
-
-
3. The computer readable medium of claim 1, wherein the received query is an abstract query defined according to logical fields having respective definitions in a data abstraction model, each respective definition comprising a field name, a location parameter indicating a locations of a counterpart physical field and a reference to an access method configured to access the physical field according to the location parameter.
-
4. The computer readable medium of claim 1, further comprising retrieving results corresponding to the modified query from a data repository and wherein the data repository is one of:
- a relational database, XML database, and object-relational database.
-
5. The computer readable medium of claim 1, further comprising creating the query with one of:
- a query building application and a data analysis application.
-
6. The computer readable medium of claim 1, further comprising, for each of the plurality of conditional constraints:
-
determining whether the respective correlation is violated by a data entry; and if the respective correlation is violated, removing the conditional constraint for which the respective correlation is violated.
-
-
7. The computer readable medium of claim 1, wherein the operations further comprise, executing a constraint maintenance routine which perform a maintenance operation comprising, for each of the plurality of conditional constraints:
-
determining whether the respective correlation is violated by a data entry; and if the respective correlation is violated, removing the conditional constraint for which the respective correlation is violated.
-
-
8. The computer readable medium of claim 7, wherein the constraint maintenance routine is one of:
- a database trigger and a Java®
component.
- a database trigger and a Java®
-
9. A data processing system for retrieving data, comprising:
-
a computer processor; a database management system for retrieving data from a data repository in response to queries; and a plurality of conditional constraints, wherein each constraint is programmatically generated by execution of a constraint generation routine that performs a constraint generation operation, comprising; issuing a first query to retrieve distinct values for a first field; receiving results for the first query, the results comprising the distinct values for the first field; for each of the distinct values for the first field, issuing a second query configured to retrieve, for a second field, a result set that satisfies a first condition comprising the first field related to the distinct value by an operator; determining whether a correlation exists between (i) the respective distinct value of the first field and (ii) a respective result set value of the second field; and if a correlation exists, defining a conditional constraint for the first field based on the correlation, wherein the conditional constraint specifies the addition of a second condition to a query if the query includes the respective first condition, wherein the second condition includes the second field related to the respective result set value by an operator.
-
-
10. The data processing system of claim 9, wherein the data repository is one of:
- a relational database, XML database, and object-relational database and further comprising an application for creating the queries, wherein the application is one of;
a query building application and a data analysis application.
- a relational database, XML database, and object-relational database and further comprising an application for creating the queries, wherein the application is one of;
-
11. The data processing system of claim 9, further comprising a program component for managing a plurality of conditional constraints by:
-
determining whether the respective correlation is violated by a data entry; and if the respective correlation is violated, removing the conditional constraint for which the respective correlation is violated.
-
-
12. The data processing system of claim 11, wherein the program component is one of:
- a database trigger and a Java®
component.
- a database trigger and a Java®
-
13. A computer implemented method for defining a field for use in a query, comprising:
-
issuing a first query to retrieve distinct values for a first field; receiving results for the first query, the results comprising the distinct values for the first field; for each of the distinct values for the first field, issuing a second query configured to retrieve, for a second field, a result set that satisfies a first condition comprising the first field related to the distinct value by an operator; determining whether a correlation exists between (i) the respective distinct value of the first field and (ii) a respective result set value of the second field; and if a correlation exists, defining a conditional constraint for the first field based on the correlation, wherein the conditional constraint specifies the addition of a second condition to a query if the query includes the respective first condition, wherein the second condition includes the second field related to the respective result set value by an operator; and receiving results for the second query.
-
Specification