Skip to content

Commit 064b0a7

Browse files
author
deiu
committed
Fixed base for graph
1 parent 1d8d13f commit 064b0a7

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

‎lib/ldp.js‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ LDP.prototype.listContainer = function (filename, uri, containerData, callback)
177177
if (S(file).endsWith(ldp.suffixMeta) || S(file).endsWith(ldp.suffixAcl)) {
178178
return callback();
179179
}
180-
180+
181181
// Get file stats
182182
ldp.stat(container + file, function (err, stats) {
183183
if (err) {
@@ -186,7 +186,7 @@ LDP.prototype.listContainer = function (filename, uri, containerData, callback)
186186
}
187187

188188
var fileSubject = file + (stats.isDirectory() ? '/' : '');
189-
var fileBaseUri = utils.filenameToBaseUri(file, uri, ldp.root);
189+
var fileBaseUri = utils.filenameToBaseUri(fileSubject, uri, ldp.root);
190190

191191
// Add fileStats to resource Graph
192192
addStats(resourceGraph, fileSubject, stats);
@@ -195,14 +195,14 @@ LDP.prototype.listContainer = function (filename, uri, containerData, callback)
195195
resourceGraph.add(
196196
resourceGraph.sym(baseUri),
197197
ns.ldp('contains'),
198-
resourceGraph.sym(file));
198+
resourceGraph.sym(fileSubject));
199199

200200
// Set up a metaFile path
201201
var metaFile = container + file +
202202
(stats.isDirectory() ? '/' : '') +
203203
(S(file).endsWith(turtleExtension) ? '' : ldp.suffixMeta);
204204

205-
getMetadataGraph(metaFile, fileBaseUri, function(err, metadataGraph) {
205+
getMetadataGraph(metaFile, baseUri, function(err, metadataGraph) {
206206
if (err) {
207207
metadataGraph = $rdf.graph();
208208
}
@@ -233,7 +233,7 @@ LDP.prototype.listContainer = function (filename, uri, containerData, callback)
233233
// Add type from metadataGraph
234234
var typeStatements = metadataGraph
235235
.statementsMatching(
236-
metadataGraph.sym(fileBaseUri),
236+
metadataGraph.sym(baseUri),
237237
ns.rdf('type'),
238238
undefined)
239239
.forEach(function (typeStatement) {

0 commit comments

Comments
 (0)