introducing drakula for digital repository abstraction

Mon, Nov 29, 2010

I’ve been thinking on how to integrate Fedora and Intralibrary with a Ruby + Dojo front end and with both repositories generating screeds of complicated XML, I knew XML wasn’t the way to go. I’m not a great fan of XML at the best of times and complicated XML, with multiple namespaces, is just a no-go for scripting languages and SAX. But this is where Java + XMLBeans excels, so I developed DRAKula, the Digital Repository Abstraction Kit, which is a set of modules that together make up a Java/Spring based REST facade for multiple digital repositories.

DRAKula

DRAKula provides an easy to use REST interface on any number of repositories. To see what repositories are registered with DRAKula you send an HTTP GET request:

GET: /drakula/ws/repositories
This returns a JSON object with the list of identifiers and names of each repository. You can then use a repository’s identifier to interact with it. For example, this request will get the version of the repository, where “fedora” is the identifier of the registered Fedora repository, obtained from the previous repositories call:
GET: /drakula/ws/version/fedora
The following will search all registered repositories:
GET: /drakula/ws/find
or just search fedora:
/drakula/ws/find/fedora
or if you know the identifier of a resource, load its metadata from the repository:
HEAD: /drakula/ws/find/fedora/demo:raktest
and to delete a resource:
DELETE: /drakula/ws/fedora/demo:raktest
To create a resource in Fedora you use a POST request. In pure REST you’d use a PUT request to the new resource’s URI but in the case of a repository, you don’t know what identifier the repo will create for the new resource, so you need to use POST to create a subordinate resource of Fedora:
POST: /drakula/ws/fedora
but after that, once you know the identifier of the new resource, which is returned from the above request in a JSON object, you use PUT to update the resource:
PUT: /drakula/ws/fedora/demo:raktest
I developed the system in various parts:
  • DRAKula The main Java Spring Web Services application
  • fedora-ws-clients An ant build system that uses Axis2 + XMLBeans data binding to create Fedora API-A and API-M Java web service clients
  • foxml-beans A maven build system for creating FOXML Java beans from the Fedora FOXML XML Schema
  • sru-beans A maven build system for creating SRU Java beans from the SRU XML Schema. This is used to search Intralibrary which DRAKula also supports
So I don’t really deal with XML that much in DRAKula, other than some light DOM work in SRU for various extensions that either don’t have an XML schema or their published schema is corrupt.

And on top of the REST facade I’m developing the LEARN Toolkit, which is an institutional application for recording/finding best practices in eLearning. The toolkit will allow lecturers to search for learning resources in multiple digital repositories and also allow them to upload their own contributions.

The user interface is another fascinating project as I delve into Ruby, Rails3 and Dojo to create an Ajax browser application for interacting with multiple digital repositories via DRAKula.

comments powered by Disqus