<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Project Omega at The National Archives on Medium]]></title>
        <description><![CDATA[Stories by Project Omega at The National Archives on Medium]]></description>
        <link>https://medium.com/@catalogueprojects?source=rss-c95baf8f8cb8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*uELe4ZXdY-G0g1B1a_rL_w.png</url>
            <title>Stories by Project Omega at The National Archives on Medium</title>
            <link>https://medium.com/@catalogueprojects?source=rss-c95baf8f8cb8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 02:25:10 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@catalogueprojects/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Processing Historical Dates]]></title>
            <link>https://medium.com/the-national-archives-digital/processing-historical-dates-d7ddb5814de8?source=rss-c95baf8f8cb8------2</link>
            <guid isPermaLink="false">https://medium.com/p/d7ddb5814de8</guid>
            <category><![CDATA[rdf]]></category>
            <category><![CDATA[calendar]]></category>
            <category><![CDATA[the-national-archives]]></category>
            <category><![CDATA[catalogue]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Project Omega at The National Archives]]></dc:creator>
            <pubDate>Fri, 04 Jun 2021 10:41:00 GMT</pubDate>
            <atom:updated>2021-06-08T15:30:17.570Z</atom:updated>
            <content:encoded><![CDATA[<p><em>This is a guest blog post by Adam Retter of </em><a href="https://www.evolvedbinary.com/"><em>Evolved Binary</em></a><em>, who is acting as a consultant on Project Omega for The National Archives…</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-stwsOaDAnT47qWp" /></figure><p>Phase 2 of <a href="https://www.nationalarchives.gov.uk/about/our-role/plans-policies-performance-and-projects/our-plans/our-digital-cataloguing-practices/project-omega/">Project Omega</a> at TNA (<a href="https://www.nationalarchives.gov.uk/">The National Archives</a>) commenced at the end of January 2021, and our first goal was to perform a large export of their Catalogue Records from their previous system, ILDB (Microsoft SQL Server), into our new pan-archival RDF data model. I <a href="https://blog.adamretter.org.uk/rdf-plugins-for-pentaho-kettle/">previously discussed</a> the tooling that we were building to enable such ETL (Extract Transform Load) processes.</p><p>Whilst improving the ETL pipeline I experienced some interesting problems when trying to parse and process what I believed to be already computed dates from ILDB. These values that looked like dates suitable for computation were expressed as serial numeric values, for example in that scheme the 17th March 2021, would be expressed as 20210317.</p><p>I later found out that even before the year 2000, The National Archives had already encountered this problem. Difficulties that arose previously from attempting to store historical dates as computable dates, gave rise to the decision at that time to store them as text and to convert regnal years (e.g. 3 Eliz I) into serial numeric values rather than computable date values.</p><p>The existing data in the ILDB system should adhere to TNA-CS13 (<br>The National Archives — Cataloguing Standards, June 2013) specification, which itself is an extension of <a href="https://www.ica.org/en/isadg-general-international-standard-archival-description-second-edition">ISAD(G)</a> (General International Standard Archival Description).</p><h4>Covering Dates</h4><p>The date Data Elements that I was trying to process are known in TNA-CS13 as the Covering Dates, and are described as:</p><blockquote><em>Identifies and records the date(s) of creation of the records being described.</em></blockquote><p>As a non-archivist, I personally find the term Covering Dates non-intuitive! The first time I encountered it some years ago I incorrectly assumed that it was the period of time discussed in the records, as opposed to the creation date(s) of the records themselves.</p><p>The expert archivist however exactly understands the concept of Covering Dates, and I am told that:</p><blockquote><em>An archival catalogue describes records/documents not historical events. The catalogue is agnostic to historical events and so is the archivist. All intrinsic metadata in the catalogue refers to the record. There may be extrinsic metadata providing contextual information (generally added later as a result of enrichment) but the dates refer to the records.</em></blockquote><p>Further explanation of how to complete the Covering Dates is also provided:</p><blockquote><em>“Give the covering dates of the creation of the records within the unit of description as a single calendar date or range of dates as appropriate.”</em></blockquote><p>Within the database behind ILDB, the Covering Dates are stored using 3 fields:</p><ol><li>date_text This is a textual description of the dates as they appear in the document or file (or the metadata for a born-digital folder file or folder). It outlines the date or range of dates when the document or file was created or accumulated.</li><li>first_date This is the earliest creation date of any record within the unit of description. It is stored as a serial numeric value of the form yyyyMMdd.</li><li>last_date If the unit of description encompasses more than one record and those records have different creating dates, then this is the latest creation date of any record within that unit. If there is only a single record, or all creation dates are the same within the unit, then this duplicates the first_date. It is stored as a serial numeric value of the form yyyyMMdd.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/633/1*2SnEJjlyCgXRDycgBr-RlQ.png" /><figcaption>ILDB Item Level Fields (Covering Date fields highlighted)</figcaption></figure><p>The system attempts to infer the first_date and last_date fields from the date_text as explained in TNA-CS13, however ultimately the archivist can override this behaviour manually:</p><blockquote><em>Dates must be entered in a particular format because the covering date format automatically generates numeric start and end dates in the catalogue in order to enable date searching.</em></blockquote><p>Data for archival catalogues was often generated through the conversion of paper lists into digital form. In the days before the internet, archivists typed the calendar year before the month and the day as this helped readers to rule out or identify relevant information faster. If you are familiar with <a href="https://en.wikipedia.org/wiki/ISO_8601">ISO 8601</a> style dates, then this will be somewhat familiar to you already.</p><p>Some example Covering Dates:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/397/1*hpq7SZDf3BIB6gGqLdh-zw.png" /><figcaption>Example Covering Dates stored in ILDB</figcaption></figure><h4>Problems Processing Covering Dates</h4><p>For our RDF data model, we wanted to express the Covering Dates using <a href="https://www.w3.org/TR/owl-time/">W3C OWL-Time</a>. We had decided upon using either an <a href="https://www.w3.org/TR/owl-time/#time:Instant">Instant</a> for a single covering date where the first and last dates are the same, or a <a href="https://www.w3.org/TR/owl-time/#time:ProperInterval">ProperInterval </a>for a covering date where the first and last dates differ.</p><p>During our ETL process we have a step which parses the numeric first_date and last_date fields into <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Date.html">Java Date</a> objects, and later a subsequent step that adds these to our RDF Model as <a href="https://www.w3.org/TR/xmlschema-2/#date">xsd:date </a>literals.</p><p>During execution of the ETL which was in total processing ~8.2 million records at item level, we would occasionally see a perplexing error related to first_date:</p><pre>covering_date_start String(9) : couldn&#39;t convert string [15821011] to a date using format [yyyyMMdd] on offset location 8</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Iri5fm8rqm8lifFJRoHRRw.png" /><figcaption>Pentaho — Date Conversion Error</figcaption></figure><p>To the uninitiated (i.e. my past self), the string 15821011 looks like it should be parsable using the pattern yyyyMMdd; I can see the year is 1582, the month is October, and the day of the month is the 11th. So what&#39;s wrong with this?</p><h4>Reproducing the Issue</h4><p>As Pentaho is written in Java, my first thought was to try and reproduce the issue in a couple of lines of Java code, so that I can either rule in or out an issue with Pentaho. So I wrote the following idiomatic Java code:</p><pre>import java.text.ParseException;<br>import java.text.ParsePosition;<br>import java.text.SimpleDateFormat;<br><br>public class DateTest {<br><br>    public static void main(final String args[]) throws ParseException {<br>        final String input = &quot;15821011&quot;;<br>        final SimpleDateFormat sdf = new SimpleDateFormat(&quot;yyyyMMdd&quot;);<br><br>        final ParsePosition pp = new ParsePosition(0);<br>        sdf.parse(input, pp);<br><br>        if (pp.getErrorIndex() &gt;= 0) {<br>            // error occurred<br>            throw new ParseException(&quot;Unable to parse: &#39;&quot; + input + &quot;&#39;&quot;, pp.getErrorIndex());<br>        }<br>    }<br>}</pre><p>The above code did not throw a ParseException, thus meaning that it was able to parse the date just fine. This made me suspect that there must be some difference between the above and how Pentaho is parsing the date itself.</p><p>To confirm this, I started Pentaho Spoon with a Java debugging agent configured for remote access, connected to it from IntelliJ IDEA and set some break-points in the Select Values step class (org.pentaho.di.trans.steps.selectvalues.SelectValues) that is used for parsing the date into a Java Date object. Through running the ETL and stepping through the executing code using the Java Debugger I was able to ascertain, that by default the step was calling <a href="https://docs.oracle.com/javase/8/docs/api/java/text/DateFormat.html#setLenient-boolean-">SimpleDateFormat#setLenient(boolean)</a> with the argument false before parsing the date.</p><p>Whether lenient parsing is enabled by default for SimpleDateFormat depends on the Calendar that backs it. This in itself depends on your JDK Platform and likely your locale. On my <em>en_GB.UTF-8 </em>system with OpenJDK 8, the lenient setting is inherited from java.util.Calendar where it is enabled by default.</p><p>Modifying our reproducible Java code to disable lenient parsing yields:</p><pre>import java.text.ParseException;<br>import java.text.ParsePosition;<br>import java.text.SimpleDateFormat;<br><br>public class DateTest {<br><br>    public static void main(final String args[]) throws ParseException {<br>        final String input = &quot;15821011&quot;;<br>        final SimpleDateFormat sdf = new SimpleDateFormat(&quot;yyyyMMdd&quot;);<br><br>        sdf.setLenient(false);  // disable lenient parsing mode<br><br>        final ParsePosition pp = new ParsePosition(0);<br>        sdf.parse(input, pp);<br><br>        if (pp.getErrorIndex() &gt;= 0) {<br>            // error occurred<br>            throw new ParseException(&quot;Unable to parse: &#39;&quot; + input + &quot;&#39;&quot;, pp.getErrorIndex());<br>        }<br>    }<br>}</pre><p>The above modified code does indeed now throw a ParseException as a result of trying to parse the date 15821011. So far so good, we have isolated and reproduced the issue!</p><h4>It’s all about the Calendar!</h4><p>So, 15821011 looks like a valid date... so why does it not parse when lenient parsing is disabled?</p><p>Our first hint is from examining the result of sdf.parse (as a String) when lenient parsing is enabled. The result is:</p><pre>Thu Oct 21 00:00:00 CET 1582</pre><p>Interesting! I was expecting the 11th October 1582, but we are told that we have the 21st October 1582.</p><p>I previously had a basic understanding that there was a Julian Calendar and that this pre-dated the creation and use of the Gregorian Calendar, and that the switch-over happened in October 1582. That switch-over happened such that, Thursday 4th October 1582 (Julian Calendar) was followed by Friday 15th October 1582 (Gregorian Calendar). I can only imagine that this must have confused a few people who woke up on that Friday morning ;-)</p><p>As the calendar switched from Julian to Gregorian in October 1582 we can see that according to the Julian-Gregorian hybrid calendar (which is what Java uses by default on my platform) there was no 11th October 1582, and therefore 15821011 is not a valid date (for that Calendar).</p><p>So what’s up with lenient parsing? Basically SimpleDateFormat makes a best effort attempt to interpret the supplied date. As 11th October 1582 falls in the period between the Julian-Gregorian switch-over, Java adds 10 days (the difference at that time between the calendars), to yield the 21st October 1582 in the Gregorian Calendar. However, that&#39;s not really what we want! We want non-lenient parsing as we may have other dates in the source data that are actually incorrect and we don&#39;t want them slipping through undetected.</p><p>…and if that was the end of it, it wouldn’t be too bad as we could just correct an invalid date in the source data. However, that date is perfectly valid… keep reading!</p><h4>Julian-Gregorian Switch-Over Wasn’t Universal!</h4><p>Simply put, whilst most of Roman Catholic Europe switched from Julian to Gregorian calendars in October 1582, other countries followed later. The countries now making up the UK and Ireland are important in this story because this date comes from The Catalogue of The National Archives, and they didn’t in fact switch-over until almost 200 years later — 14th September 1752.</p><p>When given a date, I think you actually have to know two things to be able to parse it, 1) the date itself, and 2) to which Calendar the date is in reference to. Our date 11th October 1582 (15821011) is perfectly valid in the UK <em>at that time</em> (according to the Julian Calendar), as the UK had not yet switched over to the Gregorian calendar.</p><p>When parsing 15821011 in Java, we need to instruct Java to use the correct Calendar configuration. Initially I (incorrectly) assumed that Java would know the switch-over dates on a per-country basis and adjust its Julian-Gregorian calendar appropriately, as such I tried setting both the Locale and Time Zone to UK:</p><pre>import java.text.ParseException;<br>import java.text.ParsePosition;<br>import java.text.SimpleDateFormat;<br>import java.util.Date;<br>import java.util.GregorianCalendar;<br>import java.util.Locale;<br>import java.util.TimeZone;<br><br>public class DateTest {<br><br>    public static void main(final String args[]) throws ParseException {<br>        final String input = &quot;15821011&quot;;<br><br>        final Locale ukLocale = Locale.UK;<br>        final SimpleDateFormat sdf = new SimpleDateFormat(&quot;yyyyMMdd&quot;, ukLocale);<br><br>        final TimeZone ukTimeZone = TimeZone.getTimeZone(&quot;Europe/London&quot;);<br>        final GregorianCalendar ukCalendar = new GregorianCalendar(ukTimeZone, ukLocale);<br>        sdf.setCalendar(ukCalendar);<br><br>        sdf.setLenient(false);  // disable lenient parsing mode<br><br>        final ParsePosition pp = new ParsePosition(0);<br>        final Date result = sdf.parse(input, pp);<br><br>        if (pp.getErrorIndex() &gt;= 0) {<br>            // error occurred<br>            throw new ParseException(&quot;Unable to parse: &#39;&quot; + input + &quot;&#39;&quot;, pp.getErrorIndex());<br>        }<br><br>        System.out.println(&quot;Result: &quot; + result.toString());<br>    }<br>}</pre><p>Unfortunately, as mentioned above, my assumption that Java would configure the Julian-Gregorian switch-over date automatically once it knew the Locale and Time Zone was incorrect; the above code still throws a ParseException.</p><p>Once you know where to look, this is documented and expected behaviour. Java’s <a href="https://docs.oracle.com/javase/8/docs/api/java/util/GregorianCalendar.html">GregorianCalendar </a>class documentation states:</p><blockquote><em>GregorianCalendar is a hybrid calendar that supports both the Julian and Gregorian calendar systems with the support of a single discontinuity, which corresponds by default to the Gregorian date when the Gregorian calendar was instituted (October 15, 1582 in some countries, later in others). The cutover date may be changed by the caller by calling </em><a href="https://docs.oracle.com/javase/8/docs/api/java/util/GregorianCalendar.html#setGregorianChange-java.util.Date-"><em>setGregorianChange()</em></a><em>.</em></blockquote><blockquote><em>Historically, in those countries which adopted the Gregorian calendar first, October 4, 1582 (Julian) was thus followed by October 15, 1582 (Gregorian). This calendar models this correctly. Before the Gregorian cutover, </em><em>GregorianCalendar implements the Julian calendar.</em></blockquote><p>Therefore, to construct a calendar that respects the UK Julian-Gregorian calendar switch-over we can call setGregorianChange with an argument of 14th September 1752. For example:</p><pre>import java.text.ParseException;<br>import java.text.ParsePosition;<br>import java.text.SimpleDateFormat;<br>import java.util.Calendar;<br>import java.util.Date;<br>import java.util.GregorianCalendar;<br>import java.util.Locale;<br>import java.util.TimeZone;<br><br>public class DateTest {<br><br>    public static void main(final String args[]) throws ParseException {<br>        final String input = &quot;15821011&quot;;<br><br>        final Locale locale = Locale.UK;<br>        final TimeZone timeZone = TimeZone.getTimeZone(&quot;Europe/London&quot;);<br><br>        // setup a UK Julian-Gregorian Calendar with the correct switch-over date for the UK<br>        final GregorianCalendar ukJulianGregorianCalendar = new GregorianCalendar(timeZone, locale);<br>        final GregorianCalendar ukGregorianCalendarCutoverDate = (GregorianCalendar) ukJulianGregorianCalendar.clone();<br>        ukGregorianCalendarCutoverDate.set(1752, Calendar.September, 14);<br>        ukJulianGregorianCalendar.setGregorianChange(ukGregorianCalendarCutoverDate.getTime());<br><br>        final SimpleDateFormat sdf = new SimpleDateFormat(&quot;yyyyMMdd&quot;, locale);<br>        sdf.setCalendar(ukJulianGregorianCalendar);<br><br>        sdf.setLenient(false);  // disable lenient parsing mode<br><br>        final ParsePosition pp = new ParsePosition( 0 );<br>        final Date result = sdf.parse(input, pp);<br><br>        if ( pp.getErrorIndex() &gt;= 0 ) {<br>            // error occurred<br>            throw new ParseException( input, pp.getErrorIndex());<br>        }<br><br>        System.out.println(&quot;parsed=&#39;&quot; + result.toString() + &quot;&#39;&quot;);<br>        System.out.println(&quot;serialized=&#39;&quot; + sdf.format(result) + &quot;&#39;&quot;);<br>    }<br>}</pre><p><strong>NOTE:</strong> In the above code the call to <a href="https://docs.oracle.com/javase/7/docs/api/java/util/Calendar.html#set(int,%20int,%20int)">Calendar#set(int, int, int)</a> takes arguments for a <em>year</em>, a <em>month</em>, and a <em>day</em>, but... the <em>month</em> argument is zero-based and not one-based! So for September you must enter 8 and not 9! Alternatively you can use the constants from the Calendar API, e.g.: set(1752, Calendar.September, 14). This small difference confused me for some time :-(</p><p>The most important thing to note in the code above, is that we have still explicitly disabled lenient parsing, but because we have correctly set the UK Julian-Gregorian switch-over date, we can now parse our date 11th October 1582 ( 15821011) without any errors. The result of the above code is:</p><pre>parsed=&#39;Thu Oct 21 01:00:00 CET 1582&#39;<br>serialized=&#39;15821011&#39;</pre><p>Now you might be thinking… Hang-on one hot-moment, the parsed line still says &quot;21st October 2021&quot;!<br>Indeed it does! However, that is correct because as explained in Java&#39;s <a href="https://docs.oracle.com/javase/8/docs/api/java/util/GregorianCalendar.html">GregorianCalendar </a>class documentation:</p><blockquote><em>GregorianCalendar implements </em>proleptic<em> Gregorian and Julian calendars. That is, dates are computed by extrapolating the current rules indefinitely far backward and forward in time. As a result, </em><em>GregorianCalendar may be used for all years to generate meaningful and consistent results.</em></blockquote><p>The important term above is “ <em>proleptic</em>”, and I will leave that for the reader to look up. I am simplifying but you can expect the Java Date class to always represent dates internally according to the Gregorian Calendar. That’s not a problem because we can convert forward and backward as needed between Calendar representations. This is demonstrated by the serialized output line in the results above.</p><p>Now that our Calendar is correctly configured (for the UK) in Java we have no problem parsing our Covering Dates. Unfortunately I have been unable to find any options for configuring this in Pentaho for our ETL, and as such we have 2 options:</p><ol><li>As Pentaho is Open Source, we could improve Pentaho’s Select Value step to offer suitable configuration.</li><li>Create a custom Pentaho Plugin step which handles such date parsing.<br>I may cover such topics in a future post, but we won’t consider Pentaho any further today.</li></ol><h4>What about that RDF?</h4><p>As briefly mention earlier we want to output our Covering Dates into our RDF using a <a href="https://www.w3.org/TR/owl-time/">W3C OWL-Time</a> format. We need to incorporate the 3 fields: date_text, first_date, and the optional last_date. The first_date and last_date fields are now valid Java Date objects according to our calendar (as discussed above), whilst the date_text remains a string value.</p><p>An example, of a Covering Date indicating a single point in time for a unit of description, may have the date_text with a value of 1859 Aug 30, and only a first_date with a value of 18590830. This can be expressed in our RDF model for Project Omega as:</p><pre>omg:created [<br>    a time:Instant ;<br>    dct:description &quot;1859 Aug 30&quot; ;<br>    time:inXSDDate &quot;1859-08-30Z&quot;^^xsd:date<br>] .</pre><p>Another example, of a Covering Date indicating a period of time for a unit of description, may have the date_text with a value of 11 Oct 1582 - 29 Nov 1582, the first_date with a value of 15821011, and last_date with a value of 15821129. This can be expressed in our RDF model for Project Omega as:</p><pre>omg:created [<br>    a time:ProperInterval ;<br>    dct:description &quot;11 Oct 1582 - 29 Nov 1582&quot; ;<br>    time:hasBeginning [<br>        a time:Instant ;<br>        time:inXSDDate &quot;1582-10-21Z&quot;^^xsd:date<br>    ] ;<br>    time:hasEnd [<br>        a time:Instant ;<br>        time:inXSDDate &quot;1582-12-09Z&quot;^^xsd:date<br>    ]<br>] .</pre><p>Now, if you have been paying close attention so far, you will have noticed that the literal values of the time:inXSDDate properties don&#39;t look like the first_date and last_date values!</p><p>However, if I told you that these dates in RDF are stored according to the <a href="https://www.w3.org/TR/xmlschema-2/#date">xsd:date</a> (W3C XML Schema Date) data-type, and that that specifies a <em>proleptic </em>Gregorian Calendar, then perhaps you might have an “ <em>Ah ha!</em>” moment.</p><p>If not, then let me explain that the dates in the RDF are the Gregorian equivalent of the Julian dates that were provided as input. No information has been lost as you can convert back and forward between these with relative ease.</p><h4>Finally, The Archivist vs. The Software Engineer</h4><p>The Digital Humanities require a fine and pragmatic balance between Human and Technical factors.</p><p><strong>Software Engineering — Technical Factors</strong></p><p>In the example of storing these Covering Dates in RDF the Software Engineer has proposed storing them as xsd:date typed values. The software Engineer recalling that TNA-CS13 states:</p><blockquote><em>the covering date format automatically generates numeric start and end dates in the catalogue in order to enable date searching.</em></blockquote><p>believes that the date_text is the important property from an archival descriptive perspective, and that the first_date and last_date are really just present to enable the access function of searching records by dates. The Software Engineer also understands by assumption that the first_date and last_date should be in synchronisation with the date_text and therefore be a faithful representation of that period.</p><p>For the software engineer, how the first_date and last_date are stored is a technical consideration that centers around arguments of accuracy, performant indexing, and range searches over dates. The Software Engineer believes that dates for dates to be processed consistently in isolation, they must be expressed according to a Calendar and Time Zone. In effect 3 facts are required to process a date, the date itself, the calendar for which the date is expressed, and any Time Zone information for how that date is recorded.</p><p>Ultimately, should there be a presentation requirement, the Software Engineer knows that they can convert the first_date and last_date and present/search it in any format requested by the user. The Software Engineer is confident that no information has been lost or destroyed.</p><p><strong>Archival — Preservation Factors</strong></p><p>The archivist is concerned that at present the first_date and last_date are recorded as simple sequential numbers. The archivist understands the context of the record, and is happy to glance at the serial date and interpret it within its historical context. The archivist believes that all 3 properties ( first_date, last_date, and date_text) are equally important from a records keeping perspective and should be preserved as is.</p><p>The archivist worries that the raw expression of an xsd:date e.g. 1859-08-30Z may be harder to interpret that the previous serial format: 18590830; worse yet, dates that were written for the Julian Calendar (as that was the Calendar in use at that date) e.g. 15821129 might now be expressed as 1582-12-09Z for the Gregorian Calendar. Without careful explanation to the user, the new Gregorian form of the Julian date is confusing, and use of the original serial format of date perhaps makes more sense.</p><p><strong>In Conclusion — Human and Technical Together</strong></p><p>Ultimately, all of these dates regardless of their formatting for expression relative to a particular calendar are stored as electro-magnetic 1s and 0 s on a disk. The current serial formatted first and last dates stored in ILDB are SQL Integers laid down inside a complex proprietary MS SQL Server database format, that likely few could hope to decipher!</p><p>Ignoring for the moment the field of Digital Preservation, we can have the best of both worlds. The Software Engineer can design correct and performant software, which accurately records the dates, and that the archivists and the users can be presented and allowed to search those dates in whichever format is most desirable. Such presentation could include displaying the calendar or adjusting the display dates to the historically relevant calendar for the record.</p><p>This Omega Catalogue system is designed to be an online system, for the purposes of Digital Preservation, one could imagine preserving frequent exports of our RDF data as perhaps Turtle or similar (UTF-8 encoded text). As a Software Engineer and potential Digital Archeologist I would argue that (given pre-knowledge of the spec), it is much easier to interpret and process 1582-12-09Z over 15821129, as the first form can only be according to the Gregorian Calendar (as per the W3C specifications for the XML Schema Date Type) and also indicates the time-zone (the Z character denotes UTC). I therefore have everything I need within the date string itself. I don&#39;t need to research further into the history of Julian to Gregorian Calendar switch-overs, which I would otherwise have to do with the second form!</p><p><em>Originally published at </em><a href="https://blog.adamretter.org.uk/processing-historical-dates/"><em>https://blog.adamretter.org.uk</em></a><em> on June 4, 2021.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d7ddb5814de8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-national-archives-digital/processing-historical-dates-d7ddb5814de8">Processing Historical Dates</a> was originally published in <a href="https://medium.com/the-national-archives-digital">The National Archives Digital</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Reusing Standard RDF Vocabularies — Part 2]]></title>
            <link>https://medium.com/the-national-archives-digital/reusing-standard-rdf-vocabularies-part-2-4e4a3ad0bbf5?source=rss-c95baf8f8cb8------2</link>
            <guid isPermaLink="false">https://medium.com/p/4e4a3ad0bbf5</guid>
            <category><![CDATA[catalogue]]></category>
            <category><![CDATA[vocabulary]]></category>
            <category><![CDATA[records-management]]></category>
            <category><![CDATA[rdf]]></category>
            <category><![CDATA[national-archives]]></category>
            <dc:creator><![CDATA[Project Omega at The National Archives]]></dc:creator>
            <pubDate>Wed, 24 Mar 2021 09:49:45 GMT</pubDate>
            <atom:updated>2021-03-24T10:52:40.270Z</atom:updated>
            <content:encoded><![CDATA[<h3>Reusing Standard RDF Vocabularies — Part 2</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Y8rFTWMM5jYTYYQT" /></figure><p>In <a href="https://medium.com/the-national-archives-digital/reusing-standard-rdf-vocabularies-part-1-5a9bbfa58b85">Part 1</a> we looked at the challenges of strictly sticking to a policy of reusing existing vocabularies within <a href="https://www.nationalarchives.gov.uk/about/our-role/plans-policies-performance-and-projects/our-plans/our-digital-cataloguing-practices/project-omega/">Project Omega</a> at TNA (<a href="https://www.nationalarchives.gov.uk/">The National Archives</a>) and why you may occasionally have to make concessions to correctly express your data.</p><p>The example discussed in <a href="https://medium.com/the-national-archives-digital/reusing-standard-rdf-vocabularies-part-1-5a9bbfa58b85">Part 1</a> was concerned with the scenario where one cannot from a suitable property from an existing popular standardised vocabulary. In this shorter article, we will look at a second scenario where there may be a reusable property available, but its implementation is problematic.</p><h3>Primary and Secondary Identifiers</h3><p>For this example let me explain another use-case that we recently had to solve for Project Omega. TNA’s current Catalogue contains multiple identifiers, for each Unit of Description (a single document of folder):</p><ol><li>Database Table Primary Key, e.g. tbl_item.-4653191</li><li>CCR (Classic Catalogue Reference), e.g. AIR 79/1064/118667</li><li><em>Optional </em>— The Former Reference — Creating Department, e.g. R515333</li><li><em>Optional </em>— The Former Reference — PRO (Public Records Office), e.g. E 315/509/Fo. 11</li></ol><p>In addition, in the new Omega Catalogue, every Resource has:</p><ol><li>An OCI (Omega Catalogue Identifier), e.g. FO.2020.3J.P.1</li><li><em>Optional</em> — A related identifier from the <a href="https://discovery.nationalarchives.gov.uk/">Discovery</a> system called an IAID (Information Asset Identifier), e.g. 01d43d64-d7a6-4250-a2f2-4153a606a948.</li></ol><p>The Primary Identifier in Omega is the OCI, and we can happily reuse the <a href="https://www.dublincore.org/specifications/dublin-core/dcmi-terms/">Dublin Core Terms</a>’ dc:identifier property for this. For example:</p><pre>@prefix tna:     &lt;<a href="http://www.nationalarchives.gov.uk/">http://www.nationalarchives.gov.uk/</a>&gt; .<br>@prefix dct:     &lt;<a href="http://purl.org/dc/terms/">http://purl.org/dc/terms/</a>&gt; .<br><br>tna:res.FO.2020.3J.P.1<br>    dct:identifier &quot;FO.2020.3J.P.1&quot; ;<br>    .</pre><p><em>— A Record with a Primary Identifier.</em></p><p>This leads us to the question of — <em>What is the best way to express our Secondary Identifiers?</em></p><h3>Expressing Secondary Identifiers</h3><p>If we were to express our Secondary Identifiers also using dct:identifier, it becomes difficult, impossible even, to differentiate the scheme to which identifier belongs as the dct:identifier is a Data Type Property and only permits a single literal value. Consider for example:</p><pre>@prefix tna:     &lt;<a href="http://www.nationalarchives.gov.uk/">http://www.nationalarchives.gov.uk/</a>&gt; .<br>@prefix dct:     &lt;<a href="http://purl.org/dc/terms/">http://purl.org/dc/terms/</a>&gt; .<br><br>tna:res.FO.2020.3J.P.1<br>    dct:identifier &quot;FO.2020.3J.P.1&quot; ;<br>    dct:identifier &quot;01d43d64-d7a6-4250-a2f2-4153a606a948&quot; ;<br>    dct:identifier &quot;tbl_item.-4653191&quot; ;<br>    dct:identifier &quot;AIR 79/1064/118667&quot; ;<br>    dct:identifier &quot;R515333&quot; ;<br>    dct:identifier &quot;E 315/509/Fo. 11&quot; ;<br>    .</pre><p><em>— A Record with many Identifiers; problematic?</em></p><p>The difficulty in working with the above data is that it raises questions such as:</p><ol><li>Why are there so many identifiers?</li><li>To which schemes do these identifiers belong, and where can I find more information about those?</li><li>Which identifier should I use?</li><li>If I perform a query involving dct:identifier, then I am querying across identifier schemes, but am I guaranteed that there are no duplicate or conflicting identifiers across those schemes?</li><li>As a maintainer of the data, are all of the identifiers that are needed present?</li></ol><p>Ideally we want instead a mechanism for Secondary Identifiers that not only expresses the identifier itself, but also the scheme which defines the use and syntax of that identifier.</p><p>After looking through several popular and standardised vocabularies, <a href="https://schema.org/">Schema.org</a>’s identifier property appears to suit our needs — <a href="https://schema.org/identifier">schema:identifier</a>.</p><pre>@prefix tna:     &lt;<a href="http://www.nationalarchives.gov.uk/">http://www.nationalarchives.gov.uk/</a>&gt; .<br>@prefix dct:     &lt;<a href="http://purl.org/dc/terms/">http://purl.org/dc/terms/</a>&gt; .<br>@prefix schema:  &lt;<a href="https://schema.org/">https://schema.org/</a>&gt; .<br><br>tna:res.FO.2020.3J.P.1<br>    dct:identifier &quot;FO.2020.3J.P.1&quot; ;<br>    schema:identifier [<br>        a schema:PropertyValue ;<br>        schema:name &quot;CCR&quot; ;<br>        schema:description &quot;The Classic Catalogue Reference&quot; ;<br>        schema:value &quot;FO 12/34/56&quot;<br>    ] ;<br>    schema:identifier [<br>        a schema:PropertyValue ;<br>        schema:name &quot;FRCD&quot; ;<br>        schema:description &quot;The Former Reference - Creating Department&quot; ;<br>        schema:value &quot;R123456&quot;<br>    ]<br>    .</pre><p><em>— A Record with Primary and Secondary Identifier — Literals.</em></p><p>This is an improvement over the sole and repeated use of dct:identifier as it allows us to reserve dct:identifier to indicate our Primary Identifier, and our secondary identifiers are now easily located via schema:identifier. In addition, each Secondary Identifier carries information explaining its purpose.</p><h3>Further Concessions Against Reuse</h3><p>We could refactor this to eliminate duplication and make it easier to query against specific secondary identifier(s). Thus yielding:</p><pre>@prefix tna:     &lt;<a href="http://www.nationalarchives.gov.uk/">http://www.nationalarchives.gov.uk/</a>&gt; .<br>@prefix dct:     &lt;<a href="http://purl.org/dc/terms/">http://purl.org/dc/terms/</a>&gt; .<br>@prefix schema:  &lt;<a href="https://schema.org/">https://schema.org/</a>&gt; .<br><br>tna:res.FO.2020.3J.P.1<br>    dct:identifier &quot;FO.2020.3J.P.1&quot; ;<br>    schema:identifier [<br>        a schema:PropertyValue ;<br>        schema:propertyID tna:ccr ;<br>        schema:value &quot;FO 12/34/56&quot;<br>    ] ;<br>    schema:identifier [<br>        a schema:PropertyValue ;<br>        schema:propertyID tna:frcd ;<br>        schema:value &quot;R123456&quot;<br>    ]<br>    .</pre><p><em>— A Record with Primary and Secondary Identifier — URIs.</em></p><p>The above involves trading-off the reuse of existing vocabulary properties for further precision of meaning.</p><p>We gain:</p><ol><li>A reduction in duplicated strings, e.g. the schema:name and schema:description being placed on each secondary identifier.</li><li>The ability to easily and confidently search the data, we can match on ? schema:propertyID tna:ccr instead of ? schema:name &quot;CCR&quot;. This becomes even more important where data may have been mis-keyed.</li></ol><p>We lose:</p><ol><li>The ability for strangers to interpret our data easily by glancing at a Secondary Identifier (schema:identifier) and immediately know what it is by reading its inline schema:name and schema:description.</li><li>The ability to express our data without needing to define our own vocabulary.</li></ol><p>These trade-offs are quite severe and I think we lose too much for the (maybe as yet unknown) humans who want to work with our data. Of course we gain for the machines, but if we were only concerned about machines we would just use the most efficient binary encoding possible and this article would be redundant.</p><p>To complete the example above, we should also define tna:ccr and tna:frcd in a new vocabulary of our own:</p><pre>@prefix owl      &lt;<a href="http://www.w3.org/2002/07/owl#">http://www.w3.org/2002/07/owl#</a>&gt; .<br>@prefix rdfs     &lt;<a href="http://www.w3.org/2000/01/rdf-schema#">http://www.w3.org/2000/01/rdf-schema#</a>&gt; .<br>@prefix tna:     &lt;<a href="http://www.nationalarchives.gov.uk/">http://www.nationalarchives.gov.uk/</a>&gt; .<br>@prefix dct:     &lt;<a href="http://purl.org/dc/terms/">http://purl.org/dc/terms/</a>&gt; .<br>@prefix schema:  &lt;<a href="https://schema.org/">https://schema.org/</a>&gt; .<br><br>tna:ccr<br>    a owl:Class ;<br>    rdfs:label.  &quot;Classic Catalogue Reference&quot; ;<br>    rdfs:comment &quot;The CCR (Classic Catalogue Reference) is a<br>                  secondary identifier for a Unit of Description. It<br>                  reflects the historic ISAD(G) like archival<br>                  arrangement of the unit, i.e Department, Series,<br>                  Piece, and Item. It has been in use at The<br>                  National Archives since the 19th century and is<br>                  aligned to the ISAD(G) standard. It is defined on<br>                  page 13 of the document: TNA-CS13 (Cataloguing<br>                  Standards - Part A Data Elements,<br>                  June 2013).&quot;@en ;<br>    rdfs:seeAlso tna:cs13-a, schema:identifier, dct:identifier<br>    .<br>  <br> tna:frcd<br>    a owl:Class ;<br>    rdfs:label   &quot;Former Reference - Creating Department&quot; ;<br>    rdfs:comment &quot;The FRCD (Former Reference - Creating Department)<br>                  is a secondary identifier for a Unit of<br>                  Description. It holds<br>                  the unique identifier given to the material by the<br>                  originating creator. It is defined on page 17 of<br>                  the document: TNA-CS13 (Cataloguing Standards - <br>                  Part A Data Elements, June 2013).&quot;@en ;<br>    rdfs:seeAlso tna:cs13-a, schema:identifier, dct:identifier<br>    .<br>    <br>tna:cs13-a<br>    a owl:Class ;<br>    rdfs:label   &quot;Cataloguing Standards - Part A Data Elements,<br>                  June 2013&quot; ;<br>    rdfs:comment &quot;Describes the various Catalogue Elements derived<br>                  from ISAD(G) to manage descriptive data which<br>                  is available in PROCAT Editorial.&quot;@en<br>    .</pre><p><em>— Describing the Schemes of our Secondary Identifiers.</em></p><h3>Further Compromise for Human Use</h3><p>We had chosen to reuse schema:identifier for our secondary identifiers because we had reserved dct:identifier for our primary identifier, and we wanted to follow our guiding rule of reusing common vocabularies wherever possible.</p><p>However, I feel that we have not yet arrived at a good solution. Perhaps, there is a different approach that we might take that would yield a more favourable balance between human understandability, precision or our data, and computability by machines?</p><p>What about if we took a similar approach to that which we ultimately proposed in <a href="https://medium.com/the-national-archives-digital/reusing-standard-rdf-vocabularies-part-1-5a9bbfa58b85">Part 1</a>? That is to say, that we could derive our own property(s) for secondary identifiers from an existing one, thus reusing the common definition yet adding further meaning. Of course we must still be very considerate of human users, and wisely choose straight-forward or obvious generic names for such properties so as to help them infer their purpose.</p><p>Whilst we can’t use dct:identifier directly for our secondary identifiers, there is nothing to stop us deriving our own properties for secondary identifiers from it!</p><pre>@prefix owl      &lt;<a href="http://www.w3.org/2002/07/owl#">http://www.w3.org/2002/07/owl#</a>&gt; .<br>@prefix rdfs     &lt;<a href="http://www.w3.org/2000/01/rdf-schema#">http://www.w3.org/2000/01/rdf-schema#</a>&gt; .<br>@prefix xsd:     &lt;<a href="http://www.w3.org/2001/XMLSchema#">http://www.w3.org/2001/XMLSchema#</a>&gt; .<br>@prefix tna:     &lt;<a href="http://www.nationalarchives.gov.uk/">http://www.nationalarchives.gov.uk/</a>&gt; .<br>@prefix dct:     &lt;<a href="http://purl.org/dc/terms/">http://purl.org/dc/terms/</a>&gt; .<br><br>tna:classicCatalogueReference<br>    a owl:DatatypeProperty ;<br>    rdfs:subPropertyOf dct:identifier<br>    rdfs:range xsd:string ;<br>    rdfs:label   &quot;Classic Catalogue Reference&quot; ;<br>    rdfs:comment &quot;The Classic Catalogue Reference is a secondary<br>                  identifier for a Unit of Description. It reflects<br>                  the historic ISAD(G) like archival arrangement of<br>                  the unit, i.e Department, Series, Piece, and Item.<br>                  It has been in use at The National Archives since<br>                  the 19th century and is aligned to the ISAD(G)<br>                  standard. It is defined on page 13 of the<br>                  document: TNA-CS13 (Cataloguing Standards - Part A<br>                  Data Elements, June 2013).&quot;@en ;<br>    rdfs:seeAlso  tna:cs13-a, schema:identifier, dct:identifier<br>    .<br><br>tna:formerReferenceFromDepartment<br>    a owl:DatatypeProperty ;<br>    rdfs:range xsd:string ;<br>    rdfs:subPropertyOf dct:identifier ;<br>    rdfs:label   &quot;Former Reference - Creating Department&quot; ;<br>    rdfs:comment &quot;The &#39;Former Reference - Creating Department&#39; is a<br>                  secondary identifier for a Unit of Description. It<br>                  holds the unique identifier given to the material<br>                  by the originating creator. It is defined on page<br>                  17 of the document: TNA-CS13 (Cataloguing<br>                  Standards - Part A Data Elements,<br>                  June 2013).&quot;@en ;<br>    rdfs:seeAlso  tna:cs13-a<br>    .</pre><p><em>— Definition of our derived properties for two of our Secondary Identifiers.</em></p><p>Using our own derived properties would then yield an expression for our Record that looks something like:</p><pre>@prefix tna:     &lt;<a href="http://www.nationalarchives.gov.uk/">http://www.nationalarchives.gov.uk/</a>&gt; .<br>@prefix dct:     &lt;<a href="http://purl.org/dc/terms/">http://purl.org/dc/terms/</a>&gt; .<br>@prefix schema:  &lt;<a href="https://schema.org/">https://schema.org/</a>&gt; .<br><br>tna:res.FO.2020.3J.P.1<br>    dct:identifier &quot;FO.2020.3J.P.1&quot; ;<br>    tna:classicCatalogueReference &quot;FO 12/34/56&quot; ;<br>    tna:formerReferenceFromDepartment &quot;R123456&quot;<br>    .</pre><p><em>— A Record with Primary and Secondary Identifier — Bespoke Vocabulary.</em></p><p>I believe that this final approach strikes a good compromise. Whilst we are not directly reusing an existing common vocabulary here for our secondary identifiers, we have a good reason, which is that schema:identifier is not a good fit for use considering our use-case. However, all is not lost, whilst we have had to create our own properties, they themselves are derived from a property ( dct:identifier) from an existing common vocabulary (Dublin Core Terms). Additionally, and very subjectively, I would argue that it is much easier for humans to understand a single line which says tna:formerReferenceFromDepartment than looking within data or object properties of schema:identifier.</p><h3>Conclusion</h3><p>Although we started out with a different problem, and tried different approaches along the way, we ultimately ended up with an approach that looks remarkably similar to that in <a href="https://medium.com/the-national-archives-digital/reusing-standard-rdf-vocabularies-part-1-5a9bbfa58b85">Part 1</a>.</p><p>Hopefully this has re-enforced the idea that when attempting to solely reuse existing popular vocabularies, if you falter due a lack of suitable available classes and properties, there are options available, but there are trade-offs that have to be made between reuse and precision.</p><p><em>Originally published at </em><a href="https://blog.adamretter.org.uk/vocabulary-reuse-part2/"><em>https://blog.adamretter.org.uk</em></a><em> on March 24, 2021.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4e4a3ad0bbf5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-national-archives-digital/reusing-standard-rdf-vocabularies-part-2-4e4a3ad0bbf5">Reusing Standard RDF Vocabularies — Part 2</a> was originally published in <a href="https://medium.com/the-national-archives-digital">The National Archives Digital</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Reusing Standard RDF Vocabularies — Part 1]]></title>
            <link>https://medium.com/the-national-archives-digital/reusing-standard-rdf-vocabularies-part-1-5a9bbfa58b85?source=rss-c95baf8f8cb8------2</link>
            <guid isPermaLink="false">https://medium.com/p/5a9bbfa58b85</guid>
            <category><![CDATA[vocabulary]]></category>
            <category><![CDATA[rdf]]></category>
            <category><![CDATA[catalogue]]></category>
            <category><![CDATA[records-management]]></category>
            <category><![CDATA[national-archives]]></category>
            <dc:creator><![CDATA[Project Omega at The National Archives]]></dc:creator>
            <pubDate>Wed, 17 Mar 2021 17:05:09 GMT</pubDate>
            <atom:updated>2021-03-18T14:38:56.163Z</atom:updated>
            <content:encoded><![CDATA[<h3>Reusing Standard RDF Vocabularies — Part 1</h3><p><em>This is a guest blog post by Adam Retter of </em><a href="https://www.evolvedbinary.com/"><em>Evolved Binary</em></a><em>, who is acting as consultant Technical Architect on Project Omega for The National Archives…</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ozQAdpLOiNtIyypC" /></figure><p>In Phase 1 of Project Omega at TNA (<a href="https://www.nationalarchives.gov.uk/">The National Archives</a>) we evaluated several different existing models and vocabularies/ontologies to ascertain their suitability for expressing the data of TNA’s new Pan-Archival Catalogue. We published a fairly comprehensive report of our findings and proposed a way forward: <a href="https://www.nationalarchives.gov.uk/documents/omega-catalogue-model-proposal.pdf">Catalogue Model Proposal</a>.</p><p>In summary, we felt that none of the existing models were perfect. We recognised that ICA’s RiC (International Council on Archives’ Record in Contexts) was very promising but currently under-developed for TNA’s needs. Ultimately, we felt that the approach taken in developing <a href="https://ipres2019.org/static/proceedings/iPRES2019.pdf#page=271">The Matterhorn RDF Data Model</a> had a lot of strengths and that we would take a similar path.</p><p>We decided that the new Data Model for Project Omega would:</p><ol><li>attempt to adhere to the broader principles of <a href="https://www.ica.org/en/egad-ric-conceptual-model">RiC’s Conceptual Model</a>, but discard <a href="https://www.ica.org/en/records-in-contexts-ontology">RiC’s Ontology</a>.</li><li>follow the approach of The Matterhorn RDF Data Model, i.e. reuse existing vocabularies and NOT create our own.</li></ol><p>We started with the model specified in Matterhorn and added additional properties and classes from other shared and standardised vocabularies as we needed. The (work-in-progress) documentation of our data model: <a href="https://www.nationalarchives.gov.uk/documents/omega-catalogue-data-model.pdf">Omega Catalogue Data Model</a>.</p><p>Now that we are in Phase 2 of Project Omega and exporting data into this data model in the form of Turtle RDF, we are starting to revisit some of our initial assumptions about reuse.</p><h4>Shared Language vs. Precision</h4><p>The beauty of reusing existing vocabularies (assuming that you choose popular and standardised ones), is that any developer, data scientist, or user who has worked with RDF before can likely already understand and work with our data. For example let’s consider a simplified description of a Record:</p><pre>@prefix tna:     &lt;<a href="http://www.nationalarchives.gov.uk/">http://www.nationalarchives.gov.uk/</a>&gt; .<br>@prefix dct:     &lt;<a href="http://purl.org/dc/terms/">http://purl.org/dc/terms/</a>&gt; .<br><br>tna:res.FO.2020.3J.P.1<br>    dct:identifier &quot;FO.2020.3J.P.1&quot; ;<br>    dct:description &quot;This is a Foreign Office record about...&quot; ;<br>    .</pre><p><em>— Record with an Identifier and Description that reuse common vocabularies.</em></p><p>DCT (Dublin Core Terms) is a vocabulary that has been around since 2008 and its use is ubiquitous. Even if somehow the user was not aware of Dublin Core, the naming of the terms is straight-forward. As a human I can likely infer the meaning of dct:identifier as holding an identifier for the resource, and dct:description as holding a description of the resource. If you felt the need to, you could confirm your suspicions by checking the Dublin Core standard document itself, however, the point here is that you didn&#39;t have to, the meaning is already known or at least almost-obvious. This is a major benefit of reusing popular vocabularies as it both reduces the cognitive load for those working with the data, and enables us to form and use a shared language even when working with vastly different datasets.</p><p>On the flip-side, the disadvantage of reusing popular shared vocabularies is that they are often, by design, quite generic in their definitions. This is of course by necessity, common terms acceptable to a wide-audience need to be agreeable by that audience, and so generic and/or vaguely defined terms are more palatable.</p><p>Defining your own vocabulary has the absolute advantage of allowing you to precisely define your world-view and exactly what you mean. That’s powerful stuff!</p><p>By way of contrast consider the same record expressed in a (fictional) bespoke vocabulary:</p><pre>@prefix tna:     &lt;<a href="http://www.nationalarchives.gov.uk/">http://www.nationalarchives.gov.uk/</a>&gt; .<br><br>tna:res.FO.2020.3J.P.1<br>    tna:oci &quot;FO.2020.3J.P.1&quot; ;<br>    tna:scope-content &quot;This is a Foreign Office record about...&quot; ;<br>    .</pre><p><em>— Record with an Identifier and Description that use bespoke vocabulary</em>.</p><p>If you work in the Archives sector you might well guess that tna:scope-content holds the <em>Scope and Content</em> of the record... but how many people outside of the Archives sector know exactly what is meant by the &quot;Scope and Content&quot; of a record? Even then, you likely wouldn&#39;t know the meaning of tna:oci! It&#39;s the <em>Omega Catalogue Identifier</em>, and awareness of that is not even organisation-wide throughout TNA yet.<br>We would of course write OWL and documentation to define exactly what tna:oci and tna:scope-content mean, but the user has to go and read those before they can work with the data.</p><p><strong>The trade-off is ultimately: </strong>Ease of consumption through reuse of Shared Vocabularies vs. Precisely/Correctly expressing your domain and data.</p><h4>When and how to trade-off?</h4><p>In Omega our underlying principle is to always attempt reuse first. We are discovering that sometimes however there just isn’t an appropriate Property or Class that can be reused from a popular standardised vocabulary.</p><p>By way of an example let me explain a use-case that we recently had to solve for Project Omega. TNA’s Catalogue currently contains Covering Dates for each Unit of Description (a single document of folder). These <em>covering dates</em> are the period-of-time during which the record(s) being described were created. They are expressed using between 1 and 3 values: The <em>Date Text</em> (as it appears on the unit of description), the <em>First Date</em> (the start of the period), and the <em>Last Date</em> (the end of the period).</p><p>Originally we had decided to use a property from a common vocabulary to express these, Dublin Core Terms (perhaps you know it!). The property we initially selected was dct:temporal. As I interpret the DCT (Dublin Core Terms) standard, it appears to me that dct:temporal is intended to describe the <em>temporal coverage</em> of the resource, i.e. the time period discussed/indicated within the resource as opposed to the date that the resource was created. So after further consideration, we decided to use something else instead of dct:temporal, and this is where we had to start making trade-offs.</p><p>The options we considered:</p><ol><li>Use dct:created instead.<br>Unfortunately dct:created is a Data Type Property and so requires a literal value, yet we need to store 3 literal values (<em>Date Text</em>,<em> First Date</em>, and <em>Last Date</em>). To achieve this we could either:<br>a) Encode the 3 literal values into 1 literal value using <a href="https://www.iso.org/iso-8601-date-and-time-format.html">ISO 8601-1</a>, <a href="https://www.w3.org/TR/NOTE-datetime">W3CDTF</a>, <a href="https://www.loc.gov/standards/datetime/">EDTF</a>, or <a href="https://www.dublincore.org/specifications/dublin-core/dcmi-period/">DCMI Period</a>. This has the downside that querying this with SPARQL becomes complex and requires various string split operations. For example, encoding using DCMI Period might produce the single literal string value:<br>name=1941-1951; scheme=W3C-DTF; start=1941-01-01Z; end=1951-01-01Z.<br>b) Ignore Dublin Core specifics here, and use an Object Property. We could somewhat enforce this approach with SHACL and documentation. However, those that are used to Dublin Core may be surprised; SPARQL queries for dct:created would be different in our system than other systems. This negates the advantage of using a property from a shared standardised vocabulary!</li><li>Use time:hasTime instead.<br>This is a generic property from the <a href="https://www.w3.org/TR/owl-time/">W3C Time Ontology in OWL</a>. This is an Object Property that allows us to express our covering dates exactly as we would need. Unfortunately tme:hasTime only tells us that there is a time, not what that time represents. It is too generic and fails to adequately describe that these are the created dates of the records; dct:created would have been much more precise!</li><li>Create our own vocabulary property.<br>We have two main options of how to approach this:<br>a) Define our own standalone property in our own vocabulary.<br>b) If there is a property from a common vocabulary that is close to what we need, we can define our own property which is derived from that.</li></ol><p>Whilst dct:created infers (to a human) the meaning that we are looking for it, doesn&#39;t allow us to store the information we need. The time:hasTime property is the opposite, it lacks a sufficient precise meaning, but allows great flexibility in how we store our covering dates. Therefore, as there is no readily suitable property from a common vocabulary we have little choice but to create our own!</p><p>As the property time:hasTime allows us to store the data we need, but is lacking in sufficient descriptive power, rather than defining our own standalone property, we can instead derive our property from time:hasTime and add further descriptive information. Our new derived property will be tna:created and could look something like this:</p><pre>@prefix owl      &lt;<a href="http://www.w3.org/2002/07/owl#">http://www.w3.org/2002/07/owl#</a>&gt; .<br>@prefix rdfs     &lt;<a href="http://www.w3.org/2000/01/rdf-schema#">http://www.w3.org/2000/01/rdf-schema#</a>&gt; .<br>@prefix tna:     &lt;<a href="http://www.nationalarchives.gov.uk/">http://www.nationalarchives.gov.uk/</a>&gt; .<br>@prefix dct:     &lt;<a href="http://purl.org/dc/terms/">http://purl.org/dc/terms/</a>&gt; .<br>@prefix time:    &lt;<a href="http://www.w3.org/2006/time#">http://www.w3.org/2006/time#</a>&gt; .<br>@prefix rdae:    &lt;<a href="http://rdaregistry.info/Elements/e/">http://rdaregistry.info/Elements/e/</a>&gt; .<br><br>tna:created<br>    a owl:ObjectProperty ;<br>    rdfs:subPropertyOf time:hasTime ;<br>    rdfs:label &quot;Created date&quot; ;<br>    rdfs:comment &quot;The date that the resource was created, or the<br>                  date-period during which the resource was created.<br>                  Historically at The National Archives, this has<br>                  also been known as the &#39;Covering Dates&#39; (of the<br>                  Unit of Description).&quot;@en ;<br>    rdfs:seeAlso dct:created, rdae:P20214<br>    .</pre><p><em>— Definition of our derived property for Covering Dates.</em></p><p>The above definition of tna:created declares it as a sub-property of time:hasTime but gives further information about its use, and also informs us that additional information can be found by looking at dct:created and rdae:P20214.</p><p>In practical use our earlier RDF augmented with our Covering Dates now finally looks something like:</p><pre>@prefix tna:     &lt;<a href="http://www.nationalarchives.gov.uk/">http://www.nationalarchives.gov.uk/</a>&gt; .<br>@prefix dct:     &lt;<a href="http://purl.org/dc/terms/">http://purl.org/dc/terms/</a>&gt; .<br>@prefix time:    &lt;<a href="http://www.w3.org/2006/time#">http://www.w3.org/2006/time#</a>&gt; .<br>@prefix xsd:     &lt;<a href="http://www.w3.org/2001/XMLSchema#">http://www.w3.org/2001/XMLSchema#</a>&gt; .<br><br>tna:res.FO.2020.3J.P.1<br>    dct:identifier &quot;FO.2020.3J.P.1&quot; ;<br>    dct:description &quot;This is a Foreign Office record about...&quot; ;<br>    tna:created [<br>        a       time:ProperInterval ;<br>        dct:description &quot;1941-1951&quot; ;<br>        time:hasBeginning [<br>            a       time:Instant ;<br>            time:inXSDDate &quot;1941-01-01Z&quot;^^xsd:date<br>        ] ;<br>        time:hasEnd [<br>            a       time:Instant ;<br>            time:inXSDDate &quot;1951-12-31Z&quot;^^xsd:date<br>        ]<br>    ]<br>    .</pre><p><em>— Record with an Identifier, Description, and Created Dates.</em></p><p>We still utilise dct:identifier and dct:description above, because they are a good fit for our reuse. Whilst the new tna:created demonstrates our trade-off perfectly!</p><p>Earlier, I explained that we had wanted to reuse dct:created because it is a property that is widely used and understood, but that it was unsuitable for storing our covering dates (as it is specified as a Data Type Property).<br>As we could not find a suitable property from an existing popular vocabulary that we could reuse, we were forced to create our own. This property, tna:created, has two important design aspects:</p><ol><li>It’s name is straight forward. Even someone from outside of the Archival sector can likely guess it’s meaning and purpose. It’s unlikely that someone would have to look at our OWL definition or documentation to be able to <em>start </em>working with it. It’s very much intentional that at a glance it looks a lot like dct:created.</li><li>Whilst this property is TNA specific and explicates a precise meaning, it does not standalone. Instead, it reuses the W3C Time Ontology in OWL (a popular vocabulary itself) by virtue of being derived from the time:hasTime property.</li></ol><h3>Conclusion</h3><p>For Project Omega — we still prefer reuse wherever possible as it enables easier consumption by others. Creating a new Property or Class (even if derived from a common vocabulary) is sometimes unavoidable, but should be considered as an absolute last resort and undertaken only when no common property exists, or said property fails to adequately describe the data.</p><p>Hopefully this article has provided you with some insight into the challenges that arise when strictly trying to reuse existing vocabularies, and the trade-offs that may have to be made.</p><p><em>Originally published at </em><a href="https://blog.adamretter.org.uk/vocabulary-reuse-part1"><em>https://blog.adamretter.org.uk</em></a><em> on March 17, 2021.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5a9bbfa58b85" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-national-archives-digital/reusing-standard-rdf-vocabularies-part-1-5a9bbfa58b85">Reusing Standard RDF Vocabularies — Part 1</a> was originally published in <a href="https://medium.com/the-national-archives-digital">The National Archives Digital</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Extreme Identifiers (for use in URIs)]]></title>
            <link>https://medium.com/the-national-archives-digital/extreme-identifiers-for-use-in-uris-cae773b98cf7?source=rss-c95baf8f8cb8------2</link>
            <guid isPermaLink="false">https://medium.com/p/cae773b98cf7</guid>
            <dc:creator><![CDATA[Project Omega at The National Archives]]></dc:creator>
            <pubDate>Wed, 17 Jun 2020 09:38:38 GMT</pubDate>
            <atom:updated>2020-06-24T09:07:43.990Z</atom:updated>
            <content:encoded><![CDATA[<p><em>This is a guest blog post by Adam Retter of </em><a href="https://www.evolvedbinary.com/"><em>Evolved Binary</em></a><em>, who is acting as a consultant on Project Omega for The National Archives…</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HbdpR3LwpyE9qFKp" /><figcaption>pPhoto by <a href="https://unsplash.com/@kpietrzakweb?utm_source=medium&amp;utm_medium=referral">Kamil Pietrzak</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Recently I have been thinking about how Identifiers for things should be constructed. More specifically, as part of Project Omega for TNA (<a href="https://www.nationalarchives.gov.uk/">The National Archives</a>), I have been thinking about identifiers for resources in RDF. This blog post continues on from my previous posts: <a href="https://blog.adamretter.org.uk/archival-identifiers-for-digital-files/">Archival Identifiers for Digital Files</a>, and <a href="https://blog.adamretter.org.uk/archival-catalog-identifiers/">Archival Catalogue Record Identifiers</a>.</p><p>Whilst this article frames the content in the context of RDF and Archives, the principles are much more widely applicable. This blog post shows how to efficiently encode any positive numeric integer into a URI.</p><p>A resource in RDF is identified by a URI and that URI often consists of two major components, first a <em>base URI</em>, and then some sort of (domain specific) <em>local identifier</em>. For example:</p><ul><li>A base URI: <a href="http://cat.nationalarchives.gov.uk/">http://cat.nationalarchives.gov.uk</a></li><li>A local identifier: Record12345</li><li>The final URI: http://cat.nationalarchives.gov.uk/Record12345</li></ul><p>One of the types of resource that we need to describe in RDF is that of a <em>Digital File,</em> you can think of it simply as a file on your computer. It is the identifiers of those digital files that we will concern ourselves with in this article.</p><p>In my recent article — <a href="https://medium.com/the-national-archives-digital/archival-identifiers-for-digital-files-c448ff463c22">Archival Identifiers for Digital Files</a>, I covered two different identifier schemes for Digital File: <a href="https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)">UUID</a> (Universally Unique Identifier), and ACID (Archival Content Identifier). One thing that bothered me was the length of the presentation representation (i.e. <a href="https://en.wikipedia.org/wiki/Hexadecimal">hexadecimal</a> encoding) of those identifiers.</p><p>If for a moment we ignore the <em>Hash Function Type</em> prefix of the ACID scheme, we can recognise that each scheme is really just generating a large positive integer! As hexadecimal has a numeric base of 16, i.e. there are only 16 symbols in its alphabet, we might likewise recognise that it is perhaps not the most efficient presentation representation.</p><p>Our Digital File identifier will ultimately form the local identifier component of our RDF resource URI. What would be the most efficient way to encode that Digital File identifier into a URI?</p><h3>Encoding a Number into a URI Path</h3><p>If we wanted to encode any positive integer (i.e. <a href="https://en.wikipedia.org/wiki/Decimal">Base10</a>) into a URI path as efficiently as possible, we first need to create an alphabet that utilizes every possible character that can be legally expressed within the path of a URI. Once we have that alphabet we can encode a Base10 number into a Base <em>N</em> number, where <em>N</em> is the number of characters in our new alphabet.</p><p>I took the following steps to create such an alphabet:</p><ol><li>Start with all possible path characters for use in a URI from <a href="https://www.ietf.org/rfc/rfc2396.txt">RFC 2396</a>. These are defined as pchar in section 3.3 of the RFC.</li><li>Eliminate escaped characters by removing the % character. An escaped character is modelled in a URI by using the % character and then two hexadecimal characters. We are interested in using the least characters possible, so using 3 characters here to represent 1 character is the opposite of what we want to do!</li><li>(optional) Eliminate the English vowels — A, E, I, O, and U, and a, e, i, o, and u. We don&#39;t want to incidentally create meaningful words! This is a requirement for TNA; if they were to publish their RDF as Linked Data, then such encoded numbers would become publicly visible.</li><li>Sort the remaining characters byte-wise by their UTF-8 numeric value.</li></ol><p>Following these steps yields an alphabet of 78 characters, or if you perform the optional Step 3, then 68 characters.</p><pre>| Numeric Value | Encoded Symbol |<br>|---------------|----------------|<br>| 0             | !              |<br>| 1             | $              |<br>| 2             | &amp;              |<br>| 3             | &#39;              |<br>| 4             | (              |<br>| 5             | )              |<br>| 6             | *              |<br>| 7             | +              |<br>| 8             | ,              |<br>| 9             | -              |<br>| 10            | .              |<br>| 11            | 0              |<br>| 12            | 1              |<br>| 13            | 2              |<br>| 14            | 3              |<br>| 15            | 4              |<br>| 16            | 5              |<br>| 17            | 6              |<br>| 18            | 7              |<br>| 19            | 8              |<br>| 20            | 9              |<br>| 21            | :              |<br>| 22            | =              |<br>| 23            | @              |<br>| 24            | B              |<br>| 25            | C              |<br>| 26            | D              |<br>| 27            | F              |<br>| 28            | G              |<br>| 29            | H              |<br>| 30            | J              |<br>| 31            | K              |<br>| 32            | L              |<br>| 33            | M              |<br>| 34            | N              |<br>| 35            | P              |<br>| 36            | Q              |<br>| 37            | R              |<br>| 38            | S              |<br>| 39            | T              |<br>| 40            | V              |<br>| 41            | W              |<br>| 42            | X              |<br>| 43            | Y              |<br>| 44            | Z              |<br>| 45            | _              |<br>| 46            | b              |<br>| 47            | c              |<br>| 48            | d              |<br>| 49            | f              |<br>| 50            | g              |<br>| 51            | h              |<br>| 52            | j              |<br>| 53            | k              |<br>| 54            | l              |<br>| 55            | m              |<br>| 56            | n              |<br>| 57            | p              |<br>| 58            | q              |<br>| 59            | r              |<br>| 60            | s              |<br>| 61            | t              |<br>| 62            | v              |<br>| 63            | w              |<br>| 64            | x              |<br>| 65            | y              |<br>| 66            | z              |<br>| 67            | ~              |</pre><p>Our 68 characters can yield a Base68 representation, which is much more compact than a Base16 (hexadecimal) representation.</p><p>Encoding from Base10 to any other base is performed by a common recursive mathematical function. How this is achieved is not particularly relevant, but for both completeness and those readers that are interested, I have written an expression of it for encoding to Base68 using the Scala programming language:</p><pre>/**<br> * Encodes a Base10 positive integer to a Base68 String.<br> *<br> * <a href="http://twitter.com/param">@param</a> value a positive integer<br> * <a href="http://twitter.com/return">@return</a> the encoded representation<br> */<br>def encode(value: BigInt): String = {</pre><pre>  val b68Alphabet = Seq(<br>    &#39;!&#39;, &#39;$&#39;, &#39;&amp;&#39;, &#39;&#39;&#39;, &#39;(&#39;, &#39;)&#39;, &#39;*&#39;, &#39;+&#39;, &#39;,&#39;, &#39;-&#39;, &#39;.&#39;,<br>    &#39;0&#39;, &#39;1&#39;, &#39;2&#39;, &#39;3&#39;, &#39;4&#39;, &#39;5&#39;, &#39;6&#39;, &#39;7&#39;, &#39;8&#39;, &#39;9&#39;, &#39;:&#39;,<br>    &#39;=&#39;, &#39;@&#39;, &#39;B&#39;, &#39;C&#39;, &#39;D&#39;, &#39;F&#39;, &#39;G&#39;, &#39;H&#39;, &#39;J&#39;, &#39;K&#39;, &#39;L&#39;,<br>    &#39;M&#39;, &#39;N&#39;, &#39;P&#39;, &#39;Q&#39;, &#39;R&#39;, &#39;S&#39;, &#39;T&#39;, &#39;V&#39;, &#39;W&#39;, &#39;X&#39;, &#39;Y&#39;,<br>    &#39;Z&#39;, &#39;_&#39;, &#39;b&#39;, &#39;c&#39;, &#39;d&#39;, &#39;f&#39;, &#39;g&#39;, &#39;h&#39;, &#39;j&#39;, &#39;k&#39;, &#39;l&#39;,<br>    &#39;m&#39;, &#39;n&#39;, &#39;p&#39;, &#39;q&#39;, &#39;r&#39;, &#39;s&#39;, &#39;t&#39;, &#39;v&#39;, &#39;w&#39;, &#39;x&#39;, &#39;y&#39;,<br>    &#39;z&#39;, &#39;~&#39;<br>  )<br>  val len = b68Alphabet.length</pre><pre><a href="http://twitter.com/tailrec">  @tailrec</a><br>  def encode(v: BigInt, accum: List[Char]): String = {<br>    if(v == 0 &amp;&amp; accum.nonEmpty) {<br>      accum.mkString<br>    } else if(v &lt;= 1) {<br>      (b68Alphabet(v.toInt) :: accum).mkString<br>    } else {<br>      val div = v / len<br>      val mod = v % len<br>      encode(div, b68Alphabet(mod.toInt) :: accum)<br>    }<br>  }</pre><pre>  encode(value, List.empty[Char])<br>}</pre><p><strong>Examples</strong></p><p>Let’s look at some examples of what these encoded identifiers look like.</p><ol><li>A Version 4 UUID in its default hexadecimal representation: d879f8b2-5f67-495d-8796-5ce5b06ba238, consists of 36 characters and is equivalent to the Base10 number: 287746559179145117594110380901673968184.<br>If we instead encode the Base10 number into our Base68 alphabet this yields the string: xDZTz4*0-L0+S5V@4wFZB, which is just 21 characters in length. Compared to the default hexadecimal representation, this is a saving of 15 characters, i.e. ~42%.</li><li>An ACID in its default hexadecimal representation: !3cbae8f16217ad44981e5843100092cd582202e69d452eb094480f2d24abdb49, after dropping the ! character (for the <em>Hash Function Type</em> prefix), consists of 64 characters and is equivalent to the Base10 number: 27469012181874709647382529974656231352255408628267256258746051793118097562441.<br>If we instead encode the Base10 number into our Base68 alphabet this yields the string: 94TTsZ-tsvNkZzcM2jWXYCy,ym4d1XZ8N7).8:N9v6, which is just 42 characters in length. Compared to the default hexadecimal representation, this is a saving of 22 characters, i.e. ~34%.</li></ol><p>Our Digital File resource URI would now look like:</p><ol><li>A UUID based identifier for a Digital File using Base68:<br>http://cat.nationalarchives.gov.uk/xDZTz4*0-L0+S5V@4wFZB</li><li>An ACID based identifier for a Digital File using Base68 (with the<em> Hash Function Type</em> prefix reinstated):<br><a href="http://cat.nationalarchives.gov.uk/!94TTsZ-tsvNkZzcM2jWXYCy,ym4d1XZ8N7).8:N9v6">http://cat.nationalarchives.gov.uk/!94TTsZ-tsvNkZzcM2jWXYCy,ym4d1XZ8N7).8:N9v6</a></li></ol><p>Do these Base68 encoded identifiers look ugly to the human eye? Absolutely!<br>But… I did not design them for human-use or even to be humane! ;-) Instead, this encoding scheme is designed to fit the identifier for a Digital File (a number), into a URI as succinctly as possible, whilst still yielding a valid URI. I expect these URIs to be used by machines and not humans!</p><p>Is this a good solution? It certainly meets the requirements I set out, and it feels computationally neat. In practice, it likely needs further thought and experimentation. Will these identifies prove too cumbersome for developers writing SPAQL queries against our data? Possibly!</p><p><strong>Decoding from Base68</strong></p><p>Finally, decoding from Base <em>N</em> to Base10 is performed by a very simple table lookup against our alphabet. Like encoding, how this is achieved is not particularly relevant, but again for both completeness and those readers that are interested, I have included a decoder from Base68 using the Scala programming language:</p><pre>/**<br> * Decodes a Base68 string to a Base10 positive integer.<br> *<br> * <a href="http://twitter.com/param">@param</a> str the encoded representation<br> * <a href="http://twitter.com/return">@return</a> a positive integer<br> */<br>def decode(str: String): BigInt = {</pre><pre>  val b68Alphabet = Seq(<br>    &#39;!&#39;, &#39;$&#39;, &#39;&amp;&#39;, &#39;&#39;&#39;, &#39;(&#39;, &#39;)&#39;, &#39;*&#39;, &#39;+&#39;, &#39;,&#39;, &#39;-&#39;, &#39;.&#39;,<br>    &#39;0&#39;, &#39;1&#39;, &#39;2&#39;, &#39;3&#39;, &#39;4&#39;, &#39;5&#39;, &#39;6&#39;, &#39;7&#39;, &#39;8&#39;, &#39;9&#39;, &#39;:&#39;,<br>    &#39;=&#39;, &#39;@&#39;, &#39;B&#39;, &#39;C&#39;, &#39;D&#39;, &#39;F&#39;, &#39;G&#39;, &#39;H&#39;, &#39;J&#39;, &#39;K&#39;, &#39;L&#39;,<br>    &#39;M&#39;, &#39;N&#39;, &#39;P&#39;, &#39;Q&#39;, &#39;R&#39;, &#39;S&#39;, &#39;T&#39;, &#39;V&#39;, &#39;W&#39;, &#39;X&#39;, &#39;Y&#39;,<br>    &#39;Z&#39;, &#39;_&#39;, &#39;b&#39;, &#39;c&#39;, &#39;d&#39;, &#39;f&#39;, &#39;g&#39;, &#39;h&#39;, &#39;j&#39;, &#39;k&#39;, &#39;l&#39;,<br>    &#39;m&#39;, &#39;n&#39;, &#39;p&#39;, &#39;q&#39;, &#39;r&#39;, &#39;s&#39;, &#39;t&#39;, &#39;v&#39;, &#39;w&#39;, &#39;x&#39;, &#39;y&#39;,<br>    &#39;z&#39;, &#39;~&#39;<br>  )<br>  val len = b68Alphabet.length</pre><pre>  val indicies = str.map(b68Alphabet.indexOf(_))<br>  val vs: Seq[BigInt] = for(i &lt;- 0 to indicies.length - 1) yield {<br>    val exp = (indicies.length - i) - 1<br>    indicies(i) * BigInt(len).pow(exp)<br>  }<br>  vs.reduceLeft(_ + _)<br>}</pre><p><strong>Open Source</strong></p><p>More complete encoders and decoders can be found on GitHub implemented in both Scala: <a href="https://github.com/nationalarchives/oci-tools-scala">oci-tools-scala</a>, and TypeScript: <a href="https://github.com/nationalarchives/oci-tools-scala">oci-tools-typescript</a>.</p><p><em>Originally published at </em><a href="https://blog.adamretter.org.uk/extreme-identifiers-for-uri/"><em>https://blog.adamretter.org.uk</em></a><em> on June 17, 2020.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cae773b98cf7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-national-archives-digital/extreme-identifiers-for-use-in-uris-cae773b98cf7">Extreme Identifiers (for use in URIs)</a> was originally published in <a href="https://medium.com/the-national-archives-digital">The National Archives Digital</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Archival Identifiers for Digital Files]]></title>
            <link>https://medium.com/the-national-archives-digital/archival-identifiers-for-digital-files-c448ff463c22?source=rss-c95baf8f8cb8------2</link>
            <guid isPermaLink="false">https://medium.com/p/c448ff463c22</guid>
            <category><![CDATA[digital-preservation]]></category>
            <category><![CDATA[records-management]]></category>
            <category><![CDATA[catalogue]]></category>
            <category><![CDATA[identifier]]></category>
            <category><![CDATA[national-archives]]></category>
            <dc:creator><![CDATA[Project Omega at The National Archives]]></dc:creator>
            <pubDate>Tue, 09 Jun 2020 18:36:16 GMT</pubDate>
            <atom:updated>2020-06-16T10:44:36.355Z</atom:updated>
            <content:encoded><![CDATA[<p><em>This is a guest blog post by Adam Retter of </em><a href="https://www.evolvedbinary.com/"><em>Evolved Binary</em></a><em>, who is acting as a consultant on Project Omega for The National Archives…</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TEjSryAGFmWuOND7" /></figure><p>As part of Project Omega for TNA ( <a href="https://www.nationalarchives.gov.uk/">The National Archives</a>), I have been thinking about how identifiers for Digital Files should be constructed. This blog entry continues on from my previous entry: <a href="https://medium.com/the-national-archives-digital/archival-catalogue-record-identifiers-29b0a1fac9ba">Archival Catalogue Record Identifiers</a>.</p><p>When considering development of a new archival catalogue that can describe both physical, digitised, and born digital records, we quickly realised that unlike its predecessors this catalogue will also need to describe digital files.</p><p>At this point you might think that I am mixing current concerns between what archives’ have often thought of as two separate systems, 1) their Archival catalogue, and 2) their Digital Preservation system. Yes, I am, and intentionally so! However, I would argue that this soup has been cooking for some time; I have seen that until now digital preservation systems have had to include some aspect of cataloguing (for their digital records) as the traditional archival catalogues, that were already in-place, were ill-equipped to describe the new digital world. I believe that a clean and mutually-beneficial separation between cataloguing and (digital) preservation activities can be established, but that as practitioners we are still very much writing the book on digital preservation.</p><p>Anyway, I digress! The archival concept of a Digital File is a complex one, as archivists we have to ask difficult questions like:</p><ul><li>What is a digital file?</li><li>How do I describe a digital file?</li><li>Is a copy of a file the same digital file?</li><li>If I change the name of the file, is it still the same digital file?</li></ul><p>All of these things have to be considered when designing a scheme for local identifiers of Digital File. Without writing an extended article on various principles of digital preservation, it is perhaps enough to say that the file’s path and/or name are not suitable for use as an identifier; in no small part due to both their transient nature, and inability to be combined with files from other systems which may cause rise to naming conflicts.</p><h3>The Current Approach</h3><p>To date the predominant approach in digital preservation for generating identifiers for digital files has been to simply assign them a <a href="https://en.wikipedia.org/wiki/Universally_unique_identifier">UUID</a> (Universally Unique Identifier); more specifically a Version 4 UUID. This approach has several nice properties:</p><ul><li>These can be generated independently of each other.<br>You can just <em>magic</em> a UUID into existence without concern for other UUIDs that have gone before or come after it.<br>The chance of a collision is <a href="https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)#Collisions">incredibly small</a> — “ <em>the probability to find a duplicate within 103 trillion version-4 UUIDs is one in a billion</em>”.</li><li>They are relatively compact and presentable.<br>A UUID is just a 128-bit positive integer. This is typically formatted for presentation as a hexadecimal string of five components, totaling 36 printable characters, albeit they are not very human friendly.</li><li>They are cheap to compute.<br>On a modern laptop we can easily generate over 500,000 every second.</li></ul><h3>A New Approach — Content Identifiers</h3><p>As an alternative to UUIDs, I am proposing a new approach for generating an identifier for Digital File which is computed from the content of the file itself.</p><p>I should be clear that this is not some stroke of genius on my part, similar approaches are already widely used in other domains. For example, the <a href="https://git-scm.com/">Git</a> SCM (Source Code Management) uses SHA1 digests to identify files and changes. Likewise, the <a href="https://en.wikipedia.org/wiki/InterPlanetary_File_System">IPFS</a> (InterPlanetary File System) uses <a href="https://docs.ipfs.io/guides/concepts/cid/">its definition of a CID</a> (Content Identifier), which is a hash function’s digest of a file’s content to address that file.</p><p>To avoid any confusion between IPFS CID’s and our “Content Identifiers”, I will herein use the abbreviation ACID (Archival Content Identifier) to refer to my proposal for identifiers.</p><p>The main part of an ACID is generated by computing the digest of the byte-stream (i.e. content) of the digital file via a hash function. This raises the question, of which hash function should be used? There is a wealth of <a href="https://en.wikipedia.org/wiki/List_of_hash_functions">different hash algorithms</a> available with various properties and different trade-offs. That being said, I am going to suggest that we use a <a href="https://blake2.net/">BLAKE2b</a>-256 hash for the following reasons:</p><ul><li>Recognised and verified by NIST.</li><li>Likelihood of collision is incredibly small.</li><li>Much faster to generate than equivalents such as SHA-256.</li><li>At least as secure as SHA-3.</li></ul><p>For example, if we wanted to generate a BLAKE2b-256 hash digest for the Apache 2.0 License file, we could run:</p><pre>curl https://www.apache.org/licenses/LICENSE-2.0.txt | b2sum --length 256 --binary</pre><p>This yields a 256-bit number encoded into a hexadecimal string totaling 64 printable characters:</p><pre>3cbae8f16217ad44981e5843100092cd582202e69d452eb094480f2d24abdb49</pre><p>This hexadecimal string has some interesting properties:</p><ul><li>It can be used an an identifier for the Digital File.</li><li>Verifiable Descriptions.<br>Provoided with both, 1) the description and identifier of a digital file and, 2) the file itself, we can verify that the description is indeed about the file by re-computing the hash digest of the file and comparing the result with the digital file identifier.</li><li>Verifiable Preservation.<br>Similarly to above, if the hash digest of the file changes over time, then we can assert that there has been an issue with its preservation, e.g. <a href="https://en.wikipedia.org/wiki/Data_degradation">data-rot</a>.</li></ul><p>There are some down-sides to using a hash digest as opposed to a UUID:</p><ul><li>More expensive to compute.<br>A hash digest is much more expensive to compute than a UUID, and the larger the file being digested the more expensive it becomes.</li><li>Less compact.<br>Our 256-bit hash generates a result which is twice as long as a UUID.</li></ul><p>I would that the down-sides of a hash digest are outweighed by its advantage of offering verifiability.</p><p><strong>Which Hash Function was it?</strong></p><p>For the purposes of preservation and interoperability, one thing that we have not yet considered is how one determines which hash function was used to generate an identifier. Sure, I said we would use BLAKE2b-256, but what if you want to use a different hash function? Also, from an digital archaeological perspective, given an identifier like:</p><pre>3cbae8f16217ad44981e5843100092cd582202e69d452eb094480f2d24abdb49</pre><p>You might be able to infer that it is a hash digest, and the selection of characters used and the number of them would indicate that it could be a 256-bit hash… but which hash function was used?</p><p>Ideally, we need a mechanism to also communicate the hash function that was used. In fact IPFS already thought about this, and they use an encoding called <a href="https://multiformats.io/multihash/">Multihash</a> which prefixes their CIDs with a code indicating the hash function used. Whilst we could adopt Multihash here, it’s much more complex than we need (famous last words?!?). Instead, I propose that our ACID’s have a single ASCII character at the start that indicates the hash function that was used. A single ASCII character has the advantage of a fixed-length numeric encoding, and it makes the number of characters in the hexadecimal string representation an odd number, thus providing a hint to a digital archeologist that perhaps this ACID is similar to a digest but with an extra character. I will go one step further and say that this character should be outside of the hexadecimal alphabet (and ignorant of case-sensitivity), this should make it glaringly obvious to such a digital archeologist that the prefix character has a meaning which is distinct from the rest of the string.</p><p>An ACID is then formatted from a template like this:</p><pre>{Hash Function Type}{Hash Digest}</pre><p>For the Hash Function Type, I am going to reserve the ! character to indicate BLAKE2b-256. Why? Because, I think it looks cool! This would mean that our earlier digital file identifier now simply becomes:</p><pre>!3cbae8f16217ad44981e5843100092cd582202e69d452eb094480f2d24abdb49</pre><p>Sure, generating a digital file identifier with BLAKE2b-256 has a very small chance of generating a collision (i.e. two different files with the same identifier), but what if…?</p><p>If you detect a collision, I will build you a new digital archive system for free… Nope! Just joking! We actually already have a mechanism for coping with this, the Hash Function Type; for the new file which creates the collision you could switch to a different hash function, perhaps a 512-bit one! This would at least give you a different unique identifier. But… what to do about the original file which is on the other side of the collision, it’s probably deeply embedded in your archive by now! You could re-catalogue it, but maybe you don’t even need to???</p><p>I have in mind the idea to write another article about further encoding such ACID’s for compact machine use. Okay… that’s enough for today!</p><p><em>Originally published at </em><a href="https://blog.adamretter.org.uk/archival-identifiers-for-digital-files/"><em>https://blog.adamretter.org.uk</em></a><em> on June 9, 2020.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c448ff463c22" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-national-archives-digital/archival-identifiers-for-digital-files-c448ff463c22">Archival Identifiers for Digital Files</a> was originally published in <a href="https://medium.com/the-national-archives-digital">The National Archives Digital</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Archival Catalogue Record Identifiers]]></title>
            <link>https://medium.com/the-national-archives-digital/archival-catalogue-record-identifiers-29b0a1fac9ba?source=rss-c95baf8f8cb8------2</link>
            <guid isPermaLink="false">https://medium.com/p/29b0a1fac9ba</guid>
            <category><![CDATA[catalogue]]></category>
            <category><![CDATA[uri]]></category>
            <category><![CDATA[records-management]]></category>
            <category><![CDATA[national-archives]]></category>
            <category><![CDATA[identifier]]></category>
            <dc:creator><![CDATA[Project Omega at The National Archives]]></dc:creator>
            <pubDate>Wed, 03 Jun 2020 10:48:08 GMT</pubDate>
            <atom:updated>2020-06-05T12:21:42.919Z</atom:updated>
            <content:encoded><![CDATA[<p><em>This is a guest blog post by Adam Retter of </em><a href="https://www.evolvedbinary.com/"><em>Evolved Binary</em></a><em>, who is acting as a consultant on Project Omega for The National Archives…</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2akL_va5E3W1YQ-t" /></figure><p>As <a href="https://blog.adamretter.org.uk/rdf-plugins-for-pentaho-kettle/">previously described</a>, in Project Omega at TNA (<a href="https://www.nationalarchives.gov.uk/">The National Archives</a>), we will be using a Graph Model to hold all of the catalogue information, specifically an RDF model.</p><p>One of the key things in RDF is that every resource has a URI. In the Omega Catalogue we will have a plethora of different types of resources — (Archival Records, Locations, People, Organisations, etc.). Every one of these resources will need a URI. For our purposes these URI are composed of two parts, a <em>base</em> and an <em>identifier</em>.</p><p>In Omega we will be using a flat addressing scheme (i.e. no sub-folders/paths in the URI), and so our <em>base</em> is fixed and could be something like either: <br>http://cat.nationalarchives.gov.uk/</p><p>or</p><p><a href="http://cat.nationalarchives.gov.uk/#.">http://cat.nationalarchives.gov.uk#.</a></p><p>Determining which is best to use depends on which approach of the <a href="https://www.w3.org/wiki/HashVsSlash">HashVsSlash</a> schemes is most advantageous to your application. I have decided that in Omega we will be using the Slash scheme, i.e. http://cat.nationalarchives.gov.uk/. The Slash scheme has the advantage that there are multiple documents. As our catalogue will be very large, the single document approach as used by the Hash scheme would be unwieldy.</p><p>Now, the interesting part is the <em>identifier</em>! Every resource in our RDF graph needs a URI and therefore an identifier, in this article I will focus solely on identifiers for Archival Records.</p><h3>Requirements for a Good Identifier</h3><p>When choosing identifiers for our resources, there are some properties that they <em>must</em>/ <em>should</em>/ <em>count</em> exhibit:</p><ol><li><em>Must</em> be Unique (within our <em>domain</em>).<br>We can’t have one identifier identify more than one resource without breaking our RDF model.</li><li><em>Must</em> be Persistent.<br>We don’t want our resources disappearing and/or reappearing with different URI over time, otherwise we end up with broken links. Therefore the identifier must be immutable, thus meaning that we must exclude any changeable properties of a resource from use within its identifier. This is also for archival purposes, as ideally we don’t want to have to retrieve records from potentially distant locations or media to modify their identifiers.</li><li><em>Must</em> be Computable.<br>Whatever form the identifier takes it must be computationally valid for use within a URI. Ideally it should be possible to generate such an identifier computationally without requiring a manual (human) registration/validation process.</li><li><em>Must</em> be Uniform.<br>By ensuring that every identifier follows a prescribed format and length, it is easy to validate what is an identifier and what is not; that is not to say that an identifier leads to a resource.</li><li><em>Should</em> be Humane.<br>The <em>identifier</em> when considered as part of a larger URI is often used by humans, perhaps within SPARQL statements that they construct to query the data, or by de-referencing such URI via the Web.<br> Additionally the <em>identifier</em> as a stand-alone element may have value in itself and could conceivable be used by humans to communicate about resources, for example a visitor to TNA could imaginably ask to see the record with identifier X.<br>Consideration should be given to making the identifiers communicable by humans, which implies that there are additional desirable properties, such as:</li></ol><ul><li><em>Should</em> be succinct.<br>Typically humans are better at accurately communicating short sequences of data.</li><li><em>Should</em> be easy to transcribe.<br>Human transcription errors can be reduced by using a commonly known alphabet. <a href="https://en.wikipedia.org/wiki/Latin_alphabet">The Latin or Roman alphabet</a> would seem sensible for an archive based in the UK. This would suggest excluding any non-alphanumeric characters from the identifier.</li><li><em>Should</em> be easy to verbalise.<br>Records of TNA are often discussed or requested verbally. For example, collaboration between staff members, or by a member of the public telephoning or making an enquiry face-to-face on site.</li><li><em>Could</em> Convey Knowledge.<br>If the identifier is able to convey some knowledge about the resource that can be interpreted by machines and/or humans, we gain the advantage of being able to determine certain facts about the resource just from its identifier. This has to be carefully balanced with (2).</li></ul><p>There are two interesting articles from the W3C about designing URI schemes both for the Web and RDF that may be of further interest to the reader:</p><ul><li><a href="https://www.w3.org/Provider/Style/URI">Cool URIs don’t change</a></li><li><a href="https://www.w3.org/TR/cooluris/">Cool URIs for the Semantic Web</a></li></ul><h3>Existing Identifiers for Archival Records</h3><p>Those of you readers already familiar with records keeping, may of course be thinking that TNA must have an existing identifier scheme for its records, and you would be right. In fact TNA has several different schemes in-use today for identifying its records. For brevity’s sake I will discount those used within various internal systems, and focus on what the general public tend to see.</p><p>The predominant identifier used by TNA for its records that the general public (and most staff) see and work with is simply known as a “ <em>Catalogue Reference</em>”. In actuality there are two different identifier schemes in use today, and a Catalogue Reference may be expressed in one or the other scheme. The schemes are:</p><ol><li>CCR (Classic Catalogue Reference)<br>Before the advent of GCRs, this was simply known as “The Catalogue Reference” and was the de-facto identifier for any record catalogued by TNA. It was developed before the advent of digital records.</li><li>GCR (Generated Catalogue Reference)<br>I developed this scheme for TNA in 2012 to allow computational generation of identifiers for digital records.</li></ol><p>At present, TNA uses CCRs for physical (think paper) records, and GCRs for <a href="https://www.nationalarchives.gov.uk/information-management/manage-information/digital-records-transfer/what-are-born-digital-records/">Born-Digital</a> records. CCRs were previously used for Digitised records, but GCRs are now starting to be used for those too.</p><p>We will briefly take a look at each existing identifier scheme, and show that unfortunately both have properties which make them unsuitable for use as identifiers within URI.</p><h3>CCR (Classic Catalogue References)</h3><p>To understand CCRs, you need to first understand a little bit about how archival records are arranged. Ultimately it all comes down to the principle of <a href="https://en.wikipedia.org/wiki/Respect_des_fonds"><em>Respect des fonds</em></a>, in the simplest of terms — we must respect the arrangement of the records as defined by their creator. In more concrete terms TNA uses an internal standard known simply as TNA-CS13 (The National Archives — Cataloguing Standards 2013) which is itself derived from <a href="https://www.ica.org/en/isadg-general-international-standard-archival-description-second-edition">ISAD(G)</a> (General International Standard Archival Description).</p><p>TNA-CS13 basically stipulates that each record is arranged according to a mono-hierarchical structure, that structure may have between 3 and 7 levels. These levels are known by the names (from top-to-bottom): Department, Division, Series, Sub-series, Sub-sub-series, Piece, and Item; you can read more about them in the article <a href="https://www.nationalarchives.gov.uk/help-with-your-research/citing-records-national-archives/#section3">Citing records in The National Archives</a>.</p><p>A CCR identifier basically encodes all the references used for 3 or 4 levels of the record’s arrangement. The CCR scheme has one of two forms, for records catalogued to Piece level it is:</p><pre>{Department Reference} {Series Reference}/{Piece Reference}</pre><p>For records catalogue to Item level the scheme is:</p><pre>{Department Reference} {Series Reference}/{Piece Reference}/{Item Reference}</pre><p>Here are five examples of valid CCRs that are in use:</p><ol><li><a href="https://discovery.nationalarchives.gov.uk/details/r/C658130">MH 55/2713</a></li><li><a href="https://discovery.nationalarchives.gov.uk/details/r/C11978467">AIR 79/1064/118667</a></li><li><a href="https://discovery.nationalarchives.gov.uk/details/r/C5005305">E 317/Devon/1</a></li><li><a href="https://discovery.nationalarchives.gov.uk/details/r/C4090372">AIR 1/1983/204/273/89-M-N-O-P-R-S</a></li><li><a href="https://discovery.nationalarchives.gov.uk/details/r/C7655609">T 1/440/15,65-66107-113,116-142,166,180-189,etc</a></li></ol><p>From what I have explained so far, hopefully you have recognised that Example (1) is a CCR for a Piece, whereas Example (2) is a CCR for an Item.</p><p>Now, I would not blame you for thinking that Example (3) is also an Item, however you would be mistaken! Unfortunately whilst the / character is used as a separator between the Series, Piece, and Item references, at some point in the past it was also introduced as a valid character within the Piece and Item references themselves. We will cover the reason for that decision shortly, but for now we can safely assert that it causes problems: As a human I can no longer visually determine whether the CCR refers to a Piece or an Item, and perhaps worse yet, if I try and parse the identifier using a software program I get an ambiguous result. Sadly the intention for a CCR to carry information that is meant to be helpful to understanding the record has not held up well, instead many CCRs are ambiguous which may lead to confusion, and ultimately the fact that the arrangement of the record cannot be known without going into the physical archival stacks and retrieving it.<br>I chose Example (4) and Example (5) to further illustrate the non-uniformity of CCRs, they refer to a Piece and an Item respectively.</p><p>We can identify several issues that make CCRs unsuitable for our identifier needs in Omega:</p><ol><li>A CCR may be ambiguous and therefore does not meet our requirement for unique identifiers.</li><li>A CCR encodes the arrangement of the record, whilst one would hope the arrangement is fixed at the time of accession, the reality is that mistakes can be made and from there the record may need to be re-catalogued which could also involve a change to its CCR. Therefore, CCRs do not meet our requirement for persistent identifiers.</li><li>Each CCR is allocated and registered manually by an archivist whereas we would need to be able to compute such identifiers within Omega. Additionally their ambiguity and non-uniformity means that they cannot be computationally validated.</li><li>For CCRs with Piece and Item identifiers containing non-alphanumeric characters (e.g. /, or ,), such characters would require <a href="https://en.wikipedia.org/wiki/Percent-encoding">URI Encoding</a> to be able to use the CCR as part of a URI. Unfortunately URI Encoding is non-intuitive to humans.</li><li>The ‘/’ character was introduced into the Piece and Item references within a CCR to allow the archivist to <em>hint</em> at further levels of arrangement which were prohibited by TNA-CS13. A goal of Project Omega is to provide a catalogue that works for any record regardless of its medium (e.g. physical or digital), one known axiom of digital records preservation is that such records have far more complex arrangements than their paper counterparts, often requiring arbitrarily deep levels of hierarchy or poly-hierarchical arrangement. For this reason the encoding of level identifiers into CCRs will not scale for digital records, and was in fact one of the drivers for creating the GCR scheme.</li></ol><p>Whilst CCRs may not be perfect, it should be recognised they have until now largely been successful in providing an identifier for the retrieval of a record, thus demonstrated by the fact that they are still used daily to access millions of archival records.</p><h3>GCR (Generated Catalogue References)</h3><p>I designed the GCR scheme for TNA back in 2012 when I was leading the design and implementation of their DRI (Digital Repository Infrastructure) project. The goal of that 3 year project was to design and implement a new Digital Archive for preserving digital records.</p><p>DRI needed to be able to accession Born Digital records. The practice of archiving and cataloguing physical records is rather well established and understood. At that time the practice of archiving and cataloguing digital records was still in its infancy with much international discussion, and arguably best practice is still being refined. In particular, Born Digital records have several aspects that make them much more complex to handle than physical records, if we are to apply principle of <em>Respect des fonds</em> then we must preserve the creator’s arrangement of the digital files comprising the records. Generally digital files are organised according to a mono-hierarchical file-system or file-plan, however such a hierarchy may be of an arbitrarily deep number of levels and operate without any global constraints on the naming of each level. In addition there are some systems (e.g. Content/Document Management Systems and/or Cloud Office Suites) which offer label based arrangements of documents, thus resulting in arbitrarily deep poly-hierarchical structures and again without restrictions on the naming of labels (i.e. levels).</p><p>By recognising that CCRs reflected an arrangement of 3 or 4 levels, and that Born Digital files could have many more levels of arrangement, we realised that adding additional level identifiers to CCRs would not scale; as we could end up with very long CCRs which are encoding file-system paths with each component of arbitrary length. In addition whilst TNA may receive a large collection of paper records and these can be catalogued and accessioned by humans, the volume of digital files for Born Digital records is much much higher, to the extent that cataloguing such records manually becomes impossible with the resources available.</p><p>To solve this problem I developed GCRs, with the goals of:</p><ol><li>Eliminating the encoding of multiple levels of arrangement into the Catalogue Reference.</li><li>Computing Catalogue References automatically during the automated accessioning process for a collection of digital records.</li><li>Creating Catalogue References that are unambiguous, uniform, and can be easily validated.</li><li>Ensuring that the GCR scheme is still easily communicable by humans by both written and verbal mechanisms.</li></ol><p>A GCR starts just like a CCR by encoding the Department and Series References, however from there it deviates, instead of encoding further levels, it instead uses a sequentially allocated Record Number, and finally an optional Revision Number. The GCR scheme for most records, i.e. those with a single manifestation, looks like:</p><pre>{Department Reference} {Series Reference} {Record Number} Z</pre><p>For records with more than one manifestation, the additional manifestations can be identified by the GCR scheme:</p><pre>{Department Reference} {Series Reference} {Record Number} Z{Revision Number}</pre><p>Each record number is monotonically increasing per Department and Series pair. To ensure that the GCR remains succinct even when there are many records, I then encoded the record number using a custom Base25 alphabet. This encoding results in a significant compression of the number of characters needed to express the record number. The Base25 alphabet was carefully chosen to eliminate characters which could be confused when communicated by humans, for example 0 (the digit) and O (the letter), in addition I removed vowels so that we were not incidentally generating recognisable words. The Z character, which I also removed from the alphabet, is carefully placed to enable a GCR to be easily distinguishable from a CCR.</p><p><strong>GCR Base25 Alphabet</strong></p><pre>| Numeric Value | Encoded Symbol |<br>|---------------|----------------|<br>| 0             | B              |<br>| 1             | C              |<br>| 2             | D              |<br>| 3             | F              |<br>| 4             | G              |<br>| 5             | H              |<br>| 6             | J              |<br>| 7             | K              |<br>| 8             | L              |<br>| 9             | M              |<br>| 10            | N              |<br>| 11            | P              |<br>| 12            | Q              |<br>| 13            | R              |<br>| 14            | S              |<br>| 15            | T              |<br>| 16            | V              |<br>| 17            | W              |<br>| 18            | X              |<br>| 19            | 2              |<br>| 20            | 3              |<br>| 21            | 4              |<br>| 22            | 5              |<br>| 23            | 6              |<br>| 24            | 7              |</pre><p>Examples of valid GCRs:</p><ol><li><a href="https://discovery.nationalarchives.gov.uk/details/r/02a88459172048279324d7bbd5777059">LOC 5 CWG Z</a></li><li><a href="https://discovery.nationalarchives.gov.uk/details/r/56b36e67c0f64058b3399982cd0a64a5">LOC 5/FPF/Z</a></li><li>LOC 5 CWG Z3</li></ol><p>Example (1) and Example(2) are both valid GCRs. The GCR scheme does not actually stipulate that there should be a / used between the Series, Record, and Z components, however, for visual continuity TNA have elected to use this when presenting them. Example (3) shows the Revision number component, which serves to allow multiple <em>manifestations</em> of a record to be addressed by a GCR, for example you may have a Microsoft Word 2000 Document original, and a migrated PDF manifestation.</p><p>TNA have now been using GCRs for digital records for a few years. Retrospectively looking back at the design of GCRs, I have to admit that I am still quite happy with them, my younger self must have been having a particularly good day when he sat down to design the GCR scheme! It is certainly humbling to think that these innocuous little identifiers are forming a small part of the UKs permanent history, and that I had a hand in defining them.</p><p>For the purpose of considering them for use as the identifier scheme in Omega, GCRs have many of the properties that we require in a good identifier — they are unique, they are persistent (for the vast majority of records), they are computable, they are uniform, and they are humane (in many ways more so that CCRs, although perhaps not as memorable).</p><p>Indeed, we could casually adopt GCRs for use in Omega as our identifier scheme. Yet with further thought there are a couple of minor issues with that, and as we have the opportunity, I could perhaps even improve on GCRs yet. The issues that I perceive with adopting GCRs for Omega are:</p><ol><li>In Omega we want our identifiers to be persistent. If records need to be re-arranged, whist it is extremely unlikely that the Department reference would change, it is possible that the Series reference could. With a GCR, the Series reference is encoded in the identifier, which means the re-arrangement would unfortunately result in a change to the identifier.</li><li>To support our goal of building an immutable history of our records in Omega, we have a very clear distinction between, the enduring form of the record (i.e. the concept of the record), and our temporal understanding of the record (i.e. descriptions of the record). For this end, we need identifiers that can indicate both the concept of the record, and its descriptions as our understanding of the record accumulates and evolves through time. Whilst a GCR has a revision number to identify manifestations of the record, and one might consider re-purposing that for indicating revisions of description, that would then fall-short as we also have the concept of manifestations in Omega.</li><li>Adopting GCRs as identifiers for all records would mean that physical records would also gain a GCR alongside their CCR, born-digital records already have GCRs. There is in fact precedent for this, TNA-CS13 allows records to have Former References alongside their Catalogue Reference, one such Former Reference is the PRO (Public Records Office) reference; The PRO is of course the predecessor of TNA. The issue I perceive is one of mindset, staff know that GCR are used only for digital records, so when they see the Z character in a GCR they infer that it refers to a digital record. This is perhaps unfortunate, whilst it was never previously envisaged that the GCR scheme would be used for physical records, it didn&#39;t impose any such limitation, its specification in-fact states: &quot;not solely limited to Born Digital Records&quot; and that the Z character (the Generated Catalogue Reference Indicator) is for the purpose of &quot;allow[ing] users to visually differentiate a GCR from a CCR easily&quot;.</li></ol><p>Additionally, one place where I think I could improve upon the GCR scheme is where CCRs have the advantage of being able to convey more information directly to the user about the record, thus reducing the need for the user to actually retrieve the record. Sometimes this information may be ambiguous and/or confusing, but more often than not, it is helpful to the user. GCRs removed a lot of that information to meet its goals, and ultimately ended up with a much more persistent identifier scheme which is a good thing. In Omega we have a clear split and definition of information that we believe changes over time, and information which we believe is enduring. If there is enduring information that is useful to the user, and assuming it is sensible for use in an identifier and URI, we can place that into the identifier without compromising on our requirement for persistent identifiers.</p><h3>OCI (Omega Catalogue Identifier)</h3><p>From what I have learnt about CCRs and how TNA use GCRs, in consultation with TNA’s Catalogue Team I have developed a new identifier scheme which rather unimaginatively I am simply calling OCI (Omega Catalogue Identifier).</p><p>Let me be clear, my driver for this is solely the requirements of Project Omega. I believe that these identifiers will work well for the URI of our catalogue resources in our RDF graph, and would equally work well within a Linked Data context.</p><p>OCIs can be used for any type of record held by TNA. I might be suggesting, but I am NOT proposing, that the canonical Catalogue Reference of a record catalogued by TNA change from the existing CCR or GCR scheme. At this stage, I see OCIs as complementing CCRs and GCRs, whereby in some applications, such as Omega, the OCI is the primary identifier of the record. Regardless, OCIs will be generated for all existing catalogue records at TNA when they are imported into the Project Omega system. Could TNA start using OCIs instead of CCRs and GCRs for all new records that it accessions? Yes, of course! Will TNA do that? I am the wrong person to ask… that level of decision making is high above my position!</p><p>The basic OCI scheme for records has the following components:</p><pre>{Creator Reference}.{Accession Year}.{Record Number}.{Accession Format}</pre><ul><li>Creator Reference<br>This is some identifier that uniquely identifies the organisation, group, or individual that created the records. Historically at TNA this is most often the Government Department, known as “Department reference” in CCR terms.</li><li>Accession Year<br>The year in which the record was accessioned into the archive.</li><li>Record Number<br>A monotonically increasing number, initialised per Creator Reference and Accession Year pair. This number is encoded using a special purpose alphabet. This is not the same Base25 alphabet used in GCRs for some important reasons covered below.</li><li>Accession Format<br>A single character to indicate the format of the accessioned record. Currently limited to P for physical records, or D for digital records. Note that accession format is useful to indicate the format of the public record that was initially accessioned, but it should be remembered that there might also be additional manifestations of the record available in complementary formats, e.g. a digitisation of a physical record.</li></ul><p>As already mentioned, Omega separates the concept (or enduring form) of a record from TNA’s descriptions’ of the record which evolve through time. The OCI scheme illustrated above allows one to identify a record, but how are we to identify the descriptions of the record? To identify a specific description of a record, we simply number them, and add an additional component to indicate the description:</p><pre>{Creator}.{Accession Year}.{Record Number}.{Accession Format}.{Description Number}</pre><ul><li>Description Number<br>A monotonically increasing number, initialised per record concept. This is not encoded. Comparing these numbers only infers an ordering through time of descriptions, it does not infer the correct description as there may be multiple competing descriptions from different sources.</li></ul><p>It is perhaps worth pointing out that within the RDF graph for Omega there are explicit relationships that link a record with all of its descriptions, and also indicate the latest description. From a Linked Data perspective, if a user wished to resolve the record using the web of data, we would provide just the data about the concept and links to its descriptions. However, if another user was to resolve the record via a Web Browser, then we would likely redirect them to an HTML page of the latest description of the record.</p><p>Similarly to how we have multiple descriptions of a record, Omega also offers multiple manifestations of a record. A manifestation of a record can take many different forms, but there is always the original manifestation of the record as accessioned by TNA, for example, a parchment or digital file. There may also be additional manifestations of the record created for preservation or presentation purposes, for example, copies, digitisation, thumbnails, language translation, transcription, redaction, or file-format migration. The OCI scheme adds a component for manifestation, which is numbered in a similar manner to descriptions.</p><pre>{Creator}.{Accession Year}.{Record Number}.{Accession Format}.{M{Manifestation Number}}</pre><ul><li>Manifestation Number<br>Prefixed by an M character, this is a monotonically increasing number, initialised per record concept. This is not encoded. Comparing these numbers does not infer an ordering of manifestations.</li></ul><p>Note, it is important to realise that descriptions and manifestations are both numbered per record concept. Descriptions and manifestations do not have a hierarchical relationship, instead they are orthogonal to each other.</p><p>Here are some examples of (fictional) OCIs:</p><ol><li>MSW.1970.7GH.P<br>This is the OCI for a physical record numbered 7GH which was created by MSW ( <a href="https://en.wikipedia.org/wiki/The_Ministry_of_Silly_Walks">The Ministry of Silly Walks</a>) and accessioned by TNA in 1970.</li><li>MSW.2014.L4F.D<br>This is the OCI for a digital record numbered L4F which was created by MSW and accessioned by TNA in 2014.</li><li>MSW.1981.HGF.P.1<br>This is the OCI for the 1st description of, the physical record numbered HGF which was created by MSW and accessioned by TNA in 1981.</li><li>MSW.1981.HGF.P.5<br>This is the OCI for the 5th description of, the physical record numbered HGF which was created by MSW and accessioned by TNA in 1981.</li><li>MSW.1999.TSF.P.M1<br>This is the OCI for the 1st manifestation of, the physical record numbered HGF which was created by MSW and accessioned by TNA in 1999.</li><li>MSW.1999.TSF.P.M5<br>This is the OCI for the 5th manifestation of, the physical record numbered HGF which was created by MSW and accessioned by TNA in 1999.</li></ol><p>Astute readers may have noticed that we could potentially remove the . character between the components in an OCI without loosing precision or introducing ambiguity. This is an interesting idea, and one that I discussed with the Catalogue Team, whilst it would make no difference to a machine, the majority felt that it was clearer for human use if they remained.</p><p>The alphabet for encoding record numbers in OCIs was created by:</p><ol><li>Starting with the <a href="https://tools.ietf.org/html/rfc4648#page-10">Base32 alphabet from RFC 4648</a>.</li><li>Eliminating the English vowels — A, E, I, O, and U. We don&#39;t want to incidentally create meaningful words!</li><li>Removing the characters P, D, and M, as they are reserved to signify Physical, Digital, and Manifestation.</li><li>Removing the digit 0 (zero) as it could be misconstrued as numeric padding.</li><li>Removing the character B as it could be confused with the digit 8 (eight) when read or written by humans.</li><li>Adding the characters W, X, and Y. We opted not to add Z so as to avoid any confusion with GCRs.</li></ol><p><strong>OCI Base25 Alphabet</strong></p><pre>| Numeric Value | Encoded Symbol |<br>|---------------|----------------|<br>| 0             | 1              |<br>| 1             | 2              |<br>| 2             | 3              |<br>| 3             | 4              |<br>| 4             | 5              |<br>| 5             | 6              |<br>| 6             | 7              |<br>| 7             | 8              |<br>| 8             | 9              |<br>| 9             | C              |<br>| 10            | F              |<br>| 11            | G              |<br>| 12            | H              |<br>| 13            | J              |<br>| 14            | K              |<br>| 15            | L              |<br>| 16            | N              |<br>| 17            | Q              |<br>| 18            | R              |<br>| 19            | S              |<br>| 20            | T              |<br>| 21            | V              |<br>| 22            | W              |<br>| 23            | X              |<br>| 24            | Y              |</pre><p>The Base25 alphabet as used in OCIs has a small advantage over that used in GCRs — encoded data maintains its sort order when it is compared bit-wise.</p><p>I believe that the OCI scheme has two key advantages over GCRs:</p><ol><li>100% Persistent.<br>A URI using an OCI will never change, even if the description or arrangement of the record changes. Once an OCI is created in Omega it lives forever.</li><li>Conveys Knowledge.<br>Like a CCR an OCI confers some information about the record that it identifies, however unlike a CCR this is done without compromising on persistence of the identifier.</li></ol><p>The OCI scheme <strong>should certainly be considered as a draft</strong> at the moment, and I am looking forward to both experimenting with it and receiving further feedback.</p><p>We have placed the source code for two software tools for encoding/decoding OCI Base25 (and also GCR Base25) onto GitHub: <a href="https://github.com/nationalarchives/oci-tools-scala">OCI Tools (Scala)</a> and <a href="https://github.com/nationalarchives/oci-tools-ts">OCI Tools (TypeScript)</a>.</p><h3>Full Circle back to URIs</h3><p>As discussed at the start of this article… for Project Omega I defined a static base URI for expressing TNAs resources in RDF, and I have now also defined a suitable identifier scheme — OCI.</p><p>The URI for our <em>data</em> now look like this for a record (concept):</p><pre><a href="http://cat.nationalarchives.gov.uk/MSW.1970.7GH.P">http://cat.nationalarchives.gov.uk/MSW.1970.7GH.P</a></pre><p>and this for a record’s description:</p><pre><a href="http://cat.nationalarchives.gov.uk/MSW.1970.7GH.P.2">http://cat.nationalarchives.gov.uk/MSW.1970.7GH.P.2</a></pre><p>Just above I said: “URI for our “, ideally such URI <em>should</em> be resolvable via the Web with various content negotiation options. At present alongside Project Omega, TNA is also operating Project Alpha. Alpha is focused upon the User Experience around the discoverability of records through TNAs website. There has already been some collaboration and information sharing between the two projects around URI. Yet, it is important to kept in mind that URI for addressing records (Omega), are not necessarily the same as URI for finding records (Alpha).</p><p>I expect that there will be further collaboration in the near-future between the Alpha and Omega projects to ensure that TNA can benefit from the exciting Linked Data on the Web applications that Omega is unlocking! :-)</p><p><em>Originally published at </em><a href="https://blog.adamretter.org.uk/archival-catalog-identifiers/"><em>https://blog.adamretter.org.uk</em></a><em> on June 3, 2020.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=29b0a1fac9ba" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-national-archives-digital/archival-catalogue-record-identifiers-29b0a1fac9ba">Archival Catalogue Record Identifiers</a> was originally published in <a href="https://medium.com/the-national-archives-digital">The National Archives Digital</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>