/** * LDP Executor Implementation * * 负责 LDP 模式下的写操作 (N3 Patch),剥离自 PodDialect */ import type { PodTable } from '../schema'; import type { ComunicaSPARQLExecutor } from '../sparql-executor'; import type { UriResolver } from '../uri'; export declare class LdpExecutor { private sparqlExecutor; private fetchFn; private tripleBuilder; private uriResolver; constructor(sparqlExecutor: ComunicaSPARQLExecutor, fetchFn: typeof fetch, uriResolver: UriResolver); /** * 设置表注册表(用于 URI 引用自动补全) * @param classRegistry rdfClass -> tables[] 的映射 * @param nameRegistry tableName -> table 的映射 */ setTableRegistry(classRegistry: Map, nameRegistry: Map): void; /** * 设置基础 URI */ setBaseUri(uri: string): void; /** * 执行 INSERT 操作 */ executeInsert(rows: any[], table: PodTable, resourceUrl: string, options?: { ensureContainerExists?: (containerUrl: string) => Promise; repairContainerOnWriteFailure?: (containerUrl: string) => Promise; skipResourceExistenceCheck?: boolean; tableRegistry?: Map; tableNameRegistry?: Map; }): Promise; private repairContainerAndRetryPutIfNeeded; private isMissingParentContainerResponse; /** * 执行 UPDATE 操作 */ executeUpdate(table: PodTable, data: Record, subjects: string[], resourceUrl: string): Promise; /** * 执行 DELETE 操作 */ executeDelete(subjects: string[], table: PodTable, resourceUrl: string): Promise; /** * Execute a function with exponential backoff retry on server errors */ private retryWithBackoff; /** * Build error from failed response */ private buildPatchError; private buildUpdatePatchPayload; /** * 执行更新操作 * * 优先尝试 SPARQL UPDATE (application/sparql-update), * xpod 内部使用 SPARQL,标准 CSS 也支持。 * 如果失败,回退到 N3 Patch。 */ private executeN3Patch; /** * 构建 SPARQL UPDATE 查询 */ private buildSparqlUpdate; /** * 内部 N3 Patch 实现(作为 SPARQL UPDATE 的回退) */ private executeN3PatchInternal; private formatTerm; private fetchRecursiveTriplesToDelete; private fetchExistingObjects; private fetchInverseSubjects; } //# sourceMappingURL=ldp-executor.d.ts.map