Interface IQueryEngine<QueryStringContextInner, QueryAlgebraContextInner>

Base interface for a Comunica query engine.

interface IQueryEngine<QueryStringContextInner, QueryAlgebraContextInner> {
    explain: (<QueryFormatTypeInner>(query, context, explainMode) => Promise<IQueryExplained>);
    getResultMediaTypeFormats: ((context?) => Promise<Record<string, string>>);
    getResultMediaTypes: ((context?) => Promise<Record<string, number>>);
    invalidateHttpCache: ((url?) => Promise<any>);
    query: (<QueryFormatTypeInner>(query, context?) => Promise<QueryType>);
    queryBindings: (<QueryFormatTypeInner>(query, context?) => Promise<BindingsStream>);
    queryBoolean: (<QueryFormatTypeInner>(query, context?) => Promise<boolean>);
    queryQuads: (<QueryFormatTypeInner>(query, context?) => Promise<AsyncIterator<Quad> & ResultStream<Quad>>);
    queryVoid: (<QueryFormatTypeInner>(query, context?) => Promise<void>);
    resultToString: ((queryResult, mediaType?, context?) => any);
}

Type Parameters

Hierarchy

Implemented by

    Properties

    explain: (<QueryFormatTypeInner>(query, context, explainMode) => Promise<IQueryExplained>)

    Explain the given query

    Type declaration

    Returns

    A promise that resolves to the query output.

    getResultMediaTypeFormats: ((context?) => Promise<Record<string, string>>)

    Type declaration

      • (context?): Promise<Record<string, string>>
      • Parameters

        Returns Promise<Record<string, string>>

    Returns

    All available SPARQL result media type formats.

    getResultMediaTypes: ((context?) => Promise<Record<string, number>>)

    Type declaration

      • (context?): Promise<Record<string, number>>
      • Parameters

        Returns Promise<Record<string, number>>

    Returns

    All available SPARQL (weighted) result media types.

    invalidateHttpCache: ((url?) => Promise<any>)

    Invalidate all internal caches related to the given page URL. If no page URL is given, then all pages will be invalidated.

    Type declaration

      • (url?): Promise<any>
      • Parameters

        • Optional url: string

          The page URL to invalidate.

        Returns Promise<any>

    Returns

    A promise resolving when the caches have been invalidated.

    query: (<QueryFormatTypeInner>(query, context?) => Promise<QueryType>)

    Initiate a given query. This will produce a future to a query result, which has to be executed to obtain the query results. This can reject given an unsupported or invalid query.

    This method is prefered in case you don't know beforehand what type of query will be executed, or if you require access to the metadata of the results.

    Type declaration

    queryBindings: (<QueryFormatTypeInner>(query, context?) => Promise<BindingsStream>)

    Query the bindings results of a SELECT query.

    Type declaration

    queryBoolean: (<QueryFormatTypeInner>(query, context?) => Promise<boolean>)

    Query the boolean result of an ASK query.

    Type declaration

    queryQuads: (<QueryFormatTypeInner>(query, context?) => Promise<AsyncIterator<Quad> & ResultStream<Quad>>)

    Query the quad results of a CONSTRUCT or DESCRIBE query.

    Type declaration

    queryVoid: (<QueryFormatTypeInner>(query, context?) => Promise<void>)

    Execute an UPDATE query.

    Type declaration

    resultToString: ((queryResult, mediaType?, context?) => any)

    Convert a query result to a string stream based on a certain media type.

    Type declaration

      • (queryResult, mediaType?, context?): any
      • Parameters

        • queryResult: QueryType

          A query result.

        • Optional mediaType: string

          A media type.

        • Optional context: any

          An optional context.

        Returns any

    Returns

    A text stream.