(resourceGraph, reqUri, stats, filename)
| 113 | } |
| 114 | |
| 115 | function addStats (resourceGraph, reqUri, stats, filename) { |
| 116 | resourceGraph.add( |
| 117 | resourceGraph.sym(reqUri), |
| 118 | ns.stat('mtime'), // Deprecate? |
| 119 | stats.mtime.getTime() / 1000) |
| 120 | |
| 121 | resourceGraph.add( |
| 122 | resourceGraph.sym(reqUri), |
| 123 | ns.dct('modified'), |
| 124 | stats.mtime) // An actual datetime value from a Date object |
| 125 | |
| 126 | resourceGraph.add( |
| 127 | resourceGraph.sym(reqUri), |
| 128 | ns.stat('size'), |
| 129 | stats.size) |
| 130 | |
| 131 | if (!reqUri.endsWith('/') && mime.lookup(filename)) { // Is the file has a well-known type, |
| 132 | const type = 'http://www.w3.org/ns/iana/media-types/' + mime.lookup(filename) + '#Resource' |
| 133 | resourceGraph.add( |
| 134 | resourceGraph.sym(reqUri), |
| 135 | ns.rdf('type'), // convert MIME type to RDF |
| 136 | resourceGraph.sym(type) |
| 137 | ) |
| 138 | } |
| 139 | } |
| 140 | |
| 141 | function readdir (filename) { |
| 142 | debug.handlers('GET -- Reading directory') |
no test coverage detected