The criteria to encode
Encoding options
Configuration options for encoding operations.
Optional Readonlybase?: IRIBase IRI for IRI internalisation (must be absolute and hierarchical).
Converts absolute IRIs to internal (root-relative) form.
If omitted, IRIs are internalised against the base namespace IRI (base:/#).
Optional Readonlyindent?: boolean | numberIndentation level for pretty-printing encoded output.
true, uses default indentationfalse or a number less than or equal to 0, disables indentationIf omitted, output is not indented.
The encoded criteria string with internalised IRIs
TypeError If base is not a hierarchical IRI
Encodes criteria as a URL-safe string.
Serialises a Criteria into an application/x-www-form-urlencoded string, recursively internalising absolute IRIs against the provided
base; see Criteria Serialisation for the wire format.The encoder always produces canonical form:
~name=widget), except for the postfix aliases: disjunctive matching omits its?(category=home), and<=and>=follow the expression (price>=100)?=value,>==100), which is unambiguous therename=widget)code="123",flag="true",email="user@example")nullremain unquoted (JSON literals)^price=1,^name=-2)@tagsuffix (for example,text@en)This ensures consistent, predictable output. The decoder also accepts prefix operators (
>=price=100), an explicit?(?name=widget) and redundant quotes (name="widget"), so older or hand-written URLs still decode.The codec treats the
@tagsuffix as an opaque key and assigns it no semantic meaning. Consumers are responsible for interpreting the resulting Dictionary using schema-based information.