Interface IAggregatedStore<Q>

A StreamingStore 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> {
    addIteratorCreatedListener: (listener: () => void) => void;
    containedSources: Set<string>;
    end: () => void;
    hasRunningIterators: () => boolean;
    match: (
        subject?: null | Term,
        predicate?: null | Term,
        object?: null | Term,
        graph?: null | Term,
    ) => AsyncIterator<Q>;
    removeIteratorCreatedListener: (listener: () => void) => void;
    setBaseMetadata: (
        metadata: MetadataBindings,
        updateStates: boolean,
    ) => void;
    started: boolean;
    import(stream: Stream<Q>): EventEmitter<DefaultEventMap>;
}

Type Parameters

  • Q extends RDF.BaseQuad = RDF.Quad

Hierarchy

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

Properties

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

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.

hasRunningIterators: () => boolean

If iterators created during the match call are still running.

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

Returns a stream that processes all quads matching the pattern.

Type declaration

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

      • Optionalsubject: null | Term

        The optional subject.

      • Optionalpredicate: null | Term

        The optional predicate.

      • Optionalobject: null | Term

        The optional object.

      • Optionalgraph: null | Term

        The optional graph.

      Returns AsyncIterator<Q>

      The resulting quad stream.

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

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<Q>

      The stream that will be consumed.

    Returns EventEmitter<DefaultEventMap>

    The resulting event emitter.

    Stream