Comunica
    Preparing search index...

    A lazy query source.

    Implements

    Index

    Constructors

    Properties

    referenceValue: QuerySourceReference

    The URL of RDF source of this source.

    selectorShape: FragmentSelectorShape
    source: IRdfJsSourceExtended | DatasetCore<Quad, Quad>

    Methods

    • Determine how many distinct values the given variable of the given pattern takes. Only counted when the source can answer it with an index lookup, and left undefined otherwise.

      Parameters

      • operation: Pattern

        The pattern being evaluated.

      • variable: Variable

        A variable of that pattern.

      • cardinality: number

        The cardinality of that pattern.

      • quotedTripleFiltering: boolean

        If the source supports quoted triple filtering.

      Returns number | undefined

    • Returns Promise<number>

      A value from 0 to 1 indicating to what respect a source type is able to pre-filter the source based on the pattern. 1 indicates that the source can apply the whole pattern, and 0 indicates that the source can not apply the pattern at all (and local filtering must happen). Plain RDF documents for example have a filter factor of 0, while SPARQL endpoints have a filter factor of 1.

    • Determine a cardinality cache key for the given (already nullified) quad pattern terms. Returns undefined for patterns that must not be cached, i.e. those containing quoted triples, as those are matched structurally rather than by value.

      Parameters

      • ...terms: (Term | undefined)[]

        The quad pattern terms, where undefined represents a wildcard.

      Returns string | undefined

    • Check whether counting the given (already nullified) quad pattern is expensive enough to be worth caching.

      Patterns with at most one wildcard are answered by a direct index lookup, so counting them is cheap. In bind joins those are the materialized patterns, which differ for every binding, so caching them would only add lookup and storage cost. Patterns with more wildcards require an index walk proportional to their cardinality, and are exactly the patterns that a bind join re-evaluates unchanged once per binding.

      Parameters

      • ...terms: (Term | undefined)[]

        The quad pattern terms, where undefined represents a wildcard.

      Returns boolean