Standard value transformations for computed expressions.
Resource projection.
Collection query.
Property projection specs.
Model value.
Single-valued language-tagged model for internationalised text.
Multi-valued language-tagged model for internationalised text.
Named computed expression.
Computed expression.
Constraint option set.
Constraint option.
Query criterion.
Constraint operator symbols for Query keys.
Value transform.
Type guards for runtime validation of query and value types.
Checks if a value is a Model.
Checks if a value is a Query.
Checks if a value is a ValuesModel.
Checks if a value is a ValueModel.
Checks if a value is a LocalModel.
Checks if a value is a LocalsModel.
Checks if a value is a Binding.
Checks if a value is an Expression.
Checks if a value is an Options.
Checks if a value is an Option.
Checks if a value is a Criterion.
Checks if a value is an Operator.
Checks if a value is a Transform.
Functions for converting between serialized and structured representations.
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 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:
Defines structures for programmatic query key handling:
Defines value transformation infrastructure:
Retrieval Patterns
Resource Retrieval
A Model 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 Retrieval
A Query extends Model with filtering, ordering, and pagination criteria for collections. 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
Models 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:
Model Serialization
Multiple formats are supported for transmission as URL query strings in GET requests:
jsonbase64formJSON Serialization
Directly encodes Model objects using operator key prefixes.
Form Serialization
Form serialization specifies only query constraints; servers are expected to convert to a model by wrapping inside the target endpoint's collection property and providing a default projection.
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)priceascendingModel Grammar
The following grammar elements are shared by both JSON and Form serialization formats.
Expressions
Criterion keys identify properties or computed values combining an optional result name (forming a Binding), a pipeline of Transforms, and a property path (Expression):
Values
Values are serialized as JSON primitives:
"text"@en)Numeric-looking values like
123are parsed as numbers unless quoted.