A lazy query source.

interface IQuerySource {
    getSelectorShape: ((context) => Promise<FragmentSelectorShape>);
    queryBindings: ((operation, context, options?) => BindingsStream);
    queryBoolean: ((operation, context) => Promise<boolean>);
    queryQuads: ((operation, context) => AsyncIterator<Quad>);
    queryVoid: ((operation, context) => Promise<void>);
    referenceValue: QuerySourceReference;
    toString: (() => string);
}

Implemented by

    Properties

    getSelectorShape: ((context) => Promise<FragmentSelectorShape>)

    Get the selector type that is supported by this source.

    Type declaration

    queryBindings: ((operation, context, options?) => BindingsStream)

    Returns a (possibly lazy) stream that returns all bindings matching the operation.

    Passed operations MUST conform to the query shape exposed by the selector type returned from getSelectorShape. The given operation represents a Linked Data Fragments selector.

    The returned stream MUST expose the property 'metadata' of type MetadataBindings. The implementor is reponsible for handling cases where 'metadata' is being called without the stream being in flow-mode. This metadata object can become invalidated (see metadata.state), in which case the 'metadata' property must and will be updated.

    Type declaration

    queryBoolean: ((operation, context) => Promise<boolean>)

    Returns a promise resolving to the ask response of the given operation.

    This method should only be supported if the selector type returned from getSelectorShape supports ask queries.

    Type declaration

      • (operation, context): Promise<boolean>
      • Parameters

        • operation: Ask

          The query operation to execute.

        • context: IActionContext

          The query context.

        Returns Promise<boolean>

    Returns

    The resulting ask reply.

    queryQuads: ((operation, context) => AsyncIterator<Quad>)

    Returns a (possibly lazy) stream that returns all quads matching the operation.

    This method should only be supported if the selector type returned from getSelectorShape supports construct queries.

    Type declaration

      • (operation, context): AsyncIterator<Quad>
      • Parameters

        • operation: Operation

          The query operation to execute.

        • context: IActionContext

          The query context.

        Returns AsyncIterator<Quad>

    Returns

    The resulting quads stream.

    queryVoid: ((operation, context) => Promise<void>)

    Returns a promise resolving when the given update operation succeeds.

    This method should only be supported if the selector type returned from getSelectorShape supports update queries.

    Type declaration

      • (operation, context): Promise<void>
      • Parameters

        • operation: Update

          The query operation to execute.

        • context: IActionContext

          The query context.

        Returns Promise<void>

    Returns

    The void response.

    referenceValue: QuerySourceReference

    The URL of RDF source of this source.

    toString: (() => string)

    Returns a string representation of this source.

    Type declaration

      • (): string
      • Returns string