@solid-data-modules/rdflib-utils
Version:
Utility functions for the development of Solid Data Modules for RDFLib.js
31 lines • 864 B
JavaScript
import { isNamedNode } from "rdflib";
import { solid } from "../namespaces/index.js";
/**
* Used query data from a user's preferences file
*/
export class PreferencesQuery {
constructor(store,
/**
* The WebID of the user
*/
webIdNode,
/**
* The preferences file
*/
preferencesDoc) {
this.store = store;
this.webIdNode = webIdNode;
this.preferencesDoc = preferencesDoc;
}
/**
* Look up the private type index. Returns null if none is found or if the predicated does not link to a proper named node
*/
queryPrivateTypeIndex() {
const node = this.store.any(this.webIdNode, solid("privateTypeIndex"), null, this.preferencesDoc);
if (isNamedNode(node)) {
return node;
}
return null;
}
}
//# sourceMappingURL=PreferencesQuery.js.map