Skip to content

Commit dbcfa8c

Browse files
author
Andrei
committed
Merge pull request nodeSolidServer#78 from martinmr/root-container
Container fixes.
2 parents 2cc0ec2 + 7106749 commit dbcfa8c

5 files changed

Lines changed: 2 additions & 60 deletions

File tree

container.js

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -18,48 +18,6 @@ var addUriTriple = function(kb, s, o, p) {
1818

1919
var turtleExtension = ".ttl";
2020

21-
function createRootContainer(fileBase, baseUrl) {
22-
if (metadata.hasContainerMetadata(fileBase)) {
23-
return;
24-
}
25-
26-
var rootContainer = $rdf.graph();
27-
addUriTriple(
28-
rootContainer,
29-
baseUrl,
30-
rdfVocab.type,
31-
ldpVocab.Container);
32-
addUriTriple(
33-
rootContainer,
34-
baseUrl,
35-
rdfVocab.type,
36-
ldpVocab.BasicContainer);
37-
38-
rootContainer.add(
39-
rootContainer.sym(baseUrl),
40-
rootContainer.sym('http://purl.org/dc/terms/title'),
41-
'"Root Container"');
42-
43-
var serializedContainer = $rdf.serialize(
44-
undefined,
45-
rootContainer,
46-
baseUrl,
47-
'text/turtle');
48-
49-
metadata.writeContainerMetadata(
50-
fileBase,
51-
serializedContainer,
52-
function(err) {
53-
if (err) {
54-
//TODO handle error
55-
debug("Could not write root container");
56-
} else {
57-
debug("Wrote root container to " + fileBase);
58-
}
59-
});
60-
61-
}
62-
6321
function createResourceUri(usedURIs, containerURI, slug, isBasicContainer) {
6422
var newPath;
6523
if (slug) {
@@ -157,7 +115,6 @@ function createNewContainer(usedURIs, uri, containerPath, containerGraph, callba
157115
}
158116
}
159117

160-
exports.createRootContainer = createRootContainer;
161118
exports.createResourceUri = createResourceUri;
162119
exports.releaseResourceUri = releaseResourceUri;
163120
exports.createNewResource = createNewResource;

handlers/get.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,9 @@ function get(req, res, includeBody) {
111111

112112
function containerHandler(err, rawContainer) {
113113
if (err) {
114-
debug("GET/HEAD -- Not a valid container");
115-
return res.status(404)
116-
.send("Not a container");
114+
rawContainer = "";
117115
}
118-
116+
119117
// Parse the container
120118
parseContainer(rawContainer);
121119
}

index.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,6 @@ function ldnode (argv) {
4747
resave: false
4848
}));
4949

50-
// Creating root container
51-
container.createRootContainer(opts.root, opts.mount);
52-
5350
// Setting up routes
5451
app.use('/', routes());
5552

test/.container

Lines changed: 0 additions & 5 deletions
This file was deleted.

test/.meta

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)