/** * Term serialization utilities * * - Subject, Predicate, Graph: use n3's termToId/termFromId * - Object: use fpstring encoding for numeric literals (sortable) */ import type { Quad } from '@rdfjs/types'; export declare const termToId: (term: any) => string; export declare const termFromId: (id: string) => any; export declare const NUMERIC_TYPES: Set; export declare const DATETIME_TYPE = "http://www.w3.org/2001/XMLSchema#dateTime"; /** * Encode a number to a sortable string (fpstring format) * String comparison of encoded values preserves numeric ordering */ export declare function fpEncode(stringOrNumber: string | number): string; export declare const LEGACY_SEP = "\0"; export declare const SEP = "\u001F"; export declare function isSerializedNumericLiteral(str: string): boolean; export declare function isSerializedDateTimeLiteral(str: string): boolean; export declare function isSerializedObjectValue(str: string): boolean; /** * Serialize object term with fpstring encoding for numeric literals * * Format for numeric literals: * N * * Format for dateTime: * D * * Other terms use n3 format */ export declare function serializeObject(term: any): string; /** * Deserialize object from storage format */ export declare function deserializeObject(str: string): any; /** * Serialize a Quad to row data for database storage */ export declare function quadToRow(quad: Quad, vector?: number[]): { graph: string; subject: string; predicate: string; object: string; vector: string | null; }; /** * Deserialize row data to Quad */ export declare function rowToQuad(row: { graph: string; subject: string; predicate: string; object: string; }): Quad; /** * Parse vector from JSON string */ export declare function parseVector(vectorStr: string | null): number[] | undefined;