Standard value transformations for computed expressions.
Resource retrieval query.
Property value specification for retrieval queries.
Computed expression for deriving values from resource properties.
Option values for Query matching and ordering operators.
Single option value for Query matching and ordering operators.
Parsed representation of a Query key.
Constraint operator symbols for Query keys.
Encodes a query as a URL-safe string.
Decodes a query from a URL-safe string.
Encodes a criterion as a Query key string.
Decodes a Query key string into a criterion.
Client-driven resource retrieval.
Defines types for specifying what data to retrieve in REST/JSON APIs, including property selection, linked resource expansion, and—for collections—filtering, ordering, and pagination:
Provides utilities for converting between serialized and structured representations:
Query Patterns
Resource Queries
A Query specifies which properties to retrieve from a single Resource and how deeply to expand linked resources. No over-fetching of unwanted fields, no under-fetching requiring additional calls:
Collection Queries
Collection queries are nested inside a managing resource that owns the collection, following REST/JSON best practices. Singleton array projections retrieve filtered, sorted, and paginated results with arbitrarily deep expansions in a single call - no over-fetching, no under-fetching:
Localized Content
For multilingual properties, use TagRange keys to select language tags to retrieve:
Computed Properties
Queries can define computed properties using expressions combining property paths with Transforms.
Plain transforms operate on individual values:
Aggregate transforms operate on collections:
Faceted Search
Aggregates enable faceted search patterns, computing category counts, value ranges, and totals in a single call:
Query Serialization
Multiple formats are supported for transmission as URL query strings in GET requests:
jsonbase64formJSON Serialization
Directly encodes Query objects using operator key prefixes.
Form Serialization
Supports
application/x-www-form-urlencodedencoding via theformmode. The format encodes queries aslabel=valuepairs where:expression=valuefor?expression=value(disjunctive matching)expression<=valuefor<=expression=value(less than or equal)expression>=valuefor `>=expression=value (greater than or equal)Encoding notes:
~(like),!(all)&(separator),=(key/value),+(space),%(escape)This query:
categoryis "electronics" OR "home"namecontains "widget"priceis between 50 and 150 (inclusive)priceascendingForm queries specify only constraints; wrapping inside the target endpoint's collection property and providing a default projection is server-managed.
Query Grammar
The following grammar elements are shared by both JSON and Form serialization formats.
Expressions
Expressions identify properties or computed values combining an optional result name, a pipeline of Transforms, and a property path:
Values
Values are serialized as JSON primitives:
"text"@en)Numeric-looking values like
123are parsed as numbers unless quoted.