Comunica
    Preparing search index...

    Interface IQuerySource

    A lazy query source.

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

    Implemented by

    Index

    Properties

    getFilterFactor: (context: IActionContext) => Promise<number>

    Type Declaration

      • (context: IActionContext): Promise<number>
      • Parameters

        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.

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

    Get the selector type that is supported by this source.

    Type Declaration

    queryBindings: (
        operation: BaseOperation,
        context: IActionContext,
        options?: IQueryBindingsOptions,
    ) => 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: Ask, context: IActionContext) => 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: Ask, context: IActionContext): Promise<boolean>
      • Parameters

        • operation: Ask

          The query operation to execute.

        • context: IActionContext

          The query context.

        Returns Promise<boolean>

        The resulting ask reply.

    queryQuads: (
        operation: BaseOperation,
        context: IActionContext,
    ) => 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

    queryVoid: (operation: BaseOperation, context: IActionContext) => 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

    referenceValue: QuerySourceReference

    The URL of RDF source of this source.

    toString: () => string

    Returns a string representation of this source.