A Query Operation actor that handles SPARQL UNION operations, and keeps the term order of its inputs.
It only handles unions that @comunica/actor-optimize-query-operation-annotate-union-order annotated with orderUseful: the variables that the union shares with the other inputs of the join it is in.
Other unions are left to @comunica/actor-query-operation-union, which this actor must be placed before with beforeActors.
When all inputs report a termOrder with a common prefix that starts with one of those variables, the union emits its bindings in that order and reports it, so that a merge join can join it, and forwards seeks to its inputs.
Otherwise, it reads its inputs in turn.
The order is decided on when the metadata is first requested, and dropped if reading started before that.
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.
$ yarn add @comunica/actor-query-operation-union-ordered
After installing, this package can be added to your engine's configuration as follows:
{
"@context": [
...
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-operation-union-ordered/^5.0.0/components/context.jsonld"
],
"actors": [
...
{
"@id": "urn:comunica:default:query-operation/actors#union-ordered",
"@type": "ActorQueryOperationUnionOrdered",
"mediatorQueryOperation": { "@id": "urn:comunica:default:query-operation/mediators#main" },
"mediatorRdfMetadataAccumulate": { "@id": "urn:comunica:default:rdf-metadata-accumulate/mediators#main" },
"beforeActors": { "@id": "urn:comunica:default:query-operation/actors#union" }
}
]
}
mediatorQueryOperation: A mediator over the Query Operation bus.mediatorRdfMetadataAccumulate: A mediator over the RDF Metadata Accumulate bus.