User:Shawnmjones/MementoHeaders

The Memento extension allows one to browse an entire MediaWiki site as if it were a date in the past; to do this it adds support for datetime negotiation as specified by the Memento protocol to a MediaWiki system. It provides server-side support to allow a Memento client to navigate a MediaWiki system as it was at a time in the past chosen by a user. To gain an understanding about the functionality provided by Memento's time travel, check out this brief overview that includes temporal navigations across Wikipedia and other web sites.

The Memento "Time Travel for the Web" effort started in 2009 with the overall goal of making it as easy to navigate the past of the web as it is to navigate the current web. The basic idea underlying the Memento protocol is that an old version of a web page, such as a version of a Wikipedia article - http://en.wikipedia.org/w/index.php?title=Web_archiving&oldid=526371727 - can be retrieved by accessing its original URI - http://en.wikipedia.org/wiki/Web_archiving - and by applying datetime negotiation to it. Datetime negotiation is similar to content negotiation, which is used frequently by browsers, for example, to ask a server for a version of a page in a specific format e.g. HTML or PDF. Datetime negotiation asks the server for a version with a specific date, and uses the special purpose Accept-Datetime HTTP header to do so.

The Memento protocol is meanwhile natively supported by several web archives. Also, all versions of DBpedia are natively accessible via the Memento protocol, and proxy support for all language version of Wikipedia has been implemented.

Memento's time travel is not yet natively supported in browsers and hence requires installing an extension. A Memento extension for Chrome, fully compliant with the most recent protocol specification, was released the end of September 2013. A screencam illustrates the extraordinary time travel functionality it provides.

Use Cases

 * Users often wish to see versions of resources prior to certain events, for example, the page about Michael Jackson in Wikipedia both before his death. And, once they are on an old version of that page, they may want to see what other Wikipedia pages linked from the Michael Jackson page looked like at that time.
 * MediaWikis are used for scientific purposes, for example, as platforms to provide and maintain terminology definitions. Such definitions may change over time and may be interrelated. From the perspective of scholarly discourse, it may be important to be able to see exactly what the interrelated definitions looked like, for example, when they were used in a scholarly publication.
 * MediaWikis are used as fan platforms, for example, providing all details about Game of Thrones. Because the TV episodes don't air at the same time across the world, many current pages in such fan platforms contain spoilers. In this case, a user may want to set a time travel date for the fan site that aligns with the episodes that have aired in her region.
 * Pages in MediaWikis commonly contain links to the web at large. Sometimes it is helpful, and sometimes necessary (e.g. when links are dead) to see the state of such linked resources at some time in the past, for example, at the time when a linked resource was accessed by the editor. This functionality is supported out of the box by a Memento client and thus not require a MediaWiki to install this Memento extension. However, with the extension installed, temporal navigation is possible both within and outside of the MediaWiki, providing for seamless web time travel.
 * MediaWiki editors can benefit from Memento time travel by being able to easily visit the state of interrelated pages at some time in the past, for example, to assess the differences before and after editing wars.
 * By supporting datetime negotiation to access page versions, a MediaWiki allows software agents to easily access the state of the entire system as it was at a certain point in the past, or to collect all versions of a page that were published during past time range. This capability may be helpful in support of text mining and data extraction activities and applies to both page-oriented MedaWikis and to data wikis such as Wikidata. It potentially allows for republication of structured information at a frequency that remains in lock step with the evolution of a MediaWiki, rather than in batch mode as is the case with DBpedia. See also the paper with this regard.

How Memento Works
This extension allows access to versions of MediaWiki pages by implementing support for the Accept-Datetime HTTP request header to perform datetime negotiation, a variation on content negotiation specified in RFC 2295. The datetime for negotiation is expressed as a value of the Accept-Datetime HTTP header. The Memento extension for Chrome or the command line mcurl can be used to set this datetime value.

Datetime negotiation works in two simple steps:
 * When a client requests a page, this extension will provide the URI of a TimeGate for the page in the HTTP Link header. The TimeGate is capable of datetime negotiation to access versions of the page.
 * When a client navigates to the TimeGate and performs datetime negotiation with it, the TimeGate provides the client with the version of the page that was operational at the datetime used for negotiation. The creation datetime of that version is provided in the Memento-Datetime HTTP response header, along with links in the HTTP Link header including a link to the current version of the page and to a TimeMap for the page.

This extension also allows access to a TimeMap for a MediaWiki page, which is a document that enumerates all versions of the page as well as a TimeGate for the page. When a client requests a page, this extension will provide the URI of a TimeMap for the page in the HTTP Link header.

This MediaWiki extension uses the same handlers as the MediaWiki software to connect to the database. Hence all the existing database permissions and page access permissions are honored. It uses a 'DB_SLAVE' database connection, which means that the database connection can only read from the tables. Therefore, this plug-in makes no changes to the data in the wiki.

Configuration
This extension has sensible defaults, but also allows the following settings to be added to LocalSettings.php in order to alter its behavior:


 * $wgMementoExcludeNamespaces - is an array of MediaWiki Namespace IDs (e.g. the integer values for Talk, Template, etc.) to exclude from Mementofication (default is only the content namespaces, which only consists of NS_MAIN); the list of MediaWiki Namespace IDs is at | Manual:Namespace.


 * $wgMementoTimeGateURLPrefix - the first part of the TimeGate URL, to which the extension will direct Memento users for datetime negotiation

The default values of $wgMementoTimeGateURLPrefix is array( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 ).

Server Setup
In addition to the default MediaWiki installation, this plugin will also work in a setup with URL rewriting. This plugin will also work with wikis in a proxy setup.

Usage
The best way to experience this extension is by installing Memento Time Travel for the Chrome browser. After installing Memento Time Travel, enter the URL of a page in your wiki and set the desired date-time. Memento Time Travel will use the TimeGate referenced by the wiki to load the version of the article that was live at the requested date-time.

For complete information about the Memento framework and its request - response headers, please refer to the RFC 7089.

Special Pages
Special pages under the URL http://your.wikiserver.here/index.php/Special:SpecialPages do not have a history, i.e. there are no revisions to these pages. Hence, the Memento extension cannot perform time negotiations on these resources.

Deleted Contributions
This plugin does not make any deleted revisions accessible.

Timestamps
This extension searches for and retrieves the mementos using the modified time of an article. Timestamps are not unique identifiers and it is possible that an article will have more than one revision at any given time. This extension handles this situation by redirecting to the revision that has the highest revision id.

MediaWiki does not resolve deleted revisions using revision ids, but use timestamps instead in their URIs. Hence, we could not come up with a way to resolve a situation when more than one deleted revision has the same timestamp.

Wikis with Memento Plug-in Installed

 * Demo Wiki