object

uri_template(Representation)

  • Representation - URI template, variable name, variable value, and expansion representation. Valid values are atom, codes, and chars.

URI template validation, variable enumeration, and expansion predicates implementing RFC 6570.

Availability:
logtalk_load(uri_template(loader))
Author: Paulo Moura
Version: 1:0:0
Date: 2026-09-02
Compilation flags:
static, context_switching_calls
Remarks:
(none)
Inherited public predicates:
(none)

Public predicates

valid/1

True iff the argument is a valid RFC 6570 URI template.

Compilation flags:
static
Template:
valid(Template)
Mode and number of proofs:
valid(++text) - zero_or_one

variables/2

Returns the unique template variable names in first-seen order.

Compilation flags:
static
Template:
variables(Template,Variables)
Mode and number of proofs:
variables(++text,-list(text)) - zero_or_one

expand/3

Expands a valid RFC 6570 URI template using a list of Name-Value bindings. Values are represented by undefined, string(Text), list(Texts), assoc(Pairs), or structure(Pairs) terms.

Compilation flags:
static
Template:
expand(Template,Bindings,Expansion)
Mode and number of proofs:
expand(++text,+list(pair),-text) - zero_or_one

expand/4

Expands an RFC 6570 URI template while recovering from template syntax errors. Malformed expressions are copied unexpanded and processing continues. For an invalid literal or unterminated expression, the unprocessed remainder is copied and processing stops. Errors are returned as zero-based error(Position, Reason) terms.

Compilation flags:
static
Template:
expand(Template,Bindings,Expansion,Errors)
Mode and number of proofs:
expand(++text,+list(pair),-text,-list(compound)) - zero_or_one

Protected predicates

(no local declarations; see entity ancestors if any)

Private predicates

(no local declarations; see entity ancestors if any)

Operators

(none)