MCPcopy Index your code
hub / github.com/nodeSolidServer/node-solid-server / addContainerStats

Function addContainerStats

lib/ldp-container.mjs:12–31  ·  view source on GitHub ↗
(ldp, reqUri, filename, resourceGraph)

Source from the content-addressed store, hash-verified

10export { addContainerStats, addFile, addStats, readdir }
11
12async function addContainerStats (ldp, reqUri, filename, resourceGraph) {
13 const containerStats = await ldp.stat(filename)
14 addStats(resourceGraph, reqUri, containerStats, filename)
15 const storage = new URL(reqUri)
16 if (reqUri === storage.origin + '/') {
17 resourceGraph.add(
18 resourceGraph.sym(reqUri),
19 ns.rdf('type'),
20 ns.space('Storage')
21 )
22 }
23 resourceGraph.add(
24 resourceGraph.sym(reqUri),
25 ns.rdf('type'),
26 ns.ldp('BasicContainer'))
27 resourceGraph.add(
28 resourceGraph.sym(reqUri),
29 ns.rdf('type'),
30 ns.ldp('Container'))
31}
32
33async function addFile (ldp, resourceGraph, containerUri, reqUri, container, file) {
34 // Skip .meta and .acl

Callers

nothing calls this directly

Calls 2

addStatsFunction · 0.85
statMethod · 0.80

Tested by

no test coverage detected