import { CueApi } from './api'; import { AvailableDocumentFilters, DocumentFilterOption, SearchFilter } from './models'; /** * Provides document-filter queries for a single project. * * - **{@link availableFilters}** — discovers which mime / content / entity-category * options exist within the document set that satisfies the currently applied * filters. Uses a 2-tier strategy to avoid cross-product result blowup: * 1. QLever: 3 parallel single-dimension queries via `document-categories` view * 2. Fallback: 3 parallel live triple-pattern queries * - **{@link doLookup}** — returns UUIDs of documents that satisfy a * `SearchFilter[]` expression. * * ### Usage * ```ts * const filter = new CueDocumentFilter(cue.api, projectId); * const opts = await filter.availableFilters(); // full option set * const narrowed = await filter.availableFilters({ // adaptive narrowing * entityCategories: ['https://…/Person'], * }); * const ids = await filter.doLookup([ * { type: 'entity', included: ['https://…/Person'], excluded: [] }, * ]); * ``` */ export declare class CueDocumentFilter { private readonly _api; private readonly _projectId; private readonly _graphType?; constructor(_api: CueApi, _projectId: string, _graphType?: string | undefined); /** * Returns which mime, content and entity-category options are available among * documents that satisfy `applied`. Pass an empty object (or omit) to get * options across the full project. * * Uses a 2-tier strategy — each tier falls through on error or empty result: * 1. QLever: 3 parallel single-dimension queries via `document-categories` view * 2. Fallback: 3 parallel live triple-pattern queries */ availableFilters(applied?: { mimes?: string[]; contents?: string[]; entityCategories?: string[]; entities?: string[]; }): Promise; /** * Lists the *specific* entities (e.g. "John Doe") of a given entity category * (e.g. "Person") that are mentioned by documents satisfying `applied`. * * Each returned option's `iri` is the canonical-entity IRI (suitable for an * `entityInstance` {@link SearchFilter}), and `label` is the entity's * `qcy:value`. Results are narrowed by the currently applied filters so the * list shrinks as other filters are added. */ availableEntities(categoryIri: string, applied?: { mimes?: string[]; contents?: string[]; entityCategories?: string[]; entities?: string[]; }): Promise; /** * Returns UUIDs of documents that satisfy all provided filters. * * Filter semantics: * - Multiple filter objects (different types) → AND between types * - Multiple IRIs in `included` for the same type → OR * - `excluded` IRIs → AND NOT */ doLookup(filters: SearchFilter[]): Promise; /** Single-dimension available-filters query using the dimension-specific views. */ private _buildViewDimQuery; /** Single-dimension available-filters query using live triple patterns. */ private _buildLiveDimQuery; private _buildViewFilterQuery; private _buildFilterQuery; }