Encode Redirects

This document is currently in draft. When it has been reviewed and proofed, it will be published on the site.

View the draft document.

Please note that it is not of publishable quality yet.

Encode Redirects

Introduction

MoEML aspires to be a persistent Linked Open Data resource which participates in the broader scholarly effort to identify and describe historical and contemporary entities of all kinds—people, places, bibliographical items, and so on. For that reason, each of the entities we identify in our data has a unique id which results in the creation of a unique page at a stable URL. So Abchurch Lane, for instance, has the @xml:id "ABCH1", and when the site is built, it has its own distinct page at https://mapoflondon.uvic.ca/ABCH1.htm.
If the universe of Linked Open Data is to function effectively, such identifiers and URLs must be persistent over the long term. That means that when we first publish a document for a particular entity, we incur an obligation to maintain that document in perpetuity, because other resources must be able to link to it with confidence that it will not disappear.
This obligation is sometimes in conflict with our drive to constantly improve the scholarly focus and quality of our work. We may publish a page on an individual who later proves not to have existed at all, or to be the same person as another individual who has a different id in our system. We may incorporate a site in our collection which later turns out to be located outside the geographical boundaries which circumscribe our project. What do we do in these cases?
One answer to this question is that we no longer remove old editions of MoEML from the Web; instead, we have a current version which is always at https://mapoflondon.uvic.ca, and specific editions which are housed at URLs incorporating their edition number, such as https://mapoflondon.uvic.ca/edition/6.4/. However, this is clearly not sufficient, because despite our citation popups which recommend citing a specific edition rather than the generic URL, most links and pointers to our work will naturally point to the generic URL.
For this reason, we have implemented a system of redirects which ensures that when an entity is retired from the project or merged with another existing entity, its URL does not simply return a 404 not found message. Instead, anyone browsing to that URL will be redirected either to the new version of the same entity, or to a page which specifies that it has been removed or retired from the project.

Before you Start

Before a redirect can be made, someone must follow the following process:
  • Notice the situation or condition which appears to need a redirect—either an item in our collection which should not be there, or one which is apparently the same as another item and should be merged with it.
  • Do all the necessary research to confirm that this is so, and present that research in the form of a submission to the Project Manager and to Janelle.
  • Once you have their agreement that the redirect is correct and necessary, you can follow the steps below to implement it.

How to Create a Redirect

A redirect is a simple instruction in a file called redirects.xml, which at the time of writing is located at [svn repo]/db/redirects/redirects.xml. Regular research assistants do not normally have permission to commit changes to this file, so before you try to edit it, check with the project leaders to make sure you are allowed to make changes to it.
If your normal working method involves checking out the entire MoEML repository (which is very large), you will be able to locate the file easily. However, if your normal practice is to check out only the data folder, you will not have the file on your computer to edit. In this case, rather than checking out the whole repository just to access this one file, you can check out only the folder containing it, outside your regular repository checkout, and edit and commit it there. For example, if your home directory has a data folder which contains the MoEML data, you could do this at the command line: cd ~ on Linux or Mac, or cd %HOMEPATH% on Windows, to make sure you’re in your home directory. Then: svn checkout https://hcmc.uvic.ca/svn/london/db/redirects This should create a single folder called redirects with the file redirects.xml inside it. You can open this file in Oxygen to edit it.
You’ll see that this file consists of a long list of <ptr> elements that look like this:
<p>
  <!-- ... -->
  <ptr corresp="mol:COUN2" target="mol:rescinded_item"></ptr>
  <ptr corresp="mol:SENT1" target="mol:STAU1"></ptr>
  <!-- ... -->
</p>
It should be fairly obvious how this works. The @corresp attribute contains a pointer to the identifier which is being retired or redirected (so mol:COUN2 and mol:SENT1 are both going away). The @target attribute says where that id/URL should be redirected to. In the case of the first item, mol:COUN2, the redirect points to a page which explains that the item is rescinded, and gives some generic reasons why we might rescind an item. In the second case, mol:SENT1 will be redirected to mol:STAU1. mol:SENT1 was Sentlegar House, and mol:STAU1 is St. Augustine Inn, so we can presume that these two places are actually the same building, and the two records have been merged.

Necessary Follow-up Work

When an id is redirected, it is not sufficient simply to create the redirect. Every instance of a link to that id in the whole collection must be dealt with. When an id is being redirected to another id, this is simple: just find all instances of links to (for example) SENT1 and replace them with links to STAU1. In the other case, though, where an id is being removed from the project, any links to it must be examined to see whether there is perhaps some other entity to which they might be linked; if not, then the link itself should be removed, leaving plain text in place.

Committing your Changes

If you have been editing in a full checkout of the MoEML repository, you can just commit your changes as you normally would, making sure that you commit at a level which includes both the data files and the redirects file that you have edited.
If you’re working with a separate checkout of the redirects file, you’ll need to make two commits, one from the redirects folder, and one from the folder where data is checked out.

Cite this page

MLA citation

Holmes, Martin D. Encode Redirects. The Map of Early Modern London, Edition 7.0, edited by Janelle Jenstad, U of Victoria, 05 May 2022, mapoflondon.uvic.ca/edition/7.0/encode_redirects.htm. Draft.

Chicago citation

Holmes, Martin D. Encode Redirects. The Map of Early Modern London, Edition 7.0. Ed. Janelle Jenstad. Victoria: University of Victoria. Accessed May 05, 2022. mapoflondon.uvic.ca/edition/7.0/encode_redirects.htm. Draft.

APA citation

Holmes, M. D. 2022. Encode Redirects. In J. Jenstad (Ed), The Map of Early Modern London (Edition 7.0). Victoria: University of Victoria. Retrieved from https://mapoflondon.uvic.ca/editions/7.0/encode_redirects.htm. Draft.

RIS file (for RefMan, RefWorks, EndNote etc.)

Provider: University of Victoria
Database: The Map of Early Modern London
Content: text/plain; charset="utf-8"

TY  - ELEC
A1  - Holmes, Martin
ED  - Jenstad, Janelle
T1  - Encode Redirects
T2  - The Map of Early Modern London
ET  - 7.0
PY  - 2022
DA  - 2022/05/05
CY  - Victoria
PB  - University of Victoria
LA  - English
UR  - https://mapoflondon.uvic.ca/edition/7.0/encode_redirects.htm
UR  - https://mapoflondon.uvic.ca/edition/7.0/xml/standalone/encode_redirects.xml
TY  - UNP
ER  - 

TEI citation

<bibl type="mla"><author><name ref="#HOLM3"><surname>Holmes</surname>, <forename>Martin</forename> <forename>D.</forename></name></author> <title level="a">Encode Redirects</title>. <title level="m">The Map of Early Modern London</title>, Edition <edition>7.0</edition>, edited by <editor><name ref="#JENS1"><forename>Janelle</forename> <surname>Jenstad</surname></name></editor>, <publisher>U of Victoria</publisher>, <date when="2022-05-05">05 May 2022</date>, <ref target="https://mapoflondon.uvic.ca/edition/7.0/encode_redirects.htm">mapoflondon.uvic.ca/edition/7.0/encode_redirects.htm</ref>. Draft.</bibl>

Personography