sparql-view-unfold
    Preparing search index...

    The TermClusterSet an utils/assertionConjunction!AssertionConjunction is built on: groups of RDF terms, meeting pins the way a conjunction of sameTerm conditions needs them met, and remembering which part of a group's range it was told rather than worked out.

    That last part is here rather than in TermClusterSet because it is not a fact about groups at all

    • it is about writing them back out as a condition, which only a conjunction ever does. The set narrows a range from wherever it can, and those narrowings hold wherever the group is written, so restating them would say nothing and would grow the condition on every pass.

    The two are kept in step by assertTermTypeRange narrowing both, which gives the invariant everything else relies on: the asserted range always contains the effective one. So the asserted half never decides anything the effective half does not.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    cleanNumber: number

    Counter for generating unique group IDs

    groupMergeHistory: Record<number, number>

    A history of oldGroups (keys) that got merged into newGroups (values). Needed to dereference removed groups still used in a pin.

    groupToAssertedRange: Record<number, RangeSet>

    Maps group ID to the part of its range a condition asserted, rather than the set working it out

    groupToPin: Record<number, Pin<Term> | undefined>

    Maps group ID to what the group is pinned to (if anything) - read through pinOf.

    groupToRange: Record<number, RangeSet>

    Maps group ID to the term types its value may have - read through rangeOf.

    groupToValues: Record<number, T[]>

    Maps group ID to the values in it - read through valuesOf and groupEntries.

    meetPins: (a: Pin<Term>, b: Pin<Term>) => false | PinMeet<Term>

    Meets the two pins a group is asked to carry at once, reporting false when no value satisfies both

    toId: (value: string) => string
    valueToGroup: Record<string, number | undefined>

    Maps a value to the group it is in - read through groupOf.

    Accessors

    • get revision(): number

      The state the set is in, as a stamp that no two states of any two sets share.

      Every method that writes anything moves it on (touch), so a memo taken off the set is valid for exactly as long as this is what it was taken at - which is a check the memo cannot forget to make, there being nothing to invalidate.

      Returns number

    Methods

    • Narrows the group's range with something a condition asserts of it, which assertedRangeOf reports back and everything else treats as an ordinary narrowing.

      Parameters

      • group: number

        The group to narrow

      • range: RangeSet

        The term types the condition asserts its value has

      Returns boolean

      false when nothing is left for it to be, or when its pin is not one of those terms

    • A group a condition narrowed the range of carries information however few members it has: what it was told is what its last member is still constrained by, and what utils/assertionConjunction!AssertionConjunction.get reads back out of it as T⟨?x : τ⟩.

      Without this the whole of FILTER(isTRIPLE(?x)) would be dropped the moment its group falls to one member - which the transfer through a BIND(?y AS ?x) does at once, ?x leaving the group it just put ?y in - and a condition dropped from Θ is a condition dropped from the query.

      Parameters

      • group: number

        The group to check

      Returns boolean

      whether it is worth keeping

    • The group a value is in, without creating one for it - the read-only counterpart of getGroup.

      Parameters

      • value: string

        The value to look up

      Returns number | undefined

      the group ID, or undefined when the value is in no group

    • A group a live pin points at survives however few members it has: it is a position of a shape, and dropping it would leave that shape naming a group that is no longer there.

      Parameters

      • group: number

        The group to check

      Returns boolean

      whether it is worth keeping

    • Merges two groups by id, which is what a group nothing names can be merged by - the values-only half of a merge, whatever else a subclass hangs off a group being migrated by migrateGroupData.

      Parameters

      • fromGroup: number

        One group

      • toGroup: number

        The other

      Returns { newGroup: number; oldGroup: number } | undefined

      the ids involved, or undefined when the two ids are the same group

    • Merges two groups, carrying over everything the disappearing one held.

      Parameters

      • from: string

        One of the values whose group to merge

      • to: string

        The other

      Returns { conflict: boolean; newGroup: number; oldGroup: number } | undefined

      the ids involved and whether the two could not hold the same value, which leaves the set in a state no caller may read - what to do about that is up to the two subclasses; undefined when both values were already in one group

    • Carries the asserted range of the disappearing group over: both groups hold one value, so it is asserted of that value whichever of them it was asserted of.

      Parameters

      • oldGroup: number

        The group disappearing

      • newGroup: number

        The group surviving

      Returns void

    • Pins a term onto a group.

      Parameters

      • group: number

        The group to pin

      • term: Term

        The term every value of it equals

      Returns boolean

      false when the group already carries something incompatible, which leaves the set in a state no caller may read