Skip to content

Commit a33587d

Browse files
committed
Allow datasources to be hidden from the index
1 parent 13acfab commit a33587d

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

config/config-composite.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,21 @@
1111
}
1212
},
1313
"hdt": {
14+
"hide": true,
1415
"title": "HDT",
1516
"type": "HdtDatasource",
1617
"description": "A test HDT datasource",
1718
"settings": { "file": "test/assets/test.hdt" }
1819
},
1920
"ttl": {
21+
"hide": true,
2022
"title": "Turtle",
2123
"type": "TurtleDatasource",
2224
"description": "A test turtle datasource",
2325
"settings": { "file": "test/assets/test.ttl" }
2426
},
2527
"jsonld": {
28+
"hide": true,
2629
"title": "JSONLD",
2730
"type": "JsonLdDatasource",
2831
"description": "A test jsonld datasource",

lib/datasources/IndexDatasource.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,12 @@ MemoryDatasource.extend(IndexDatasource);
2222
IndexDatasource.prototype._getAllTriples = function (addTriple, done) {
2323
for (var name in this._datasources) {
2424
var datasource = this._datasources[name], datasourceUrl = datasource.url;
25-
triple(datasourceUrl, rdf + 'type', voID + 'Dataset');
26-
triple(datasourceUrl, rdfs + 'label', datasource.title, true);
27-
triple(datasourceUrl, dc + 'title', datasource.title, true);
28-
triple(datasourceUrl, dc + 'description', datasource.description, true);
25+
if (!datasource.hide) {
26+
triple(datasourceUrl, rdf + 'type', voID + 'Dataset');
27+
triple(datasourceUrl, rdfs + 'label', datasource.title, true);
28+
triple(datasourceUrl, dc + 'title', datasource.title, true);
29+
triple(datasourceUrl, dc + 'description', datasource.description, true);
30+
}
2931
}
3032
function triple(subject, predicate, object, isLiteral) {
3133
if (subject && predicate && object)

lib/views/triplepatternfragments/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ <h2>Available datasets</h2>
1414
<dl class="datasets">
1515
<% for (var datasourceName in datasources) {
1616
var datasource = datasources[datasourceName];
17-
if (datasource.role === 'index') continue; %>
17+
if (datasource.role === 'index' || datasource.hide) continue; %>
1818
<dt><a href="<%= datasource.url.replace(/#.*/, '') %>"><%= datasource.title %></a></dt>
1919
<dd><%= datasource.description || ' ' %></dd>
2020
<% } %>

0 commit comments

Comments
 (0)