UNPKG

@solid-data-modules/rdflib-utils

Version:

Utility functions for the development of Solid Data Modules for RDFLib.js

34 lines (33 loc) 1.31 kB
import { NamedNode, Node } from "rdflib"; import { ModuleConfig, TypeRegistrationsByVisibility } from "../index.js"; /** * Provides common functionality useful for many rdflib-based data modules */ export declare class ModuleSupport { private readonly fetcher; private readonly store; private readonly updater; constructor(config: ModuleConfig); /** * Nullsafe fetching of a node * @param node - A node to fetch, or null to do nothing at all */ fetchNode(node: Node | null): Promise<void>; /** * Fetch all the given nodes in parallel * @param nodes */ fetchAll(nodes: (Node | null)[]): Promise<void[]>; /** * Discover storage locations (instances or instance containers) for a given type by fetching and querying private and public type indexes * @param webId - The WebID to search for type indexes * @param typeNode - a NamedNode representing the type to discover */ discoverType(webId: NamedNode, typeNode: NamedNode): Promise<TypeRegistrationsByVisibility>; /** * Checks whether the resource identified by the given URL is a LDP container * @param storageUrl - The URL to check * @returns true if it is a container, false otherwise */ isContainer(storageUrl: string): Promise<boolean>; }