An actor that sorts join entries based on Hartig's heuristic for plan selection in link traversal environments.

It first determines isolated connected graphs. (done by @comunica/actor-optimize-query-operation-join-connected) For each of the connected graphs, it orders triple patterns in BGPs by the following priority:

  1. dependency-respecting: for each (non-first) pattern, at least one variable must occur in a preceding pattern.
  2. seed: try to make the first pattern contain a source URI.
  3. no vocab seed: avoid first triple pattern with vocab URI (variable predicate, or variable objects with rdf:type predicate)
  4. filtering: patterns only containing variables also contained in preceding triple patterns are placed as soon as possible.

It does this in an adaptive way. This means that this actor will only determine the first triple pattern, execute it, and materialize the remaining BGP based on its results. After that, the remaining BGP is evaluated recursively by this or another BGP actor.

Hierarchy

  • ActorRdfJoinEntriesSort
    • ActorRdfJoinEntriesSortTraversalZeroKnowledge

Constructors

Properties

beforeActors: Actor<
    IActionRdfJoinEntriesSort,
    IActorTest,
    IActorRdfJoinEntriesSortOutput,
>[]

Actor that must be registered in the bus before this actor.

bus: Bus<
    Actor<
        IActionRdfJoinEntriesSort,
        IActorTest,
        IActorRdfJoinEntriesSortOutput,
    >,
    IActionRdfJoinEntriesSort,
    IActorTest,
    IActorRdfJoinEntriesSortOutput,
>

The bus this actor subscribes to.

name: string

The name for this actor.

{<rdf:subject>}

Methods

  • Parameters

    • context: IActionContext
    • Optionaldata: () => any

    Returns any

  • Parameters

    • context: IActionContext
    • message: string
    • Optionaldata: () => any

    Returns void

  • Parameters

    • context: IActionContext
    • message: string
    • Optionaldata: () => any

    Returns void

  • Parameters

    • context: IActionContext
    • message: string
    • Optionaldata: () => any

    Returns void

  • Parameters

    • context: IActionContext
    • message: string
    • Optionaldata: () => any

    Returns void

  • Parameters

    • context: IActionContext
    • message: string
    • Optionaldata: () => any

    Returns void

  • Parameters

    • context: IActionContext
    • message: string
    • Optionaldata: () => any

    Returns void

  • Run the given action on this actor AND invokes the Bus#onRun method.

    Parameters

    • action: IActionRdfJoinEntriesSort

      The action to run.

    • sideData: undefined

    Returns Promise<IActorRdfJoinEntriesSortOutput>

    A promise that resolves to the run result.

  • Get the logger from the given context.

    Parameters

    • context: IActionContext

      An optional context.

    Returns undefined | Logger

    The logger or undefined.

  • This sorts join entries by first prioritizing triple patterns in BGPs, and then all other operation types.

    Sort the patterns in BGPs by the following priorities:

    1. A source in S or O (not O if rdf:type) (seed rule, no vocab rule)
    2. Most selective: fewest variables (filtering rule, dependency-respecting rule)

    Parameters

    • entries: IJoinEntryWithMetadata[]

      Quad patterns.

    • sources: string[]

      The sources that are currently being queried.

    Returns IJoinEntryWithMetadata[]