Browse content of a folder/container

Hi,

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?

Thanks in advance!

Regards
Simon

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
 );
3 Likes

that was fast - thank you!
works perfectly!