rdf-stores
Version:
A TypeScript/JavaScript implementation of the RDF/JS store interface with support for quoted triples.
30 lines (29 loc) • 1.29 kB
TypeScript
import type * as RDF from '@rdfjs/types';
import type { ITermDictionary } from './ITermDictionary';
/**
* A term dictionary for quoted triples.
*
* Plain terms and quoted triples are stored in separate dictionaries,
* but quoted triples are encoded using encodings from the plain term dictionary.
*
* Finding quoted triples is done by iterating over all quoted triples, and filtering by the matching ones.
*/
export declare class TermDictionaryQuotedReferential implements ITermDictionary<number> {
static readonly BITMASK: number;
static readonly SEPARATOR = "_";
private readonly plainTermDictionary;
private readonly quotedTriplesDictionary;
private readonly quotedTriplesReverseDictionary;
private readonly dataFactory;
readonly features: {
quotedTriples: boolean;
};
constructor(plainTermDictionary: ITermDictionary<number>, dataFactory?: RDF.DataFactory);
encode(term: RDF.Term): number;
private encodeQuotedTriple;
encodeOptional(term: RDF.Term): number | undefined;
decode(encoding: number): RDF.Term;
encodings(): IterableIterator<number>;
findQuotedTriples(quotedTriplePattern: RDF.Quad): IterableIterator<RDF.Term>;
findQuotedTriplesEncoded(quotedTriplePattern: RDF.Quad): IterableIterator<number>;
}