I’m working on a server side app and I want to open/load a folder/container and show it’s contents.
I’m trying to do this with the rdflib.js (https://github.com/linkeddata/rdflib.js)
How could this be achieved?
You can either use solid-file-client’s readFolder() method which returns an array of file objects including name, size, etc… Or, directly with rdflib, this will put the folder’s contents into an array of file names and then you’d have to iterate over to it get each file’s details.
let store = $rdf.graph();
// ... fetch the folder
let folderItems = store.each(
$rdf.sym( folderAddress ),
$rdf.sym('http://www.w3.org/ns/ldp#contains'),
null
);