import type * as RDF from '@rdfjs/types'; import type { QuadTermName } from 'rdf-terms'; import type { ITermDictionary } from './dictionary/ITermDictionary'; import type { IRdfStoreIndex } from './index/IRdfStoreIndex'; import type { TermOrder } from './TermOrder'; /** * Options for constructing an RDF store. */ export interface IRdfStoreOptions { /** * The quad component order combinations of indexes that must be created. * For example, creating a store with only an SPOG index requires passing: * [[ 'subject', 'predicate', 'object', 'graph' ]] * For example, creating a store with SPOG and GOPS index requires passing: * [[ 'subject', 'predicate', 'object', 'graph' ], [ 'graph', 'object', 'predicate', 'subject' ]] */ indexCombinations: QuadTermName[][]; /** * Callback for creating an index. * @param options The store options. */ indexConstructor: (options: IRdfStoreOptions) => IRdfStoreIndex; /** * If all nodes should be indexed. * Nodes are all terms that are either a subject or object within the store. * * This can for example be useful for optimizing the Nodes function in SPARQL's property paths: * https://www.w3.org/TR/sparql12-query/#defn_nodeSet */ indexNodes?: true; /** * The dictionary for encoding and decoding RDF terms. */ dictionary: ITermDictionary; /** * The data factory for constructing terms and quads. */ dataFactory: RDF.DataFactory; /** * The order that ordered indexes keep their quads in, as a comparator over terms. * Defaults to {@link defaultTermComparator}. Indexes that are not ordered ignore it. */ termComparator?: (left: RDF.Term, right: RDF.Term) => number; /** * The term order that ordered indexes share. The store creates it from `termComparator`, * so that all of its indexes agree on it. */ termOrder?: TermOrder; }