Month: September 2025
Week Beginning 22nd September 2025
I had my PDR this week, which meant spending some time preparing and then attending the session, which was all very positive. Other than this I spent quite a lot of time this week working for the Anglo-Norman Dictionary, mostly working on scripts to rationalise the parts of speech used across the dictionary’s entries. The largest aspect of this was writing a script that would go through all of the live entries in the database and find all occurrences of a particular POS (e.g. ‘s._pl.’) and replace these with a standardised form (e.g. ‘s.pl.’). This involved going through the entry XML files to make changes not only to the entry-level <pos> tag, but also to look at the <senseInfo> tags for every sense and subsense, both main and locutions, to replace the ’pos’ attributes found there. The script also then needed to update the ‘pos’ table in the database (which hold a list of all parts of speech associated with each entry) to delete the old forms and add in the new forms. It was clearly important to fully test this script, and make backups of the data prior to running it, as it would need to run through every live dictionary entry, making updates to the XML where necessary. I tested everything out on an instance of the database running on my local PC, and once I was absolutely sure the script did what was required (and nothing that wasn’t required) I ran it on the live database, making changes to numerous parts of speech and updating at least a couple of thousand of entries.
I also had to update the list of parts of speech in the dicionary’s DTD, adding in a few new options that had been supplied to me. Unfortunately some of these had spaces in them and these are invalid characters in list options in a DTD. I hadn’t spotted this so making the update unfortunately stopped the dictionary entries displaying on the website, but thankfully once we did notice this it was a very quick issue to fix. I also ran a few more iterations of the POS updating script to target other parts of speech that had spaces in them that had managed to find their way into entries over the years.
I also had a lengthy email conversation with the AND editor Geert about how the new POS search facilities would function, as these steps to rationalise the parts of speech are leading up to the implementation of new search options. A POS selector will be added to the headword search, but we’ve still not fully decided which other searches should also incorporate such a selector. I had thought possibly ‘citations’ and ‘English translations’ might benefit from a POS option, but Geert didn’t seem to think so. He did suggest the ‘label’ and ‘language’ searches should possibly be updated, though.
These searches will not be able to just use the ‘entry’ level POS list that we already have – instead we’d only want to target specific citations where the <senseInfo> POS matches, otherwise entries that have multiple POS elements may bring back results that don’t actually match. For example
This will require updating the database to store POS for each citation and translation, regenerating all of the citation and translation data for every live entry to populate the new fields and updating the DMS and batch ‘upload entries’ scripts to ensure this additional data is extracted and stored. For example, a label search for ‘alchem.’ brings back https://anglo-norman.net/entry/arder where the label appears in senses that have ‘p.pr. as a.’ and ‘p.p. as a.’ as their POS. If we add a POS filter that only works at entry level then someone selecting ‘v.trans.’ and ‘alchem.’ Would still find this entry, even though the label isn’t found in the ‘v.trans.’ section. This is going to need some further work. For now I’m waiting for Geert to send me a list of the parts of speech he would like users to be able to select through the search before I take this further.
Also this week I responded to a few requests from the DSL and also Eleanor Lawson regarding a new proposal she’s putting together. I also worked with Andrew McHugh of RCaaS to migrate the old Emblems sites to a new server, although we’re encountering what looks to be a DDoS attack on this site. I can’t really go into too much detail about it here, but I spent quite some time this week with both Andrew and Luca investigating the situation and looking for solutions. As of yet the attack is still ongoing and we’re still trying to find a solution.
In addition to the above I also spent a bit of time processing some data for a new edition of Burns music that will be added to the Robert Burns website. I haven’t finished working with this data yet, as I had some questions for the researchers, but hopefully the information will be available in the next week.
Finally this week I spent a few more hours processing some of the messy data for the Place-names of Fife project. This mostly involved fixing errors in the historical forms relating to sources, and I wrote a few scripts to fix several patterns of error that I encountered. The Fife data was originally in a Word file and several years ago I managed to convert this into structured data, but some edge cases in the almost 30,000 historical forms were not successfully processed and it’s these I’m currently trying to tidy up. I think I’m just about there now, and on Friday I migrated the historical forms to a new table that will eventually be used for a new interface.
Week Beginning 15th September 2025
This week I completed work on a first version of the regions and dialect areas map for the Dictionaries of the Scots Language. Last week I’d begun work on the final aspect of the map: ensuring that whatever the user is viewing on the map is reflected in the hash to enable specific views of the map to be bookmarked, shared and cited. I’d begun updating the scripts to process details held in the hash and I completed this by adding the areas selected in from the info pane this week. This was slightly more complicated than I’d imagined as I needed to consider how to handle areas that are selected by default (e.g. all regions selected when the user clicks on the map) in addition to areas specifically turned on or off by the user from the checkboxes in the info pane. I decided to ensure that the default selected areas were also present in the hash to keep things simple.
With the hash processing in place I then needed to update the code to actually add the necessary information to the hash as the user interacts with the map. This was a fairly big job, involving updating much of the code, but I got there in the end. After a fair amount of testing and tweaking I was then able to send the URL for the map to the DSL people for them to test out and give feedback on – I’ll just need to see what changes may be required and also when we might go live with the map – probably not for a while yet I’d imagine.
Also for the DSL this week I had an online meeting to discuss the new entry XML structure. We went through the list of questions I’d come up with whilst working through the new XML examples a few weeks ago and had a good discussion about what would be included in the update and when I’ll start work on this. I should receive a test export of the dataset in the next week or so and once I have this I’ll be able to start implementing the necessary changes to the systems. I also investigated an issue with email lists for the DSL that Rhona contacted me about and fixed a minor layout issue with the live site.
Another sizeable task that I was able to tick off this week was finally launching the new Books and Borrowing versioning system. I’d encountered a strange issue with the online database last week that had prevented me from continuing with the rollout, but thankfully my contact in Stirling’s IT services was back at work on Tuesday and managed to identify the issue. The situation is that the online database’s data is replicated across three nodes. But this only works with database tables created in the ‘InnoDB’ format. I’d created the new tables on my laptop, which had defaulted to the ‘MyISAM’ format, something I’d not spotted. When I updated the online database these new tables were then stored in the ‘MyISAM’ format and were therefore not getting replicated. I wasn’t aware of this distinction between database tables and the implications this had for how the online data was stored – these formats refer to how the data is stored on disk and there is no difference when you view or query the tables and data through the database.
Thankfully once the issue had been identified I was then able to re-create the tables in the ‘InnoDB’ format and regenerate the data, after which all data magically appeared in both the PHPMyAdmin interface and through my scripts. With this in place I then completed the rollout of the new versioning system and the new ‘v2’ version of the API, which as far as I can tell has all been successful. As of yet there’s not really much different as we still only have version 1.0 of the data available. What you will see in the footer of every page is some text about the database version and a link to the ‘versions and changes’ page (https://borrowing.stir.ac.uk/versions-and-changes/). Also, when you perform a search and choose to cite the page the data version now appears in the citation and also the URL (so that when we do publish new versions the citation remains accurate). E.g.
“Quick search for ‘rome’. 2025. In Books and Borrowing: An Analysis of Scottish Borrowers’ Registers, 1750-1830, data version 1.0. University of Stirling. Retrieved 16 September 2025, from https://borrowing.stir.ac.uk/search/version-1.0/p-1/0/0/quick/rome”.
The URL with ‘version-1.0’ in it works in exactly the same way as the general URL for now. When we release ‘version-1.1’ the URL above will load the version 1 data with a warning that the user isn’t looking at the most up to date version. The new API is now available here: https://borrowing.stir.ac.uk/api/v2/ and I’ve updated the ‘About the database’ and ‘FAQs’ pages to point to this. I also sorted the encoded apostrophe issue and book works now appear in the filter options and ESTC has been removed. I spotted an issue with book works that had ampersands in them breaking the site when selected as a filter but I’ve managed to fix this, for example:
So after many months of work that’s the new versioning system complete. Hopefully when we come to launch version 1.1 the process will be a little more straightforward!
Also this week I had a discussion with Geert of the Anglo-Norman Dictionary about processing the data in preparation for adding in a new part of speech option to the searches, and I also fixed an issue with the management system that was preventing certain cross-reference entries from being uploaded.
I also gave some feedback to Matthew Creasy about a proposal he’s submitting soon and had a discussion with Jennifer Smith about sharing the SCOSYA data with the Mozilla Foundation. I also made a bit of progress with the arrangements for the new Place-names of Armagh project.
On Friday I had a bit of spare time that I devoted to the migration of the Place-names of Fife project to our standardised system. I realised that many of the historical forms had not been successfully processed by the script that had extracted data from the original Word files, resulting in several hundred forms that had no data in the historical form name field and everything in the ‘source’ field. I sorted these by a combination of batch processing and manual updating, and also sorted an issue with notes not appearing in the correct field either. I think I’m just about ready to migrate the historical forms now, although much work will still need to be done to extract sources.
Week Beginning 8th September 2025
I continued to work on the new region / dialect area map for the Dictionaries of the Scots Language for around half of this week. I’d made really good progress with the map last week and by the end of the week I’d figured out a possible way to grab all areas that intersected a given GeoJSON area using the Turf.js library (version 6 as for some reason version 7 didn’t work). This week I wrote a script to go through all of the regions, identify all intersecting regions using Turf.js and store these in a JSON file.
All went well to begin with, but midway through processing my script threw an error, with Turf unable to process a geoJSON aera. It turned out that some of the coordinates in our region data use a lot of decimal places – more than Turf can handle, in fact. Thankfully Turf has a helpful ‘truncate’ function that truncates the precision of a region, and once I applied this the script executed successfully.
Once I had my JSON file containing all of the intersects for every region and dialect area I could then work on what to do when the user selects a region / area from the drop-down lists. When this happens my original intention was that the corresponding area would be highlighted in yellow, with all intersecting regions given the usual red colour, while intersecting dialect areas would be ‘off’ by default but the user could turn these on from the info pane. I also wanted the map to zoom and pan to focus on the area that had been selected.
However, all of this brought some difficulties. It turns out that there are a lot of intersections with our data. Not all adjacent areas neatly line up and there are frequently very small (or not so small) overlaps. These are of course considered intersects, meaning that many adjacent areas get added in when really they shouldn’t. This meant that lots of areas were getting highlighted in red, and the yellow highlighting of the area the user actually selected was getting somewhat lost in the mix, due to the transparent nature of the area fills. I therefore decided that I would only highlight the area the user actually selected (in the usual red, not yellow), and all other intersecting areas would be switched off by default, but would be selectable in the info pane, as the following screenshot demonstrates:
I think this works pretty well and is not too overwhelming for users. The next issue I needed to address was zooming and panning to the selected area. In order to do this I needed to use Leaflet’s ‘fitBounds’ method, which expects latitude and longitude values for the North East and South West corners of a rectangle. Unfortunately all I had was very complex geoJSON polygons so I needed to investigate how to generate the ‘bounds’ from this. Initially I thought I’d have to do this on the fly (i.e. when the user selected a region) and figuring out how to get Leaflet to grab a specific area within the geoJSON file and calculate this proved very tricky. Eventually I realised that I didn’t actually need to do this: I could simply store the ‘bounds’ for each area along with the intersects. Turf has a plugin called ‘bbox’ (https://turfjs.org/docs/api/bbox) that can take a geoJSON shape and create a ‘bounding box’ from it. After a bit of experimentation I realised that this solution would work perfectly, so I updated my script that generated the intersects to also generate and store the ‘bounds’ for each area. I was then able to update my map code to grab these bounds when the user selects an area and pass them to Leaflet’s ‘fitBounds’ method, making the map show the desired location. I updated this to add in a bit of padding and was very pleased with the result.
With this in place I then moved onto the region search. In addition to selecting a region from a pretty sizeable drop-down list, we also wanted users to be able to search the areas, using an autocomplete textbox. Vasilis’ prototype had used a neat little jQuery plugin called Select2 (https://select2.org/). This included an autocomplete search box within the drop-down menu, which was nice and compact. However, it isn’t immediately apparent to users that this search box is an option – both I and another member of the DSL team who tried out the prototype didn’t even notice this was an option until Vasilis pointed it out. For this reason I decided to separate out the list and the search option, to hopefully make it clearer to users that a search option is even available.
I used the usual jQuery UI autocomplete that I’ve used many times before on other projects, connecting via AJAX to a PHP script that worked with the ‘intersects’ JSON file to find matching regions. This appeared to work well, and on selection of a matching item in the autocomplete list the same code that handles the list executes to select the area on the map, as the screenshot below demonstrates. However, I spotted that the autocomplete was not appearing when the map was in full-screen mode, and remembered I’d encountered a similar issue with the place-names projects. For these projects the autocomplete was in a modal pop-up and using the autocomplete’s ‘appendTo’ option (https://api.jqueryui.com/autocomplete/#option-appendTo) to attach it specifically to this modal in full-screen mode did the trick. For the current map, however, the autocomplete is in the map menu, which is a limited height based on the menu’s contents. When the autocomplete was added it was too tall for the menu and caused awkward scrollbars to appear. I tried several approaches to get around this issue, but in the end decided to just make the menu tall enough to hold the autocomplete when in full-screen mode, as the following screenshot demonstrates:
With this in place the ‘regions’ map was pretty much complete, and I moved onto the dialect area map. I updated the code so that when the ‘Dialect Areas’ menu item is selected the map resets and displays the dialect areas rather than the regions. Pressing on the ‘Regions’ menu swaps things back again, as does pressing ‘reset map’. With the dialect areas visible, I then needed to update the code for clicking on the map so that it would display dialect areas rather than regions, and update the info pane so that dialect areas appear first, as you can see in the following screenshot, which shows one dialect area and several regions selected:
I now had the core functionality of the map in place and I then spent some time adding in more of the necessary features, including the help and about modal window, the attribution modal window and a ‘loading’ spinner that gets displayed until the geoJSON data has loaded. A also added in the option to select a satellite base map. I’m not sure how useful this will be, but it’s good to have it as an option that can be selected at any time from the ‘Home’ menu. A satellite view of the previous map can be seen here:
I then moved on to what will hopefully be the final big issue relating to the development of the map: adding in the option to bookmark / cite / share a specific view of the map. As with the place-names resources, this will involve not just tracking the position and zoom level, but also exactly which data is visible on the map as the user zooms, pans, clicks and selects things in the resource. It’s hugely useful to be able to save or share a specific view of the map rather than only being able to link to the default view of the map, and even though it will take some time to implement such a feature I think it’s worth it. The first thing I did was add in the leaflet hash plugin (https://github.com/mlevans/leaflet-hash) which tracks and processes position and zoom. As with the place-name projects, I adapted this plugin to also track and process further data held in the hash (the part of the URL after that ‘#’ sign). I decided on a structure for this data and began implementing the code that will process the various elements, ensuring that (for example) when the user has selected the satellite map this is picked up by the code and the relevant base map is shown. By the end of the week I’d added in the code for processing the base map, the active map type (region or dialect area), the browse option (region search, region browse, dialect area browse, map click) and the browse data. I still need to add in the selected items in the story pane, which I’ll do next week. I also still need to update the code to add all of this information to the hash based on the user actions – for now all the code does is process information in the hash rather than add data to it. Hopefully I’ll finish this and complete an initial version of the map next week.
My other big task for the week was to roll-out the new versioning system for Books and Borrowing, replacing all of the code and the data on the online server. I’d got everything sorted on my laptop last week and had sent the data structure and files to Stirling’s IT people so they could set up the new Solr core that was required. This was set up the day I asked for it, which was great, and I therefore began regenerating all of the database data on the live server.
Unfortunately I began to encounter some strange behaviour with the online version of the database, and as my contact in Stirling’s IT department is on holiday until Tuesday next week I had to abandon my attempts at rolling out the new system.
I first encountered the issue when running my script to populate the book holding totals cached data. These are now stored in a separate table as there may be different totals for different versions of the data. The script ran fine on my laptop, and appeared to run perfectly on the server, but when I checked the online admin interface to the database (PHPMyAdmin) the book holding totals table was empty.
I spent ages trying to work out why the ‘insert’ queries were not running, but also not giving any errors. The exact query when entered directly into PHPMyAdmin worked and displayed the inserted row, but when executed through my script the row wasn’t shown in PHPMyAdmin.
Eventually I figured out that the queries WERE executing successfully in my script and WERE being interested into the database, as a test script I wrote connected to the database and listed the rows. But still PHPMyAdmin was showing an empty table. It was almost as if my scripts were connecting to a different version of the database to the one PHPMyAdmin was accessing. However, this wasn’t the case as if I ran the ‘empty’ command in PHPMyAdmin to clear the data from the table my test script also then showed no data. It was all very odd, but having identified the issue I could proceed to run my cache generation scripts (which included several more similar tables) and test that the data had been inserted using scripts rather than PHPMyAdmin.
However, the library cached data is pretty sizeable and instead of generating it on the server I decided to export the tables from the version of the database running on my laptop and import them into the server’s database using PHPMyAdmin. This appeared to have worked and I could see the data in PHPMyAdmin. I completed the data import scripts and then started on upgrading the online scripts to use my new versioning code. I started by setting up the new ‘V2’ version of the API. However, API calls in this that worked perfectly on my laptop were giving errors when run on the server. After much more investigation it would appear that the library cache tables that I imported via PHPMyAdmin are coming back as empty when accessed via the API scripts, even though they contain data when viewed in PHPMyAdmin.
There is clearly something very wrong with the online database and I need someone at Stirling to investigate. It almost looks like there are two separate versions of the database, but for the fact that running an ‘empty’ query in PHPMyAdmin definitely affected the data my scripts access. I can’t really proceed with the rollout of the new system until this is resolved, which will hopefully be next week. It’s all very frustrating as I just want to get the new system finished.
Also this week I spent some time fixing an old resource with Luca. I’d received an email saying that the Working Class Marriage website (https://workingclassmarriage.gla.ac.uk/) was not working. This wasn’t a website I had worked on, but it contains a bunch of interactive maps and a lot of data and Luca and I wanted to get it back online again, which we managed to do after some tweaking of the code.
I also spent a bit of time working for the Anglo-Norman Dictionary, fixing the ‘add source’ feature of the management system, which was unfortunately broken due to a database update not being reflected in the code.
Week Beginning 1st September 2025
I spent the majority of this week working on the new, interactive region and dialect area map for the Dictionaries of the Scots Language. DSL editor Vasilis had created a prototype interface and geoJSON data before the summer and a few weeks ago I had a meeting with a few members of the DSL team about creating an new version of this that would be more suited to the DSL website and would be optimised for mobile use. I then created a specification document which I shared with the group and after some feedback we reached agreement on what needed to be developed.
I was able to base the new interface on my previous map-based projects such as the place-name resources and the Scots Syntax Atlas, and as with these I decided to use the Leaflet.js mapping library. My first task was to incorporate all of the geoJSON data into an interactive map to get an idea of how it might work and whether there would be too many areas for people to make sense of. The first issue I encountered was that the geoJSON data had been created using a projection that Leaflet did not support. I’m not exactly a GIS expert, but apparently Leaflet expects all coordinates to be latitude and longitude using the Coordinate Reference System (CRS) WGS84. The DSL regions geoJSON data stored its coordinates as EPSG 3857, so the coordinates were things like ‘[ -203142.297936542046955, 7877431.976650067605078 ]’ rather than ‘[-1.804316665436796,57.55628903006679]’. This meant that no data was getting displayed on the map. Thankfully I’d encountered this issue before whilst working on the Speak For Yersel project, and I was able to use QGIS to convert the data into the alternative CRS, after which it appeared on the map correctly.
The next issue was that the geoJSON was around 11MB in size, which is far too big for downloading into a webpage. Again, we’d dealt with this issue with Speak For Yersel, where we’d used an algorithm to simplify the polygons and massively reduce the file size. Unfortunately this was a task that another member of the team had performed and going through my blogs and emails I was unable to find details of exactly how this had been accomplished. I tried a couple of approaches in QGIS but they converted the polygons to really basic shapes that were totally unsuitable. Thankfully I found a really amazing resource called mapshaper (https://mapshaper.org/) that allows you to paste in a geoJSON file, visualise it and adapt it, including simplifying it. After some experimentation I exported a file that was just over 1MB in size, which was much more suitable whilst retaining sufficient detail.
I was then able to plug this data into a Leaflet map and visualise it. As agreed with the team, we would have separate maps for regions and dialect areas, so I updated my code to only display regions, stripping out the dialect areas. Initially I created an interface based on the Speak For Yersel maps, with polygons appearing with a faint grey dotted border and the ability to hover over a region, which would highlight it with a yellow border and display the region’s name in a box in the top-right of the screen. I realised that this approach was not going to work very well, firstly because hover-over doesn’t work very well on touchscreens and secondly because there are generally multiple layers present at any one point of the map and highlighting these and displaying all of their names as the cursor moves around the map would be messy.
Instead I decided to remove the hover-over and focus on the click event. We’d decided that when the user clicks a point on the map all regions represented at this point would be highlighted on the map, and information about them, plus the dialect areas would appear in a pane in the map, with options to turns on and off each layer.
In order to grab details about each layer that was represented at the point the user clicked on I needed to use a Leaflet plugin called ‘Leaflet point in polygon’ (https://github.com/mapbox/leaflet-pip). Using this gave my code access to as handy array of all of the layers found at the point where the user clicks, thus allowing me to highlight them on the map and access their details to present them in the information pane.
While Vasilis’ prototype had used solid blocks on the map to represent the regions, we’d decided instead to make these transparent so people could still make out the placenames and features of the underlying map. I also decided to replace the dotted lines with solid ones, as these looked a little neater where multiple polygons converged. I had been worried that there would be too much data and that the map would be too cluttered to be understandable, but I think the map works with all regions visible, and it helps give people a sense of which area might be interesting to click on.
I worked on the information pane, creating lists of regions and dialect areas found at the point clicked on and making it possible to turn these on or off, using a red border and transparent background for regions and a purple border and background for dialect areas, with dialect areas switched off by default. I also decided to add a map marker to where the user clicked to make it clearer how the highlighting has been calculated. I also added in the option to close the information pane (which would also remove all highlighting). This can also be achieved by pressing anywhere on the map that isn’t a region (e.g. in the sea). The screenshot below shows a section of the map with all regions located at the point clicked on highlighted in red and one dialect area (Northeastern Scots (a)) selected and shown in purple:
This is quite a lot of information, but note that the purple area is not visible by default and has to be manually selected. Also, using the options in the information pane you can very easily filter out any layers you’re not interested in. The following screenshot only has one layer (Moray Firth Fishing Villages) highlighted, for example:
There’s still work to be done with the information pane – for example the listed regions and dialect areas should ideally be hierarchically ordered, but I’m pretty happy with how things are developing so far.
I then decided to switch my focus to the map menu, which I wanted to add to the left of the map using the code I’d developed for other resources. This menu would provide lists of regions and dialect areas, allowing the user to select one to view it on the map rather than just clicking round the map. Vasilis had sent me lists of dialect areas and an XML file containing the hierarchical structure of regions and I spent quite a lot of time working with this data. I needed to ensure that the data presented in these files tied into the geoJSON data, and there were a few inconsistencies that took some time to sort out. For example, the ‘abbr’ element in the XML file did not always match up with the ‘abbr’ attribute in the geoJSON data and there were a few typos. Also, the regions XML file also contained dialect areas and I needed to strip these out. It took somewhat longer and was rather more tricky than anticipated to extract the data in a format that I could use, but I got there in the end. I think there’s still work to be done on both the hierarchical structure and the presentation, but it’s a start at least. The screenshot below shows the hierarchical layout of the dialect areas using a drop-down list:
I still need to add in a search option and I might replace the HTML select box with an alternative interface that can better display the hierarchy. As of yet it’s not possible to select an item and actually visualise it on the map, and this led onto another issue:
Selecting an entire region needs to behave differently to clicking on the map; when the user clicks on the map the regions that need to be highlighted are simply all of those regions that are present at this exact point on the map. But when an entire region is selected this may include several intersecting regions at various points within the region so (for example) ascertaining the centre of the selected region and working out which regions are present at this point would not give an accurate picture. I therefore needed a method to ascertain all regions that intersect with the selected region anywhere within the region.
I cam across someone else who had this same issue (https://gis.stackexchange.com/questions/170919/how-to-tell-if-a-geojson-path-intersects-with-another-feature-in-leaflet) and the answers pointed me towards the turf.js library, which I had also previously used for Speak For Yersel. I downloaded the most recent version of Turf (version 7) and wrote a test script to see whether it would work. However, I just couldn’t seem to get Turf to work with the geoJSON data – it just gave errors. I also tried plugging in the example given in the answer on the page linked to above and it also gave errors, which was very frustrating. Eventually I decided to try an older version of Turf (version 6) and both the example code and my geoJSON areas worked perfectly, so there much be something in Turf 7 that has changed. However, this means I can process all of the intersects using Turf 6 and store these as a cached list to be used whenever a region is selected from the lists. This will be my task of the start of next week.
Also this week I worked on the Books and Borrowing project. I now have access to the Stirling servers again and was therefore able to work through some of the outstanding tasks, although I won’t be able to update the online systems until the duplicate author work that another member of the team is working on has been completed (well, I could, but then I’d have to do it all again afterwards) so for now most of the updates are limited to the version of the site running on my laptop.
What I did manage to do was fix the weird apostrophe encoding issues across all data types, replacing the encoded apostrophes with regular straight ones. I’ve made this change on the live database, but until I regenerate the search indexes the online searches won’t be changed. I also replaced all curly apostrophes and double-quotation marks found in authors, borrowers, book editions, works, holdings and borrowing records with their straight equivalents. This took some time to implement and test as it involved updating several thousand records. All seems to have worked, though. Again, this change has been made in the online database and you can see the change when viewing records (see for example: https://borrowing.stir.ac.uk/search/0/0/0/advanced/brids|32203 where the text ‘Peveril of the Peak : by the author of “Waverley, Kenilworth”’ once had curly double-quotes).
I also removed ESTC from the search results filters (again, only on my laptop for now) and added in Book Work title to the search results filters (also only oh my laptop for now) as the following screenshot shows:
The book work titles are rather long, but I think it works ok and I’m sure will be a really useful addition. In order to implement this update I needed to update the Solr index structure to add a new field, reindex the data, update the API and the script that processes search results, so a fair amount of work, but worth it. I also still need to update the script that generates the Solr data to ensure it differentiates authors that have the same name, but I’ll wait to do this until the duplicate author work is complete. After that I’ll then grab a fresh copy of the online data, run it through the various stages needed to generate indexes and caches, test everything out on my laptop again, and after that I’ll need to get Stirling’s IT people to set up a new Solr index and import the new files. Once this has been completed I’ll then be able to update the online API and front-end.
Also this week I made some updates to the structure of the SpeechStar resource for Eleanor Lawson. These included some major changes of page URLs, which introduced some complexity as we don’t want people who may have cited a view of the old pages, or a specific video on one of those pages to end up with a ‘not found’. To avoid this I put in redirects from the old URLs, but this wasn’t enough as I also needed to ensure any filters were also passed over to the new pages, but this is all in place now. So for example, someone who has bookmarked or cited the ‘Child speech error database’, listing the videos by word, filtered by sound: k and sex: female with the video for ‘school’ open would have this link:
And rather than giving a ‘not found’ or redirecting to the default view of the page the above link continues to open the correct video with the correct filters.
Week Beginning 25th August 2025
I was intending to focus on setting up the Books and Borrowing versioning system on the server this week. I’d spent quite a long time implementing the versioning system earlier in the summer, and this required massive changes to every aspect of the B&B system: the database, the Solr index, the API, the CMS and the front-end. I’d completed work on this on my local PC just before my summer holidays and as the team were using the website quite heavily at this time we decided to hold off with the rollout until after the summer. This of course meant that I had to spend some time to familiarise myself with all of the updates, as it was mid-June when I last dealt with all of this. Unfortunately, when I came to log into Stirling University’s VPN I was notified that my account had been blocked. The B&B server is hosted at Stirling and I can’t access it without logging into the VPN so I was unable to proceed with the rollout. I remembered from the last time this happened that I can’t simply contact Stirling’s IT people and ask for my account to be unblocked – this has to be approved by a head of subject or something like that. Project PI Katie began this process on Monday but unfortunately I had still not been given access by the end of the week.
However, I did continue to work on some of the other outstanding B&B issues on my local PC. I’d noticed that the version number in the footer of the updated system wasn’t getting pulled in when the site is loaded into a browser for the first time and the first page to be loaded is a standard WordPress page (e.g. the site’s homepage). This was because the version number wasn’t getting stored as a session variable until after the page had loaded and I therefore updated the code to add a check for this.
I also investigated the issue of authors that have the same name not being differentiated in the author filter option in the search results. For example, there are two John Lelands – John Leland (Male, born 1691, died 1766) and John Leland (Male, born c.1506, died 1552) but the filter option only lists one John Leland so it’s not possible to focus on one or the other. This is because the filter uses the Solr field ‘afullnames’ to construct the list, and this simply joins an author’s forename and surname together to make the field. I’ll need to update the script that generates the Solr data to deal with this. The simplest way would be to just add dates, or possibly just birth dates for every author, but this would clutter the filter up unnecessarily. An alternative would be for the script to only add such dates where it finds multiple authors with the same name, and in such cases it would then add dates. So for example ‘John Leland, b.1691’ and ‘John Leland, b.c.1506’. I’ll need to do a full check to be sure this will cover all authors – I guess there may be some that don’t have birth years.
Whilst investigating this I ran a query to find all active authors in the system that have the same name as one (or more) other authors and there are 252, which seemed quite high to me and suggests there may be some unnecessary duplicates in the system. I exported these authors to a spreadsheet and one of the project team is going to look into this. I can’t imagine there are two different authors called ‘Cornelius a Lapide’, for example!
Project Co-I Matt had also spotted an issue with apostrophes in the filter options. The apostrophe in the author ‘Pierre Mathurin de L’Ecluse des Loges’ was causing the system to break when the name was selected in the filter options on the search results page. However, other apostrophes work perfectly. If you look at the search results for all authors with the forename ‘Pierre’ (https://borrowing.stir.ac.uk/search/0/0/0/simple/afname|pierre) the “de l’Ecluse” one is (at the time of writing) broken, but lower down we have “Pierre d’ Hancarville” and this works. Both names appear to have ‘straight’ rather than ‘curly’ apostrophes, but looking at the data, our broken Pierre’s apostrophe has actually been encoded and is stored in the system as “'” and it is this that’s breaking things. I’m not sure how this encoded form got into the system – possibly by pasting into the CMS from another website . I checked the database and there are four author surnames that have this encoding, plus one forename. I’ll fix this when I regenerate the data as part of the new version update. I also checked the other data and there are no borrowers with this encoding. However, there are 36 book works and 63 book editions that have this encoding so I’ll fix them too.
This issue got me thinking about apostrophes in the site. ‘Straight’ and ‘curly’ apostrophes are different characters and both appear in the data (see for example “Pierre Joseph d’ Orléans” in the list of Pierres, which has the ‘curly’ form). This doesn’t matter for browsing and filtering, but if the user enters an apostrophe into a search box they will only find results for the apostrophe form they entered, which will mostly be ‘straight’, but I believe Apple can make apostrophes users enter into boxes ‘curly’ on their devices. And of course there are two different ‘curly’ apostrophes – opening and closing. This is not a major issue as I can’t imagine many people will perform a search that includes an apostrophe, but I raised it with the team and we agreed that all apostrophes (and double quotes) in the data should be changed to their ‘straight’ forms, which I’ll also do once I regenerate the data.
Without having access to the server I didn’t want to continue with any further B&B work as I didn’t want to risk making updates locally and then losing track of them before I could replicate them online. I also need the current data from the server and I can’t access this yet either. I therefore moved onto other projects instead.
On Tuesday I had a meeting with Garrick Allen to discuss a new AHRC proposal he’s putting together. I can’t say much about it here, but it was a great meeting and I’ll be involved with the project if it receives funding. I spent a bit of time after the meeting writing up my notes and researching some related matters. I also had an email chat with Craig Lamont about a proposal he’s putting together that I will also be involved with.
Also this week I spent some time making further updates to the Robert Fergusson online exhibition, adding in all missing images, captions and text. The online exhibition is now publicly available and can be viewed here: https://robert-fergusson.glasgow.ac.uk/online-exhibition/.
I also provided some costings and wrote a detailed description of the place-names database tables and columns for Mícheál Ó Mainnín at QUB, who I’m hoping to work on the place-names of Armagh project with. For the DSL I had an email conversation about the new part of speech search results filtering option that I will be developing, I responded to a query about online map development, and I fixed the old Emblems websites that had stopped working due to a server upgrade.
I spent the remainder of the week returning to work on the Anglo-Norman Dictionary. The editor Geert informed me that a search for multiple words was giving a ‘403 Forbidden’ error. The AND’s various search systems don’t actually work with phrases and are all based on individual words, so a search with spaces is never going to yield meaningful results, but such a scary message is not idea. I managed to fix the issue by updating the .htaccess file to process spaces. I also spent some time investigating a strange issue Geert had experienced with cross-references, but despite my best efforts I was unable to replicate it, and neither was Geert. We’re just going to have to keep a look out for this and figure out what circumstance let to it happening.
I also updated the ‘view entry’ page in the content management system to add in buttons to download the cross-referenced entries as a ZIP file. This works for the ‘from’, ‘to’ and ‘view entries that include a cross reference in their XML’ lists, finding the matching entries, accessing their XML files, adding them to a ZIP archive and then presenting it as a download to the user. It all works very well.







