Skip to content

Commit 1a51dd2

Browse files
committed
Make datasource capitalization consistent.
1 parent d5bfc7a commit 1a51dd2

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

bin/generate-summary

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,11 @@ function generate(datasourceName) {
7777
}
7878
}
7979

80-
function fromDataSource(uri, dataSource, callback, end, chunksize) {
80+
function fromDataSource(uri, datasource, callback, end, chunksize) {
8181
var hrstart = process.hrtime();
8282

8383
var capabilities = Object.create(null),
84-
supportsQuery = dataSource.supportsQuery({
84+
supportsQuery = datasource.supportsQuery({
8585
features: {
8686
limit: true,
8787
offset: true
@@ -92,7 +92,7 @@ function fromDataSource(uri, dataSource, callback, end, chunksize) {
9292
processSet(chunksize || 100000);
9393
} else {
9494
// Process dataset at once
95-
dataSource.select({}, function (err) {
95+
datasource.select({}, function (err) {
9696
console.error('Error occured', err);
9797
})
9898
.on('data', extractSummary)
@@ -104,7 +104,7 @@ function fromDataSource(uri, dataSource, callback, end, chunksize) {
104104
offset = offset || 0;
105105
var count = 0;
106106

107-
var stream = dataSource.select({
107+
var stream = datasource.select({
108108
limit: limit,
109109
offset: offset
110110
}, function (err) {

lib/controllers/TimegateController.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function TimegateController(options) {
2727
timemap: sortTimemap(_.map(_.pick(options.datasources, mementos.versions),
2828
function (datasource, key) {
2929
return _.assign(datasource.memento, {
30-
dataSource: key,
30+
datasource: key,
3131
interval: (datasource.memento.interval || [0, 0]).map(toDate),
3232
});
3333
}))
@@ -52,7 +52,7 @@ TimegateController.prototype._handleRequest = function (request, response, next)
5252
memento = this._getClosestMemento(timemapDetails.timemap, acceptDatetime);
5353
if (memento) {
5454
// Determine the URL of the memento
55-
var mementoUrl = _.assign(request.parsedUrl, { pathname: memento.dataSource });
55+
var mementoUrl = _.assign(request.parsedUrl, { pathname: memento.datasource });
5656
mementoUrl = url.format(mementoUrl);
5757

5858
// Determine the URL of the original resource
@@ -78,17 +78,17 @@ TimegateController.prototype._handleRequest = function (request, response, next)
7878
};
7979

8080
/*
81-
* @param timemap: [{"dataSource": "data source name", "interval": [start, end]}, ...]
81+
* @param timemap: [{"datasource": "data source name", "interval": [start, end]}, ...]
8282
the start, end values can either be Date objects, or ISO 8601 string.
8383
* @param accept_datetime: the requested datetime value as Date object, or ISO 8601 string.
8484
* @param sorted: bool. If not sorted, the timemap will be sorted using the start time in the interval.
8585
8686
* eg:
8787
var timemap = [
88-
{"dataSource": "dbpedia_2012", "interval": ["2011-10-20T12:22:24Z", new Date("2012-10-19T12:22:24Z")]},
89-
{"dataSource": "dbpedia_2015", "interval": ["2014-10-20T12:22:24Z", ""]},
90-
{"dataSource": "dbpedia_2013", "interval": [new Date("2012-10-20T12:22:24Z"), new Date("2013-10-19T12:22:24Z")]},
91-
{"dataSource": "dbpedia_2014", "interval": ["2013-10-20T12:22:24Z", "2014-10-19T12:22:24Z"]}
88+
{"datasource": "dbpedia_2012", "interval": ["2011-10-20T12:22:24Z", new Date("2012-10-19T12:22:24Z")]},
89+
{"datasource": "dbpedia_2015", "interval": ["2014-10-20T12:22:24Z", ""]},
90+
{"datasource": "dbpedia_2013", "interval": [new Date("2012-10-20T12:22:24Z"), new Date("2013-10-19T12:22:24Z")]},
91+
{"datasource": "dbpedia_2014", "interval": ["2013-10-20T12:22:24Z", "2014-10-19T12:22:24Z"]}
9292
];
9393
get_closest_memento(timemap, "2011-10-20T12:22:24Z", false);
9494
*/
@@ -127,7 +127,7 @@ TimegateController.prototype._getClosestMemento = function (timemap, acceptDatet
127127

128128
// check if the accept datetime falls within any intervals defined in the data sources.
129129
for (var i = 0, memento; memento = timemap[i]; i++) {
130-
var dataSource = memento.dataSource,
130+
var datasource = memento.datasource,
131131
startTime = memento.interval[0].getTime(),
132132
endTime = memento.interval[1].getTime();
133133

0 commit comments

Comments
 (0)