import { InMemoryStore } from 'lincd-storage/shapes/InMemoryStore'; import { Graph, NamedNode, Node, Quad } from 'lincd/models'; import { Shape } from 'lincd/shapes/Shape'; import { QuadArray } from 'lincd/collections/QuadArray'; import { QuadSet } from 'lincd/collections/QuadSet'; import { CoreMap } from 'lincd/collections/CoreMap'; import { IQuadStore } from 'lincd/interfaces/IQuadStore'; import { ICoreIterable } from 'lincd/interfaces/ICoreIterable'; import { ShapeSet } from 'lincd/collections/ShapeSet'; import { NodeSet } from 'lincd/collections/NodeSet'; import { SelectQuery } from 'lincd/queries/SelectQuery'; import { UpdateQuery } from 'lincd/queries/UpdateQuery'; import { CreateQuery } from 'lincd/queries/CreateQuery'; import { DeleteQuery, DeleteResponse } from 'lincd/queries/DeleteQuery'; interface StoreConfig { shapes: (typeof Shape | '*')[]; storeLabel: (item: any) => string | NamedNode | Shape; } interface MultiQuadStoreConfig { backups?: boolean; /** * Determine which stores get loaded by filtering the paths of the files in the folder * This method is automatically run once per day unless loadInterval is defined * @param storePath */ load?: (storePath: string) => boolean; loadDir?: (dirPath: string) => boolean; stores: StoreConfig[]; } export declare class MultiQuadStore extends Shape implements IQuadStore { private config; protected stores: CoreMap; private backupTask; private initPromise; private catchAllStore; constructor(nodeOrLabel: any, config: MultiQuadStoreConfig); get backupFolder(): string; reload(): Promise; cleanBackups(): Promise; private loadStream; backup(): Promise; get folderPath(): string; addStoreByLabel(label: any, type?: any): any; getTargetShapes(): (typeof Shape | "*")[]; getStores(): CoreMap; init(): Promise; protected _init(loadAll?: boolean): Promise; getStoreLabels(getAll?: boolean): Promise; update(toAdd: ICoreIterable, toRemove: ICoreIterable): Promise; add(quad: Quad): Promise; delete(quad: Quad): Promise; /** * Determines the right URI for several nodes * The URI's are determined by the store, and the store returns a mapping of current URI's to new URI's * Stores that implement this method should note that the URI's of the nodes used as keys may not be the same as the URI's * of the nodes in the environment that requested the URI change. Hence, a map is provided. The node (the key) can be used to access properties, whilst the currentUri (the value of the map) should be returned in the resulting [currentUri,newUri] array * @param nodeToCurrentUriMap */ setURIs(nodeToCurrentUriMap: CoreMap): Promise<[string, string][]>; getDefaultGraph?(): Graph; removeNodes(nodes: ICoreIterable, quads: QuadSet): Promise; loadShape(shapeInstance: Shape, shape: any): Promise; loadShapes(shapeSet: ShapeSet, shape: any): Promise; rawQuery(query: string): Promise; selectQuery(query: SelectQuery): Promise; updateQuery(q: UpdateQuery): Promise; createQuery(q: CreateQuery): Promise; deleteQuery(query: DeleteQuery): Promise; /** * Clears all values of specific predicates for specific subjects * @param subjectToPredicates a map of subjects as keys and sets of properties (predicates) to clear as the values * @return A promise that resolves to true if properties were cleared, or false if no properties were cleared */ clearProperties(subjectToPredicates: CoreMap>): Promise; protected getStoreByLabel(label: string): InMemoryStore; protected groupQuadsBySubjects(quads: QuadArray | QuadSet): CoreMap; addMultiple(quads: QuadSet): Promise; deleteMultiple(quads: QuadSet): Promise; protected forward(quads: QuadArray | QuadSet, method: 'addMultiple' | 'deleteMultiple'): Promise; protected getStoreForSubject(subject: NamedNode, allowRetry?: boolean): InMemoryStore; labelToStore(storeLabel: string | NamedNode | Shape): InMemoryStore; /** * Load all stores into memory, regardless of configuration */ loadAllStores(): Promise; static updateStores(config: { key: string; update?: (contents: QuadSet) => { contents: QuadSet; updated: boolean; }; }[]): Promise; static updatePropertyValue(contents: QuadSet, shapeType: typeof Shape | (typeof Shape)[], property: NamedNode, update: (oldValue: string, instance: T, quads: QuadSet) => Node): { contents: QuadSet; updated: boolean; }; static removeSubjectWhere(contents: QuadSet, filterSubjects: (subject: NamedNode, quads: QuadSet) => boolean): { contents: QuadSet; updated: boolean; }; static removeInstanceWhere(contents: QuadSet, shapeType: typeof Shape | (typeof Shape)[], filterSubjects: (instance: T, quads: QuadSet) => boolean): { contents: QuadSet; updated: boolean; }; static getQuadsGroupedBySubject(contents: QuadSet): CoreMap; static getInstanceQuads(contents: QuadSet, shapeType: typeof Shape | (typeof Shape)[]): CoreMap; } export {};