A Comunica SPARQL query engine.

Hierarchy

  • QueryEngineBase<
        IQueryContextCommon,
        Omit<QueryStringContext, "sources"> & { sources?: SourceType[] },
        Omit<QueryAlgebraContext, "sources"> & { sources?: SourceType[] },
    >
    • QueryEngine

Constructors

Methods

  • Explain the given query

    Type Parameters

    • QueryFormatTypeInner extends QueryFormatType

    Parameters

    • query: QueryFormatTypeInner

      A query string or algebra.

    • context: QueryFormatTypeInner extends string
          ? Omit<QueryStringContext, "sources"> & {
              sources?: QuerySourceUnidentified[];
          }
          : Omit<QueryAlgebraContext, "sources"> & {
              sources?: QuerySourceUnidentified[];
          }

      An optional query context.

    • explainMode: QueryExplainMode

      The explain mode.

    Returns Promise<IQueryExplained>

    A promise that resolves to the query output or explanation.

  • Parameters

    • Optionalcontext: any

      An optional context.

    Returns Promise<Record<string, string>>

    All available SPARQL result media type formats.

  • Parameters

    • Optionalcontext: any

      An optional context.

    Returns Promise<Record<string, number>>

    All available SPARQL (weighted) result media types.

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

    Parameters

    • Optionalurl: string

      The page URL to invalidate.

    • Optionalcontext: any

      An optional ActionContext to pass to the actors.

    Returns Promise<any>

    A promise resolving when the caches have been invalidated.

  • Evaluate the given query

    Type Parameters

    • QueryFormatTypeInner extends QueryFormatType

    Parameters

    • query: QueryFormatTypeInner

      A query string or algebra.

    • Optionalcontext: QueryFormatTypeInner extends string
          ? Omit<QueryStringContext, "sources"> & {
              sources?: QuerySourceUnidentified[];
          }
          : Omit<QueryAlgebraContext, "sources"> & {
              sources?: QuerySourceUnidentified[];
          }

      An optional query context.

    Returns Promise<QueryType>

    A promise that resolves to the query output.

  • Query the bindings results of a SELECT query.

    Type Parameters

    • QueryFormatTypeInner extends QueryFormatType

    Parameters

    • query: QueryFormatTypeInner

      A query string or algebra object. Algebra objects must not contain blank nodes. They should be converted to variables.

    • Optionalcontext: QueryFormatTypeInner extends string
          ? Omit<QueryStringContext, "sources"> & {
              sources?: QuerySourceUnidentified[];
          }
          : Omit<QueryAlgebraContext, "sources"> & {
              sources?: QuerySourceUnidentified[];
          }

      A context.

    Returns Promise<BindingsStream>

  • Query the boolean result of an ASK query.

    Type Parameters

    • QueryFormatTypeInner extends QueryFormatType

    Parameters

    • query: QueryFormatTypeInner

      A query string or algebra object. Algebra objects must not contain blank nodes. They should be converted to variables.

    • Optionalcontext: QueryFormatTypeInner extends string
          ? Omit<QueryStringContext, "sources"> & {
              sources?: QuerySourceUnidentified[];
          }
          : Omit<QueryAlgebraContext, "sources"> & {
              sources?: QuerySourceUnidentified[];
          }

      A context.

    Returns Promise<boolean>

  • Type Parameters

    • QueryFormatTypeInner extends QueryFormatType
    • QueryTypeOut extends QueryEnhanced

    Parameters

    • query: QueryFormatTypeInner
    • context:
          | undefined
          | (
              QueryFormatTypeInner extends string
                  ? Omit<QueryStringContext, "sources"> & {
                      sources?: QuerySourceUnidentified[];
                  }
                  : Omit<QueryAlgebraContext, "sources"> & {
                      sources?: QuerySourceUnidentified[];
                  }
          )
    • expectedType: QueryTypeOut["resultType"]

    Returns Promise<ReturnType<QueryTypeOut["execute"]>>

  • Evaluate or explain the given query

    Type Parameters

    • QueryFormatTypeInner extends QueryFormatType

    Parameters

    • query: QueryFormatTypeInner

      A query string or algebra.

    • Optionalcontext: QueryFormatTypeInner extends string
          ? Omit<QueryStringContext, "sources"> & {
              sources?: QuerySourceUnidentified[];
          }
          : Omit<QueryAlgebraContext, "sources"> & {
              sources?: QuerySourceUnidentified[];
          }

      An optional query context.

    Returns Promise<QueryType | IQueryExplained>

    A promise that resolves to the query output or explanation.

  • Query the quad results of a CONSTRUCT or DESCRIBE query.

    Type Parameters

    • QueryFormatTypeInner extends QueryFormatType

    Parameters

    • query: QueryFormatTypeInner

      A query string or algebra object. Algebra objects must not contain blank nodes. They should be converted to variables.

    • Optionalcontext: QueryFormatTypeInner extends string
          ? Omit<QueryStringContext, "sources"> & {
              sources?: QuerySourceUnidentified[];
          }
          : Omit<QueryAlgebraContext, "sources"> & {
              sources?: QuerySourceUnidentified[];
          }

      A context.

    Returns Promise<AsyncIterator<Quad> & ResultStream<Quad>>

  • Execute an UPDATE query.

    Type Parameters

    • QueryFormatTypeInner extends QueryFormatType

    Parameters

    • query: QueryFormatTypeInner

      A query string or algebra object. Algebra objects must not contain blank nodes. They should be converted to variables.

    • Optionalcontext: QueryFormatTypeInner extends string
          ? Omit<QueryStringContext, "sources"> & {
              sources?: QuerySourceUnidentified[];
          }
          : Omit<QueryAlgebraContext, "sources"> & {
              sources?: QuerySourceUnidentified[];
          }

      A context.

    Returns Promise<void>

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

    Parameters

    • queryResult: Query<any>

      A query result.

    • OptionalmediaType: string

      A media type.

    • Optionalcontext: any

      An optional context.

    Returns Promise<IActorQueryResultSerializeOutput>

    A text stream.

  • Convert a final query result to an internal one.

    Parameters

    • finalResult: Query<any>

      A final query result.

    Returns Promise<IQueryOperationResult>

  • Convert an internal query result to a final one.

    Parameters

    • internalResult: IQueryOperationResult

      An intermediary query result.

    Returns QueryType