Comunica Link Traversal
    Preparing search index...

    An aggregated store allows data lookup and insertion to happen in parallel. Concretely, this means that match() calls happening before import() calls, will still consider those triples that are inserted later, which is done by keeping the response streams of match() open. Only when the end() method is invoked, all response streams will close, and the StreamingStore will be considered immutable.

    WARNING: end() MUST be called at some point, otherwise all match streams will remain unended.

    interface IAggregatedStore<Q extends RDF.BaseQuad = RDF.Quad> {
        addAllIteratorsClosedListener: (listener: () => void) => void;
        addEndListener: (listener: () => void) => void;
        addIteratorCreatedListener: (listener: () => void) => void;
        clone: () => IAggregatedStore<Q>;
        containedSources: Set<string>;
        end: () => void;
        hasEnded: () => boolean;
        hasRunningIterators: () => boolean;
        importSource: (
            url: string,
            source: IQuerySource,
            context: IActionContext,
        ) => Promise<void>;
        match: (
            subject?: Term | null,
            predicate?: Term | null,
            object?: Term | null,
            graph?: Term | null,
        ) => AsyncIterator<Q>;
        removeAllIteratorsClosedListener: (listener: () => void) => void;
        removeIteratorCreatedListener: (listener: () => void) => void;
        setBaseMetadata: (
            metadata: MetadataBindings,
            updateStates: boolean,
        ) => void;
        started: boolean;
        import(stream: Stream): EventEmitter;
    }

    Type Parameters

    • Q extends RDF.BaseQuad = RDF.Quad

    Hierarchy

    • Source<Q>
    • Sink<RDF.Stream<Q>, EventEmitter>
      • IAggregatedStore

    Implemented by

    Index

    Properties

    addAllIteratorsClosedListener: (listener: () => void) => void

    Register a listener that will be invoked when all match iterators were closed (either through ending this store, or through external calls to .close() or .destroy() on the match iterator).

    Type Declaration

      • (listener: () => void): void
      • Parameters

        • listener: () => void

          A listener.

        Returns void

    addEndListener: (listener: () => void) => void

    Register a listener that will be invoked when the store has ended.

    Type Declaration

      • (listener: () => void): void
      • Parameters

        • listener: () => void

          A listener.

        Returns void

    addIteratorCreatedListener: (listener: () => void) => void

    Register a listener that will be invoked when a new iterator is returned from match().

    Type Declaration

      • (listener: () => void): void
      • Parameters

        • listener: () => void

          A listener.

        Returns void

    clone: () => IAggregatedStore<Q>

    Create a copy of this aggregated store. Independent of the state of the current store, the returned store is safe to use within a new query execution.

    containedSources: Set<string>

    The sources that are indexed in this store.

    end: () => void

    Mark this store as ended.

    This will make sure that all running and future match calls will end, and all next import calls to this store will throw an error.

    hasEnded: () => boolean

    Indicate whether or not an IAggregatedStore has ended.

    Type Declaration

      • (): boolean
      • Returns boolean

        return true if the store has ended

    hasRunningIterators: () => boolean

    If iterators created during the match call are still running.

    importSource: (
        url: string,
        source: IQuerySource,
        context: IActionContext,
    ) => Promise<void>

    Import the given query source into the store.

    Type Declaration

      • (url: string, source: IQuerySource, context: IActionContext): Promise<void>
      • Parameters

        • url: string

          The URL of the source.

        • source: IQuerySource

          The query source.

        • context: IActionContext

          The context.

        Returns Promise<void>

    match: (
        subject?: Term | null,
        predicate?: Term | null,
        object?: Term | null,
        graph?: Term | null,
    ) => AsyncIterator<Q>

    Returns a stream that processes all quads matching the pattern.

    Type Declaration

      • (
            subject?: Term | null,
            predicate?: Term | null,
            object?: Term | null,
            graph?: Term | null,
        ): AsyncIterator<Q>
      • Parameters

        • Optionalsubject: Term | null

          The optional subject.

        • Optionalpredicate: Term | null

          The optional predicate.

        • Optionalobject: Term | null

          The optional object.

        • Optionalgraph: Term | null

          The optional graph.

        Returns AsyncIterator<Q>

        The resulting quad stream.

    removeAllIteratorsClosedListener: (listener: () => void) => void

    Remove the given iterators closed listener.

    Type Declaration

      • (listener: () => void): void
      • Parameters

        • listener: () => void

          A listener.

        Returns void

    removeIteratorCreatedListener: (listener: () => void) => void

    Remove the given iterator creation listener.

    Type Declaration

      • (listener: () => void): void
      • Parameters

        • listener: () => void

          A listener.

        Returns void

    setBaseMetadata: (metadata: MetadataBindings, updateStates: boolean) => void

    Update the metadata of the base iterator, from which the aggregated store is being populated.

    Type Declaration

      • (metadata: MetadataBindings, updateStates: boolean): void
      • Parameters

        • metadata: MetadataBindings

          The metadata object.

        • updateStates: boolean

        Returns void

    started: boolean

    If this aggregated has started processing.

    Methods

    • Consumes the given stream.

      The end and error events are used like described in the Stream interface. Depending on the use case, subtypes of EventEmitter or Stream are used.

      Parameters

      • stream: Stream

        The stream that will be consumed.

      Returns EventEmitter

      The resulting event emitter.

      Stream