Compositional Query Comprehensions for Flexible Clause Assembly

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing query languages, such as SQL and XQuery, are limited in composability, restricting how query clauses can be nested and stacked, making it difficult to construct larger queries from smaller ones and introducing flexibility issues, especially when using query comprehensions.

Innovation Solution

The proposed solution enables query expressions to be constructed in a compositional manner, allowing for modular assembly and nesting of query clauses with wide scoping rules, enabling the introduction of new control variables, hiding existing ones, and using them as needed, while allowing any query operator to be employed irrespective of the previous operator, and automatically terminating the query expression with implicit Select or Return clauses for outputting results.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Adaptability or versatility

If query comprehensions are used to introduce control variables and span over several clauses, then scoping capability is improved, but composability deteriorates because comprehensions are monolithic constructs

Engineering Contradiction:
Improvescoping capabilityVSAvoidcomposability
Core Design Contradiction:
Adaptability or versatilityVSDevice complexity

Solution Approach 1:

The query comprehension is segmented into discrete, composable clauses (From, Where, Select, etc.) that can be independently constructed and combined. Each clause operates as a separate unit with well-defined input and output interfaces, allowing queries to be built by stacking smaller query units rather than requiring monolithic comprehension blocks.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

Query clauses are designed to be nestable within each other, where a query can contain sub-queries as part of its clauses. This nesting capability allows complex queries to be constructed from simpler query units, maintaining both scoping capabilities and composability.

Inventive Principle:
Principle #7Nested doll (Nesting)

2Device complexity

If API calls are used to allow composability of query clauses, then composability is improved, but ease of operation deteriorates due to the need to pass delegates and lambda expressions

Engineering Contradiction:
ImprovecomposabilityVSAvoidease of operation
Core Design Contradiction:
Device complexityVSEase of operation

Solution Approach 1:

The query comprehension syntax automatically manages variable scoping and clause composition without requiring explicit delegate or lambda expression parameters. The system self-services the complexity of variable binding and scope management that would otherwise burden the user, making composability accessible without advanced programming knowledge.

Inventive Principle:
Principle #25Self-service

3Manufacturing precision

If standard SQL syntax is used with restricted clause ordering, then manufacturing precision is improved, but adaptability deteriorates as users are restricted from introducing additional operators and in different orders

Engineering Contradiction:
Improvesyntax standardizationVSAvoidflexibility
Core Design Contradiction:
Manufacturing precisionVSAdaptability or versatility

Solution Approach 1:

The query clause syntax is made dynamic, allowing clauses to be introduced in flexible orders and combined in various sequences. The system adapts to different clause orderings and operator placements while maintaining syntactic validity, moving away from rigid fixed-order requirements toward a more flexible structural framework.

Inventive Principle:
Principle #15Dynamics

Data Source

PatentUS7865533B2Compositional query comprehensions
Publication Date: 2011.01.04 MICROSOFT TECHNOLOGY LICENSING LLC
  • US7865533B2 patent drawing
  • US7865533B2 patent drawing
  • US7865533B2 patent drawing

AI summary

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.