Skip to main content


LDkit - Linked Data query toolkit for TypeScript developers
Go to Latest
interface Bindings
implements Iterable<[RDF.Variable, RDF.Term]>
import { type Bindings } from "";

Bindings represents the mapping of variables to RDF values using an immutable Map-like representation. This means that methods such as set and delete do not modify this instance, but they return a new Bindings instance that contains the modification.

Bindings instances are created using a BindingsFactory.

The internal order of variable-value entries is undefined.


type: "bindings"
has: (key: RDF.Variable | string) => boolean

Check if a binding exist for the given variable.

get: (key: RDF.Variable | string) => RDF.Term | undefined

Obtain the binding value for the given variable.

set: (key: RDF.Variable | string, value: RDF.Term) => Bindings

Create a new Bindings object by adding the given variable and value mapping.

If the variable already exists in the binding, then the existing mapping is overwritten.

delete: (key: RDF.Variable | string) => Bindings

Create a new Bindings object by removing the given variable.

If the variable does not exist in the binding, a copy of the Bindings object is returned.

keys: () => Iterable<RDF.Variable>

Obtain all variables for which mappings exist.

values: () => Iterable<RDF.Term>

Obtain all values that are mapped to.

forEach: (fn: (value: RDF.Term, key: RDF.Variable) => any) => void

Iterate over all variable-value pairs.

size: number

The number of variable-value pairs.

[[Symbol.iterator]]: () => Iterator<[RDF.Variable, RDF.Term]>

Iterator over all variable-value pairs.

filter: (fn: (value: RDF.Term, key: RDF.Variable) => boolean) => Bindings

Create a new Bindings object by filtering entries using a callback.

map: (fn: (value: RDF.Term, key: RDF.Variable) => RDF.Term) => Bindings

Create a new Bindings object by mapping entries using a callback.

merge: (other: Bindings) => Bindings | undefined

Merge this bindings with another.

If a merge conflict occurs (this and other have an equal variable with unequal value), then undefined is returned.

mergeWith: (merger: (
self: RDF.Term,
other: RDF.Term,
) => RDF.Term
, other: Bindings
) => Bindings

Merge this bindings with another, where merge conflicts can be resolved using a callback function.


equals(other: Bindings | null | undefined): boolean

Check if all entries contained in this Bindings object are equal to all entries in the other Bindings object.