metadata – discontents http://discontents.com.au working for the triumph of content over form, ideas over control, people over systems Mon, 13 Sep 2021 04:34:08 +0000 en-US hourly 1 https://wordpress.org/?v=4.8.17 https://creativecommons.org/licenses/by/4.0/ 90077936 Some archives hacking http://discontents.com.au/some-archives-hacking/ http://discontents.com.au/some-archives-hacking/#respond Thu, 05 Nov 2009 00:31:07 +0000 http://discontents.com.au/?p=727

It’s great to see that the National Archives of Australia has released a large swag of data through the new data.australia.gov.au site. In the Commonwealth Agencies zip file you can find xml dumps of all the publicly accessible agency and series data in RecordSearch, as well as item data for series A1. This is the same data that Mitchell Whitelaw visualised so brilliantly in his Visible Archive project. There’s also item data and images from series A3560 – the Mildenhall photographs of early Canberra.

What’s even more exciting is that people are already using this data. At the recent GovHack event in Canberra the What The Federal Government Does team worked on visualising the activities of government by using functions data pulled from the agencies file. Another group has generated a really nice tag cloud and photo gallery from the Mildenhall data. With further GovHack sessions to follow and the MashupAustralia contest open until 13 November, let’s hope for some more inspired archives hacking.

Seeing RecordSearch data out in the world like this reminded me of a little project I started a while back and then set aside. It was a simple PHP script that scraped data from RecordSearch and spat it out either as XML or JSON. Mitchell used a version of this script in his A1 Explorer in order to find out the number of pages in each digitised file.

I’ve now expanded and improved the script so that it provides data on items, series, agencies and persons. The output includes all the basic fields as well as links between entities – such as related series, controlling agencies etc. As an added bonus you also get some useful totals (where they’re available): items include the number of pages, series include the number of items described on RecordSearch, and agencies include the number of series recorded. I’ve also fiddled with mod_rewrite to provide a more rest-ful interface.

For XML output use the url http://discontents.com.au/shed/rs/xml/ followed by the appropriate identifier – a barcode for an item, a CA number for an agency, a CP number for a person or a series number.

Some examples:

As you might have guessed, to get JSON output you just substitute ‘json’ for ‘xml’ in the url.

Being dependent on screen scraping, it’s inherently a bit fragile, but I’m hoping it might be of some use. My intention was to use it to start exploring some new ways of using and interacting with the data. The code itself is available at BitBucket. It’s not very elegant, but I don’t want to spend much time cleaning it up at the moment. If it seems like it might be useful, I’ll probably rewrite the whole thing in python and publish it through Google’s AppEngine.

]]>
http://discontents.com.au/some-archives-hacking/feed/ 0 https://creativecommons.org/licenses/by/4.0/ 727
Harvesting context #1: Flickr comments http://discontents.com.au/harvesting-context-1/ http://discontents.com.au/harvesting-context-1/#comments Sun, 23 Aug 2009 23:57:52 +0000 http://discontents.com.au/?p=670

Instead of idly waiting for visitors to stumble over their holdings on some lonely information by-way,  archives are starting to push their content out into the bustling metropolis of the social web. They are going where the people are. Photographic collections, in particular, are gaining new lives and new audiences thanks to Flickr.

But that’s only part of the story. Released into the wild, these photos are slowly picking up the habits of the locals. They are making friends, building connections, even speaking with new accents and dialects. Commented, tagged, organised, linked – they are building new contexts for themselves outside of the cloying control of archival descriptive systems.

Unfortunately it seems there is often a chasm between the old lives of the photos, documented in databases and finding aids, and their new post-institutional careers. This is a pity because the new contexts they are gathering can help us both understand and find them. What can we do to overcome this divide? How could finding aids harvest and display the user-generated content that aggregates around collection items living in the outside world?

The good news is that the tools to start doing this already exist – Flickr has a powerful API that makes it easy to extract photo metadata. Time for a bit of experimenting…

The first result is a userscript that displays Flickr comments in a number of collection databases. Just install it and then try it out:

  • National Archives of Australia Photosearch – try it!
  • State Records NSW Photo Investigator – try it!
  • National Archives and Records Administration ARC – try it!
Flickr comments in PhotoSearch
Flickr comments in PhotoSearch

Gory details follow…

So to begin with I thought I’d just harvest comments from Flickr and display them within existing collection interfaces. As before (here and here), Greasemonkey was my tool of choice for hacking finding aids. The plan was to trigger a Greasemonkey script when you arrive at a photo in a collection database, the script would then:

  • extract a unique identifier for the photo that could be used to find it in Flickr
  • send off a request through the Flickr API to see if the photo was there
  • if so, then fire off another request to retrieve any comments
  • format the comments and insert them at a suitable point in the DOM of the database page

Easy! Obviously for the script to work there needed to be a way of connecting entries in the database with photos on Flickr. In practice this means that the photos need to be described at item level, and that a unique identifier needs to be used somewhere in the description of the photo both on Flickr and in the collection database.

Any archive that meets these criteria is a candidate for inclusion. Only three pieces of information are necessary:

  • the institution’s Flickr id
  • an expression to extract the identifier from the database page
  • an expression to identify the point on the database page at which the comments should be inserted

The expressions could use XPath or regular expressions – whatever it takes to find the desired elements. I’m using JQuery, so that makes selecting elements a lot easier. For example, NARA ARC includes the item identifier in a div with the class ‘arcID’, so I just select that element using JQuery and then use regex matching to pull out the number:

[code language=”javascript”]this.identifier = $(‘.arcID’).text().match(/ARC Identifier (d+)/i)[1];[/code]

To start with I’ve included the databases of three institutions:

This is the code to save the settings for each institution:

[code language=”javascript”] if (document.location.href.match(/naa.gov.au/scripts/PhotoSearchItemDetail.asp/i)) {
this.name = ‘NAA’;
this.identifier = document.location.href.match(/M=0&B=(d+)/)[1];
this.flickrId = ‘24849862@N08’;
this.position = ‘table:last’;
} else if (document.location.href.match(/records.nsw.gov.au/asp/photosearch/photo.asp?/i)) {
this.name = ‘StateRecordsNSW’;
this.identifier = document.location.href.match(/photo.asp?([dw_]+)/i)[1];
this.flickrId = ‘27331537@N06’;
this.position = ‘table:first’;
} else if (document.location.href.match(/arcweb.archives.gov/arc/action/ShowFullRecord|arcweb.archives.gov/arc/action/ExternalIdSearch/i)) {
this.name = ‘NARA’;
this.identifier = $(‘.arcID’).text().match(/ARC Identifier (d+)/i)[1];
this.flickrId = ‘35740357@N03’;
this.position = ‘.genPad:first’;
}
[/code]

From there it’s just a matter of building the calls to the API using Greasemonkey’s built-in  GM_xmlhttpRequest method. Once the comments are retrieved, they’re given some basic formatting and inserted at the point in the DOM identified by the siteDetails.position property. Once again, JQuery greatly simplifies all the DOM manipulation. If there are no comments then a suitable message is inserted together with a link to the photo in Flickr. Finally some CSS is added to prettify it all a little bit.

You can view the full code on the Userscripts site.

Of course, it would be good to have this sort of stuff happening on the server side. In fact, with a few small modifications, this script could just be dropped into the code of any of the collection databases I’ve used. But in the meantime, Greasemonkey gives us a chance to play around with some of the possibilities – to start thinking about what finding aids might be like.

So what’s next? I’d like to do some playing around with tags and locations, perhaps using them to suggest related photos. I’ve also just realised that Flickr machine tags allow semantic markup… hmmm…

If you have any suggestions for databases to add to this script – let me know!

]]>
http://discontents.com.au/harvesting-context-1/feed/ 8 https://creativecommons.org/licenses/by/4.0/ 670