import type { IActionQueryOperation } from '@comunica/bus-query-operation'; import { ActorQueryOperationTyped } from '@comunica/bus-query-operation'; import type { MediatorRdfResolveQuadPattern } from '@comunica/bus-rdf-resolve-quad-pattern'; import type { IActorArgs, IActorTest } from '@comunica/core'; import type { IQueryOperationResult, IActionContext, MetadataBindings, MetadataQuads, TermsOrder } from '@comunica/types'; import type * as RDF from '@rdfjs/types'; import type { AsyncIterator } from 'asynciterator'; import type { QuadTermName } from 'rdf-terms'; import type { Algebra } from 'sparqlalgebrajs'; /** * A comunica actor for handling 'quadpattern' query operations. */ export declare class ActorQueryOperationQuadpattern extends ActorQueryOperationTyped implements IActorQueryOperationQuadpatternArgs { readonly mediatorResolveQuadPattern: MediatorRdfResolveQuadPattern; readonly unionDefaultGraph: boolean; constructor(args: IActorQueryOperationQuadpatternArgs); /** * Check if a term is a variable. * @param {RDF.Term} term An RDF term. * @return {any} If the term is a variable or blank node. */ static isTermVariable(term: RDF.Term): term is RDF.Variable; /** * Get all variables in the given pattern. * No duplicates are returned. * @param {RDF.BaseQuad} pattern A quad pattern. */ static getVariables(pattern: RDF.BaseQuad): RDF.Variable[]; /** * A helper function to find a hash with quad elements that have duplicate variables. * * @param {RDF.Quad} pattern A quad pattern. * * @return {{[p: string]: string[]}} If no equal variable names are present in the four terms, this returns undefined. * Otherwise, this maps quad elements paths (['subject'], ['predicate'], ['object'], * ['graph']) * to the list of quad elements it shares a variable name with. * For quoted triples, paths such as ['subject', 'object'] may occur. * If no links for a certain element exist, this element will * not be included in the hash. * Note 1: Quad elements will never have a link to themselves. * So this can never occur: { subject: [[ 'subject']] }, * instead 'null' would be returned. * Note 2: Links only exist in one direction, * this means that { subject: [[ 'predicate']], predicate: [[ 'subject' ]] } * will not occur, instead only { subject: [[ 'predicate']] } * will be returned. * Note 3: Keys can also be paths, but they are delimited by '_', such as: * { subject_object_subject: [[ 'predicate']] } */ static getDuplicateElementLinks(pattern: RDF.BaseQuad): Record | undefined; /** * Ensure that the given raw metadata object contains all required metadata entries. * @param metadataRaw A raw metadata object. */ static validateMetadata(metadataRaw: Record): MetadataQuads; /** * Get the metadata of the given action on a quad stream. * * @param {AsyncIterator} data The data stream that is guaranteed to emit the metadata property. * @param elementVariables Mapping of quad term name to variable name. * @param variables Variables to include in the metadata * @return {() => Promise<{[p: string]: any}>} A lazy promise behind a callback resolving to a metadata object. */ protected static getMetadata(data: AsyncIterator, elementVariables: Record, variables: RDF.Variable[]): () => Promise; protected static quadsMetadataToBindingsMetadata(metadataQuads: MetadataQuads, elementVariables: Record, variables: RDF.Variable[]): MetadataBindings; protected static quadsOrderToBindingsOrder(quadsOrder: TermsOrder, elementVariables: Record): TermsOrder; testOperation(operation: Algebra.Pattern, context: IActionContext): Promise; runOperation(pattern: Algebra.Pattern, context: IActionContext): Promise; } export interface IActorQueryOperationQuadpatternArgs extends IActorArgs { /** * The quad pattern resolve mediator */ mediatorResolveQuadPattern: MediatorRdfResolveQuadPattern; /** * If the default graph should also contain the union of all named graphs. * This can be overridden by {@link KeysQueryOperation#unionDefaultGraph}. * @default {false} */ unionDefaultGraph: boolean; }