Renders the supplied name into a ?-prefixed token. A numeric name and its decimal string form canonicalise to the
same token (variable(0) and variable("0") both yield ?0), so a variable allocated query-side correlates with
the same variable decoded from a result row. With no argument, mints a fresh token with a random name for an
anonymous variable.
Parameters
Optionalname: string|number
The variable name: a non-negative integer, or a string matching VariablePattern; omitted to
mint a fresh anonymous variable
Returns `?${string}`
The variable token
Throws
RangeError if name is a negative or non-integer number, or a malformed string name
Constructs a SPARQL Variable.
Renders the supplied name into a
?-prefixed token. A numeric name and its decimal string form canonicalise to the same token (variable(0)andvariable("0")both yield?0), so a variable allocated query-side correlates with the same variable decoded from a result row. With no argument, mints a fresh token with a random name for an anonymous variable.