Query pattern to enable type flow of element types
First Claim
Patent Images
1. At a computer system including a processor and system memory, a computer-implemented method for processing a query expression, comprising:
- (A) an act of accessing a query expression, the query expression including a plurality of linked query clauses, the plurality of linked query clauses including at least a first query clause linked to a next query clause, the order of the plurality of linked query clauses defined in the query comprehension such that the order is independent of the underlying computing language of the query comprehension, wherein;
(B) the first query clause includes a queryable source type, a first query operator, and an element type of the source type, the element type having associated therewith a control variable, the control variable having an associated scope that is determined by the query operator, the query source type indicating the type of source data that is to be queried, the element type indicating the element type of the results of the first query clause, the query operator mapping to a method defined according to a query operator pattern; and
(C) the next query clause includes a next element type and a next query operator that is to be applied to the results of the first query clause, the next element type indicating the element type of the results of the next query clause, the next query operation mapping to a next method defined according to a next query operator pattern;
(D) evaluate the first query clause to obtain a set of elements of the element type from within the source data based on the query source type,(E) evaluating the first query clause including calling the method to implement the query operator on the source data;
(F) infer that a next source type for the next query clause is the element type, wherein the inference is based on the source type in view of the query operator, wherein the inference is performed without the need to translate the entire query comprehension;
wherein the inferring that the next source type is the element type is in real time;
(G) pass the set of elements to the next query clause, wherein the associated control variable is passed when the next query clause supports the scope of the control variable;
(H) incrementally provide context information based upon the inferred element type to the next query clause; and
(I) evaluate the next query clause to obtain a next set of elements of the next element type from within the set of elements based on the next source type and the context information, evaluating the next query clause including calling the next method to implement the next query operator on the set of elements.
3 Assignments
0 Petitions
Accused Products
Abstract
The claimed subject matter relates to a formalization of operator patterns that can facilitate type flow of element types between an operator in a first clause of an expression to an operator in a next clause of the expression. The type that flows to, and the operator extant in, the next clause can be combined to infer the element type of the next clause. As such, type-checking, autocompletion and other advantageous features can be accomplished incrementally without the need for a prior full translation of the expression.
56 Citations
18 Claims
-
1. At a computer system including a processor and system memory, a computer-implemented method for processing a query expression, comprising:
(A) an act of accessing a query expression, the query expression including a plurality of linked query clauses, the plurality of linked query clauses including at least a first query clause linked to a next query clause, the order of the plurality of linked query clauses defined in the query comprehension such that the order is independent of the underlying computing language of the query comprehension, wherein; (B) the first query clause includes a queryable source type, a first query operator, and an element type of the source type, the element type having associated therewith a control variable, the control variable having an associated scope that is determined by the query operator, the query source type indicating the type of source data that is to be queried, the element type indicating the element type of the results of the first query clause, the query operator mapping to a method defined according to a query operator pattern; and (C) the next query clause includes a next element type and a next query operator that is to be applied to the results of the first query clause, the next element type indicating the element type of the results of the next query clause, the next query operation mapping to a next method defined according to a next query operator pattern; (D) evaluate the first query clause to obtain a set of elements of the element type from within the source data based on the query source type, (E) evaluating the first query clause including calling the method to implement the query operator on the source data; (F) infer that a next source type for the next query clause is the element type, wherein the inference is based on the source type in view of the query operator, wherein the inference is performed without the need to translate the entire query comprehension;
wherein the inferring that the next source type is the element type is in real time;(G) pass the set of elements to the next query clause, wherein the associated control variable is passed when the next query clause supports the scope of the control variable; (H) incrementally provide context information based upon the inferred element type to the next query clause; and (I) evaluate the next query clause to obtain a next set of elements of the next element type from within the set of elements based on the next source type and the context information, evaluating the next query clause including calling the next method to implement the next query operator on the set of elements. - View Dependent Claims (4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18)
-
2. A computer program product for use at a computer system, the computer program product for implementing a method for processing a query expression, the computer program product comprising one or more computer storage media having stored thereon computer-executable instructions that, when executed at a processor, cause the computer system to perform the method, including the following:
(A) access a query expression, the query expression including a plurality of linked query clauses, the plurality of linked query clauses including at least a first query clause linked to a next query clause, the order of the plurality of linked query clauses defined in the query comprehension such that the order is independent of the underlying computing language of the query comprehension, wherein; (B) the first query clause includes a queryable source type, a first query operator, and an element type of the source type, the element type having associated therewith a control variable, the control variable having an associated scope that is determined by the query operator, the query source type indicating the type of source data that is to be queried, the element type indicating the element type of the results of the first query clause, the query operator mapping to a method defined according to a query operator pattern; and (C) the next query clause includes a next element type and a next query operator that is to be applied to the results of the first query clause, the next element type indicating the element type of the results of the next query clause, the next query operation mapping to a next method defined according to a next query operator pattern; (D) evaluate the first query clause to obtain a set of elements of the element type from within the source data based on the query source type, (E) evaluating the first query clause including calling the method to implement the query operator on the source data; (F) infer that a next source type for the next query clause is the element type, wherein the inference is based on the source type in view of the query operator, wherein the inference is performed without the need to translate the entire query comprehension;
wherein the inferring that the next source type is the element type is in real time;(G) pass the set of elements to the next query clause, wherein the associated control variable is passed when the next query clause supports the scope of the control variable; (H) incrementally provide context information based upon the inferred element type to the next query clause; and (I) evaluate the next query clause to obtain a next set of elements of the next element type from within the set of elements based on the next source type and the context information, evaluating the next query clause including calling the next method to implement the next query operator on the set of elements.
-
3. A computer system, the computer system comprising:
-
system memory; one or more processors; and one or more computer storage media having stored thereon computer-executable instructions representing a user-interface and a transformation component, wherein the user-interface is configured to; (A) access a query expression for querying a relational database, the query expression including a plurality of sequenced query clauses, the plurality of sequenced query clauses including at least a first query clause followed by a next query clause, the order of the plurality of sequenced query clauses defined in the query expression such that the order is independent of the underlying computing language of the query comprehension, wherein; (B) the first query clause includes a queryable source type, a first query operator, and an element type of the source type, the element type having associated therewith a control variable, the control variable having an associated scope that is determined by the query operator, the query source type indicating the type of source data that is to be queried, the element type indicating the element type of the results of the first query clause, the query operator mapping to a method defined according to a query operator pattern; and (C) the next query clause includes a next element type and a next query operator that is to be applied to the results of the first query clause, the next element type indicating the element type of the results of the next query clause, the next query operation mapping to a next method defined according to a next query operator pattern; (D) evaluate the first query clause to obtain a set of elements of the element type from within the source data based on the query source type, (E) evaluating the first query clause including calling the method to implement the query operator on the source data; (F) infer that a next source type for the next query clause is the element type, wherein the inference is based on the source type in view of the query operator, wherein the inference is performed without the need to translate the entire query comprehension;
wherein the inferring that the next source type is the element type is in real time;(G) pass the set of elements to the next query clause, wherein the associated control variable is passed when the next query clause supports the scope of the control variable; (H) incrementally provide context information based upon the inferred element type to the next query clause; and (I) evaluate the next query clause to obtain a next set of elements of the next element type from within the set of elements based on the next source type and the context information, evaluating the next query clause including calling the next method to implement the next query operator on the set of elements.
-
Specification