import type { MediatorExpressionEvaluatorFactory } from '@comunica/bus-expression-evaluator-factory'; import type { IAction, IActorArgs, IActorOutput, IActorTest, Mediate } from '@comunica/core'; import { Actor } from '@comunica/core'; import type { Algebra } from '@comunica/utils-algebra'; import type * as RDF from '@rdfjs/types'; /** * A comunica actor for creating Binding-Aggregator-factories. * * Actor types: * * Input: IActionBindingsAggregatorFactory: A SPARQL expression and a factory for an expression evaluator. * * Test: * * Output: IActorBindingsAggregatorFactoryOutput: An aggregator of RDF bindings. * * @see IActionBindingsAggregatorFactory * @see IActorBindingsAggregatorFactoryOutput */ export declare abstract class ActorBindingsAggregatorFactory extends Actor { protected readonly mediatorExpressionEvaluatorFactory: MediatorExpressionEvaluatorFactory; /** * @param args - * \ @defaultNested { a } bus * \ @defaultNested {Creation of Aggregator failed: none of the configured actors were able to handle ${action.expr.aggregator}} busFailMessage */ protected constructor(args: IActorBindingsAggregatorFactoryArgs); } export interface IActionBindingsAggregatorFactory extends IAction { expr: Algebra.AggregateExpression; } /** * Instances of this interface perform a specific aggregation of bindings. * You can put bindings and when all bindings have been put, request the result. */ export interface IBindingsAggregator { /** * Registers bindings to the aggregator. Each binding you put has the ability to change the aggregation result. * @param bindings the bindings to put. */ putBindings: (bindings: RDF.Bindings) => Promise; /** * Request the result term of aggregating the bindings you have put in the aggregator. */ result: () => Promise; } export interface IActorBindingsAggregatorFactoryOutput extends IActorOutput, IBindingsAggregator { } export interface IActorBindingsAggregatorFactoryArgs extends IActorArgs { mediatorExpressionEvaluatorFactory: MediatorExpressionEvaluatorFactory; } export type MediatorBindingsAggregatorFactory = Mediate;