import { QuadSet } from '../collections/QuadSet.js'; import { Graph, NamedNode, Quad } from '../models.js'; import { NodeSet } from '../collections/NodeSet.js'; import { ICoreIterable } from './ICoreIterable.js'; import { Shape } from '../shapes/Shape.js'; import { CoreMap } from '../collections/CoreMap.js'; import { SelectQuery } from '../queries/SelectQuery.js'; import { LinkedDataRequest } from '../utils/TraceShape.js'; import { QuadArray } from '../collections/QuadArray.js'; import { ShapeSet } from '../collections/ShapeSet.js'; import { UpdateQuery } from '../queries/UpdateQuery.js'; import { CreateQuery } from '../queries/CreateQuery.js'; import { DeleteQuery, DeleteResponse } from '../queries/DeleteQuery.js'; export interface IQuadStore { /** * Prepares the store to be used. */ init?(): Promise; updateQuery?(q: UpdateQuery): Promise; createQuery?(q: CreateQuery): Promise; selectQuery(query: SelectQuery): Promise; deleteQuery?(query: DeleteQuery): Promise; update?(toAdd: ICoreIterable, toRemove: ICoreIterable): Promise; add?(quad: Quad): Promise; addMultiple?(quads: QuadSet): Promise; delete?(quad: Quad): Promise; deleteMultiple?(quads: QuadSet): 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; /** * 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; /** * @deprecated * @param shapeInstance * @param shape */ loadShape?(shapeInstance: Shape, shape: LinkedDataRequest): Promise; /** * @deprecated * @param shapeSet * @param shape */ loadShapes?(shapeSet: ShapeSet, shape: LinkedDataRequest): Promise; }