Skip to main content

prepare_constraints

Function prepare_constraints 

Source
pub fn prepare_constraints(
    permutation: IndexPermutation,
    constraints: &[EncodedTerm],
) -> Result<Vec<EncodedTerm>, StorageError>
Expand description

Validate slot-0 constraint terms and drop duplicates.

Request order is preserved: this is the validation/dedup core, and order matters to nobody who calls it directly — the domain-scan walkers layer prepare_constraints_sorted on top because their resume cursors require key-order visitation. The requirements here are uniqueness (a repeated constraint would double-emit its head terms under paging) and — for POSG, whose slot 0 is the predicate — NamedNode-ness (an O or G term in the P slot would scan a prefix no POSG key can have, silently yielding nothing).