-
Notifications
You must be signed in to change notification settings - Fork 59
Configuring Memento
The Linked Data Fragments server supports the Memento Protocol. If your Linked Data source evolve over time and has multiple versions, Memento makes it straightforward to access and query across the various versions.
For example, the Memento DbPedia LDF Server supports about 10 versions of DBpedia starting from 2007. A Memento Client like Memento for Chrome can be used to navigate the versions in a browser. The command line utility, cUrl, can also be used to see Memento in action. The following example queries the Memento LDF TimeGate to retrieve a Memento of the English DBpedia page around 15 March 2015.
$ curl -IL -H "Accept-Datetime: Wed, 15 Apr 2015 00:00:00 GMT" http://dbpedia.mementodepot.org/timegate/http://dbpedia.org/page/English
HTTP/1.1 302 Found
Date: Tue, 15 Mar 2016 21:07:08 GMT
Location: http://dbpedia.mementodepot.org/memento/20150415000000/http://dbpedia.org/page/English
Vary: accept-datetime
Link: <http://dbpedia.org/page/English>; rel="original",<http://dbpedia.mementodepot.org/timemap/link/http://dbpedia.org/page/English>; rel="timemap"; type="application/link-format",<http://dbpedia.mementodepot.org/memento/20150415000000/http://dbpedia.org/page/English>; rel="memento"; datetime="Wed, 15 Apr 2015 00:00:00 GMT"
HTTP/1.1 200 OK
Date: Tue, 15 Mar 2016 21:07:08 GMT
Content-Type: text/html
Link: <http://dbpedia.org/page/English>; rel="original", <http://dbpedia.mementodepot.org/memento/20150415000000/http://dbpedia.org/page/English>; rel="memento"; datetime="Wed, 15 Apr 2015 00:00:00 GMT", <http://dbpedia.mementodepot.org/timegate/http://dbpedia.org/page/English>; rel="timegate", <http://dbpedia.mementodepot.org/timemap/link/http://dbpedia.org/page/English>; rel="timemap"
Memento-Datetime: Wed, 15 Apr 2015 00:00:00 GMT
To enable Memento support, a new section called timegates
must be added to the config.json
file along with information about the versions in the datasources
section.
The timegates
section lists all the versions, called memento, of a data source. The LDF server uses this information to connect a particular data source with its versions, and also to build the appropriate Memento URL for the versions. The parameter originalBaseURL
helps set the original url for the dataset.
For example, the timegates
section below shows 2 versions of DBpedia:
"timegates": {
"baseURL": "/timegate/",
"mementos": {
"dbpedia": {
"originalBaseURL": "http://original_base_url",
"versions": [
"dbpedia_2015",
"dbpedia_2014"
]
}
}
}
For these 2 versions, the datasources
section of the config looks like:
"datasources": {
"dbpedia": {
"title": "DBpedia 2015",
"description": "DBpedia 2015 with an HDT back-end",
"type": "HdtDatasource",
"settings": {
"file": "/data1/dbpedia/cdata_2015.hdt"
},
"timegate": true
},
"dbpedia_2015": {
"title": "DBpedia v2015",
"description": "DBpedia v2015 with an HDT back-end",
"type": "HdtDatasource",
"settings": {
"file": "/data1/dbpedia/cdata_2015.hdt"
},
"memento": {
"interval": ["2014-09-14T11:59:59Z", "2015-04-15T00:00:00Z"]
}
},
"dbpedia_2014": {
"title": "DBpedia v2014",
"description": "DBpedia v2014 with an HDT back-end",
"type": "HdtDatasource",
"settings": {
"file": "/data1/dbpedia/cdata_2014.hdt"
},
"memento": {
"interval": ["2013-06-15T11:59:59Z", "2014-09-15T00:00:00Z"]
}
}
The first datasource named dbpedia
is the current version or in Memento terms, the Original. This datasource has a parameter called timegate: true
which indicates to the LDF server that there are mementos available to this datasource. The LDF server will then use the information provided in the timegates
section to build the approriate Memento responses.
The datasources dbpedia_2015
and dbpedia_2014
contain information about the data source and also information about the time interval this version was active in the memento
section. The time interval must be in ISO 8601 format.