Options
All
  • Public
  • Public/Protected
  • All
Menu

Package bus-query-operation

Comunica Bus Query Operation

npm version

A bus for evaluating SPARQL algebra operations.

This module is part of the Comunica framework, and should only be used by developers that want to build their own query engine.

Click here if you just want to query with Comunica.

Install

$ yarn add @comunica/bus-query-operation

Bus usage

  • Context: "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-query-operation/^1.0.0/components/context.jsonld"
  • Bus name: cbqo:Bus/QueryOperation

Creating actors on this bus

Actors extending ActorQueryOperation or ActorQueryOperationTyped are automatically subscribed to this bus.

It is recommended to extend from ActorQueryOperationTyped if your actor supports a single query operation, as the bus will be able to handle this actor more efficiently. This is not applicable if your actor handles multiple different types of query operations.

Index

References

ActorQueryOperation

Re-exports ActorQueryOperation

ActorQueryOperationTyped

Re-exports ActorQueryOperationTyped

ActorQueryOperationTypedMediated

Re-exports ActorQueryOperationTypedMediated

Bindings

Re-exports Bindings

BindingsStream

Re-exports BindingsStream

IActionQueryOperation

Re-exports IActionQueryOperation

IActorQueryOperationOutput

Re-exports IActorQueryOperationOutput

IActorQueryOperationOutputBase

Re-exports IActorQueryOperationOutputBase

IActorQueryOperationOutputBindings

Re-exports IActorQueryOperationOutputBindings

IActorQueryOperationOutputBoolean

Re-exports IActorQueryOperationOutputBoolean

IActorQueryOperationOutputQuads

Re-exports IActorQueryOperationOutputQuads

IActorQueryOperationOutputStream

Re-exports IActorQueryOperationOutputStream

IActorQueryOperationTypedMediatedArgs

Re-exports IActorQueryOperationTypedMediatedArgs

IExpressionContext

Re-exports IExpressionContext

IPatternBindings

Re-exports IPatternBindings

KEY_CONTEXT_BASEIRI

Re-exports KEY_CONTEXT_BASEIRI

KEY_CONTEXT_BGP_CURRENTMETADATA

Re-exports KEY_CONTEXT_BGP_CURRENTMETADATA

KEY_CONTEXT_BGP_PARENTMETADATA

Re-exports KEY_CONTEXT_BGP_PARENTMETADATA

KEY_CONTEXT_BGP_PATTERNBINDINGS

Re-exports KEY_CONTEXT_BGP_PATTERNBINDINGS

KEY_CONTEXT_PATTERN_PARENTMETADATA

Re-exports KEY_CONTEXT_PATTERN_PARENTMETADATA

KEY_CONTEXT_QUERYOPERATION

Re-exports KEY_CONTEXT_QUERYOPERATION

KEY_CONTEXT_QUERY_TIMESTAMP

Re-exports KEY_CONTEXT_QUERY_TIMESTAMP

ensureBindings

Re-exports ensureBindings

getMetadata

Re-exports getMetadata

isBindings

Re-exports isBindings

materializeOperation

Re-exports materializeOperation

materializeTerm

Re-exports materializeTerm

Type aliases

Bindings

Bindings: Map<string, RDF.Term>

An immutable solution mapping object. This maps variables to a terms.

Variables are represented as strings containing the variable name prefixed with '?'. Blank nodes are represented as strings containing the blank node name prefixed with '_:'. Terms are named nodes, literals or the default graph.

BindingsStream

BindingsStream: AsyncIterator<Bindings>

A stream of bindings.

Next to the list of available variables, an optional metadata hash can be present.

see

Bindings

IActorQueryOperationOutput

Query operation output.

see

IActorQueryOperationOutputBindings, IActorQueryOperationOutputQuads, IActorQueryOperationOutputBoolean

IPatternBindings

IPatternBindings: Record<string, Variable>

Binds a quad pattern term's position to a variable.

Variables

Const KEY_CONTEXT_BASEIRI

KEY_CONTEXT_BASEIRI: "@comunica/actor-init-sparql:baseIRI" = "@comunica/actor-init-sparql:baseIRI"
value

{any} A string.

Const KEY_CONTEXT_BGP_CURRENTMETADATA

KEY_CONTEXT_BGP_CURRENTMETADATA: "@comunica/bus-query-operation:bgpCurrentMetadata" = "@comunica/bus-query-operation:bgpCurrentMetadata"
value

{any} A metadata hash.

Const KEY_CONTEXT_BGP_PARENTMETADATA

KEY_CONTEXT_BGP_PARENTMETADATA: "@comunica/bus-query-operation:bgpParentMetadata" = "@comunica/bus-query-operation:bgpParentMetadata"
value

{any} An array of metadata hashes.

Const KEY_CONTEXT_BGP_PATTERNBINDINGS

KEY_CONTEXT_BGP_PATTERNBINDINGS: "@comunica/bus-query-operation:bgpPatternBindings" = "@comunica/bus-query-operation:bgpPatternBindings"
value

{any} An array of IPatternBindings.

Const KEY_CONTEXT_PATTERN_PARENTMETADATA

KEY_CONTEXT_PATTERN_PARENTMETADATA: "@comunica/bus-query-operation:patternParentMetadata" = "@comunica/bus-query-operation:patternParentMetadata"
value

{any} A metadata hash.

Const KEY_CONTEXT_QUERYOPERATION

KEY_CONTEXT_QUERYOPERATION: "@comunica/bus-query-operation:operation" = "@comunica/bus-query-operation:operation"

Const KEY_CONTEXT_QUERY_TIMESTAMP

KEY_CONTEXT_QUERY_TIMESTAMP: "@comunica/actor-init-sparql:queryTimestamp" = "@comunica/actor-init-sparql:queryTimestamp"
value

{any} a date.

Functions

Bindings

  • Bindings(hash: Record<string, RDF.Term>): Bindings

ensureBindings

  • ensureBindings(maybeBindings: any): Bindings
  • Convert the given object to a bindings object if it is not a bindings object yet. If it already is a bindings object, return the object as-is.

    Parameters

    • maybeBindings: any

      Any object.

    Returns Bindings

    A bindings object.

getMetadata

isBindings

  • isBindings(maybeBindings: any): boolean

materializeOperation

  • materializeOperation(operation: Operation, bindings: Bindings, strictTargetVariables?: boolean): Operation
  • Materialize the given operation (recursively) with the given bindings. Essentially, all variables in the given operation will be replaced by the terms bound to the variables in the given bindings.

    Parameters

    • operation: Operation

      SPARQL algebra operation.

    • bindings: Bindings

      A bindings object.

    • Default value strictTargetVariables: boolean = false

      If target variable bindings (such as on SELECT or BIND) should not be allowed.

    Returns Operation

    Algebra.Operation A new operation materialized with the given bindings.

materializeTerm

  • materializeTerm(term: RDF.Term, bindings: Bindings): RDF.Term
  • Materialize a term with the given binding.

    If the given term is a variable, and that variable exist in the given bindings object, the value of that binding is returned. In all other cases, the term itself is returned.

    Parameters

    • term: RDF.Term

      A term.

    • bindings: Bindings

      A bindings object.

    Returns RDF.Term

    The materialized term.

Generated using TypeDoc