@solid-data-modules/rdflib-utils
Version:
Utility functions for the development of Solid Data Modules for RDFLib.js
38 lines (37 loc) • 1.05 kB
TypeScript
import { Fetcher, UpdateManager } from "rdflib";
import { Statement } from "rdflib";
/**
* An empty turtle file that should be created at the given URL
*/
export interface FileToCreate {
/**
* The URL of the file
*/
url: string;
}
/**
* Describes updates that should be applied to a Pod (without applying them yet)
*
* Use {@link executeUpdate} to actually perform the operation.
*/
export interface UpdateOperation {
/**
* RDF statements that should be inserted
*/
insertions: Statement[];
/**
* RDF statements that should be deleted
*/
deletions: Statement[];
/**
* Empty files that should be created
*/
filesToCreate: FileToCreate[];
}
/**
* Applies the described updates to a Pod
* @param fetcher - The fetcher to use for the update
* @param updater - The updater to use for the update
* @param operation - The operations to perform
*/
export declare function executeUpdate(fetcher: Fetcher, updater: UpdateManager, operation: UpdateOperation): Promise<void>;