# US 2008/0189258 A1 · Compositional query comprehensions

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

- Number: US 2008/0189258 A1
- Document ID: US20080189258A1
- Status: Published application
- Kind: A1
- Application number: 11/671,417
- Filed: 2007-02-05
- Published: 2008-08-07
- Earliest claimed: 2007-02-05
- Assignees: Microsoft Corporation
- Inventors: Henricus Johannes Maria Miejer; Amanda K. Silver; Paul A. Vick; Eugueni Zabokritski; Aleksey V. Tsingauz
- Web page: https://patentgrep.com/patent/US20080189258A1

## CPC

- G06F 16/9032: Query formulation
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

The claimed subject matter relates to an architecture that can facilitate query comprehension that are constructed in a compositional manner. In accordance therewith, the query comprehensions can be assembled together in virtually in order without common requirements that force query operators of a query expression to follow ordering/syntactic rules. In addition, the architecture can provide for query expressions that arbitrarily composable and which can be terminated at any point. If the query expression terminates without a Select or Return clause at the end, the architecture can facilitate generation of an implicit Select or Return, and output results.

## Claims

### Claim 1

A computer-implemented system that facilitates composable and/or extensible query comprehensions, comprising:
a transformation component that receives initialization data and a set of query clauses in a sequence characterized by a query expression, the transformation component resolves values of a control variable in scope for each query clause, respectively, and in a manner that is independent of an ordering of the sequence; and
a comprehension component that manages a scope of the control variable.

### Claim 2 (depends on 1)

The system of claim 1, the initization data includes a first control variable and at least one of a collection or an expression.

### Claim 3 (depends on 1)

The system of claim 1, the transformation component resolves the values of the control variable based upon a type of query clause received.

### Claim 4 (depends on 1)

The system of claim 1, the comprehension component declares a new control variable and bring the new control variable in scope based upon a type of query clause received.

### Claim 5 (depends on 5)

The system of claim 5, the new control variable is associated with at least one of a collection or a computed expression.

### Claim 6 (depends on 1)

The system of claim 1, the comprehension component takes an extant control variable out of scope based upon a type of query clause received.

### Claim 7 (depends on 1)

The system of claim 1, the comprehension component, based upon a type of query clause received, declares and scopes a new control variable and brings an extant control variable in scope for a particular set of subsequent query clauses.

### Claim 8 (depends on 1)

The system of claim 1, the comprehension component takes all extant control variables out of scope based upon a type of query clause received.

### Claim 9 (depends on 1)

The system of claim 1, the comprehension component generates an alias for a tuple of an extant control variable based upon a type of query clause received.

### Claim 10 (depends on 1)

The system of claim 1, the transformation component outputs results of a current query clause to a next query clause in the sequence.

### Claim 11 (depends on 10)

The system of claim 10, the transformation component passes control variables in scope to the next query clause.

### Claim 12 (depends on 1)

The system of claim 1, the set of query clauses is not required to include an explicit termination query clause.

### Claim 13 (depends on 1)

The system of claim 1, the transformation component is configured to append an implicit termination clause to each query clause received.

### Claim 14 (depends on 13)

The system of claim 13, the implicit termination clause facilitates return of the values of the control variable when only one control variable is in scope.

### Claim 15 (depends on 13)

The system of claim 13, the implicit termination clause facilitates return of a name-value pair tuple for each control variable when more than one control variable is in scope.

### Claim 16 (depends on 1)

The system of claim 1, the transformation component is configured to allow arbitrary nesting of sets of query clauses.

### Claim 17 (depends on 1)

The system of claim 1, the transformation component evaluates a query clause based upon an expected type associated with the query clause.

### Claim 18 (depends on 1)

The system of claim 1, the transformation component is configured to receive multiple collections and output a single collection with control variables associated with the multiple collections merged according to a type of query clause.

### Claim 19

A computer-implemented method for facilitating construction of query comprehensions in a compositional manner, comprising:
obtaining a collection and a control variable associated with the collection;
receiving in succession a current query clause from a set of query clauses included in a query expression without placing syntactical ordering restrictions on the expression;
modifying the collection based upon the current query clause; and
providing access to control variables that are in scope for the current query clause, the access is provided to a next query clause.

### Claim 20

A computer-implemented system for facilitating compositional query comprehensions, comprising:
computer-implemented means for acquiring a collection or an expression, and a control variable associated with the collection or the expression;
computer-implemented means for receiving a present query clause from a sequence of query clauses, the sequence is not required to conform to a predefined order;
computer-implemented means for transforming the collection based upon the present query clause; and
computer-implemented means for granting a next query clause access to control variables in scope for the present query clause.
