class LD::Patch::Algebra::Constraint

The LD Patch ‘constraint` operator.

A constraint is a query operator which either ensures that there is a single input node (“!” operator) or finds a set of nodes for a given ‘path`, optionally filtering those nodes with a particular predicate value.

@example existence of path solutions

  (constraint (path :p))

Maps input terms to output terms using `(path :p)` returning those input terms that have at least a single solution.

@example paths with property value

  (constraint (path :p) 1)

Maps input terms to output terms using `(path :p)` and filters the input terms where the output term is `1`.

@example unique terms

  (constraint unique)

Returns the single term from the input terms if there is a single input term.