Showing posts with label code. Show all posts
Showing posts with label code. Show all posts

Saturday, December 29, 2012

The HMT Manuscript Browser · News and Updates


Summary
: The old version of the Manuscript Browser at chs75.harvard.edu is going away. Its replacement will appear at amphoreus.hpcc.uh.edu. In the interim, a beta application is available at http://beta.hpcc.uh.edu/tomcat/hmtapps/. 
An archive of every digital image in the HMT library is always available for manual and automatic downloading.

Background

In 2007, shortly after we completed photography of manuscripts Marciana 822, Marciana 821, and Marciana 841, we wrote and posted online an application for browsing the high-resolution images. This application used the Google Maps API to allow users to manipulate the images; it allowed searching by the enumeration of manuscript folios and by poetic book and line.
Technological and scholarly considerations alike dictate that we take this original application offline. Using the Google Maps API is not ideal for our purposes. Google Maps assumes that it is displaying images of the surface of the earth, for one thing, and using it for serious work on manuscripts requires many workarounds, compromises, and hacks. More serious, though, is the problem of scholarly citation. In the five years since we wrote the original facsimile browser, our understanding of scholarly citation in a digital world has matured. By standardizing on citation with URNs, we can deliver effective applications today, using scholarly material that can remain valid in the future. The old application does not support citation using URNs; its replacements do.

What Will Happen

The application at chs75.harvard.edu will cease working at any moment. New “Facsimile Browser” applications are being developed on two hosts: beta.hpcc.uh.edu and amphoreus.hpcc.uh.edu. beta hosts experimental versions of HMT applications; when we consider versions of an application ready for regular public use, we will also host them on amphoreus.
In the meantime, users can use two resources for accessing digital images of the Homeric manuscripts:

About the Beta Facsimile Browser

The application that lives at http://beta.hpcc.uh.edu/tomcat/hmtapps/ allows users to look up digital images of manuscripts, and associated data, by requesting citations of folios or by poetic book and line.
We wrote this application to explore a URN-driven graph of HMT data. Its state as of December 26, 2012 reflects its origin as a test-bed for this way of integrating our data.
The application will evolve over the next few weeks as we redesign the user interface with a wider audience in mind. Once that redesign is complete, we will put the application on the amphoreus.hpcc.uh.edu server and announce its public availability.

A Final Word

The Homer Multitext consists of data–images, texts, collections of regularly structured data. It is a reality of the twenty-first century that technology changes rapidly, and thus how we interact with data will change rapidly. From the outset, the editors of the HMT assumed that any particular end-user application would have a lifespan of only a few years. Our goal has been to ensure that the data remain accessible regardless of technological changes, and that the discoveries and insights generated through widespread and free access to that data is never trapped in forms dependent on any particular technology.

Friday, August 3, 2012

ICT · The Image Citation Tool

The Homer Multitext has developed an Image Citation Tool for use with digital images served by the CITE Image Service.

Humanist scholarship is the act of forging new connections between ideas, and placing those connections before the eyes of readers. Those readers must be free and empowered to judge the value of the new connections.

The heart of humanist scholarship, then in quotation. Robert Sokolowski calls quotation a ‘curious conjunction of begin able to name and to contain’;* V.A. Howard is more succinct: quotation is ‘replication-plus-reference’.** We would re-phrase this as “reproduction plus citation”.

Reproduction in a quotation allows us to talk about a particular artifact of human thought without the burden of reproducing its entire context. As a practical matter, it is easier to say “Μῆνιν ἄειδε θεὰ Πηληϊάδεω Ἀχιλῆος” than to reproduce the whole of the Iliad.

Citation in a quotation provides a link from the reproduced selection back to context of that selection. “Iliad 1.1” names our quotation, as Howard says, but also invites the reader to explore Iliad 1.2, all of Book 1 of the Iliad, or the whole poem.

This is easy stuff. We were all taught to do it early in our educations, and we take it for granted.
It is easy, that is, with texts. Images are a different matter. How do you “quote” from an image? Most scholars use images from time to time in their work; few of those uses meet the rigorous standards of “quotation” that we take for granted with texts. The general practice is to open a digital image in an image-editor, cut out the area of the image under discussion, and paste that image into a document or web-page. If the image is cited, the citation is often to a page in a book that has published a version of the image, a museum’s accession number identifying an original work of art, or a URL to a web-page on which a digital version of the image appears. The citation does not provide a path from the selection to its context.

Nor is this kind of “image quotation” actionable in the way that a textual quotation (reproduction+citation) is. Given “Iliad 1.1”, it is simple to answer the question “What comes next?”. It is simple to know that “Iliad 1.1–1.10” includes Iliad 1.5. Given a cut-copied-pasted snippet of a digital image, and perhaps a citation to a web-page, it is not possible to answer with any degree of precision “Where is this snippet in its larger context? What parts of the image are adjacent to this snippet?” Given two snippets, it would require considerable computation to determine whether Snippet A contains Snippet B.

Since the Homer Multitext is committed to image-based scholarly editing, and subsequent discussion and argument based closely on digital imagery of manuscripts and papyri, we have worked to developed a means of quoting images as rigorously, and usefully, as we can quote texts.

The CITE Image Service allows us to identify images with canonical citations in URN-notation. These URNs take the form: urn:cite:hmt:chsimg.VA094VN-0597. This points to a notional image, which might be delivered at any scale, or by services hosted on various machines with various addresses.
A CITE Image URN can take a suffix that identifies a rectangular region-of-interest: urn:cite:hmt:chsimg.VA094VN-0597:0.3833,0.2441,0.0783,0.0463. This URN+ROI can resolve to a “quotation”, that is the region-of-interest on its own, or to a view of the larger image with the region-of-interest highlighted. These image-ROIs canonically cited with URN notation are concise, precise, and machine-actionable mechanisms for image quotation in the best tradition of humanist scholarship.

To help ourselves, our collaborators, and anyone else interested in working with the openly licensed images in our Homer Multitext Image Collection, we have developed a web-based tool for defining regions-of-interest on our digital images and capturing canonical citations for them. This is the Image Citation Tool.

A lengthy introduction to the tool and its use are included in our Homer Multitext documentation pages.   Downloadable source-code for the tool—a relatively simple web-application in HTML, CSS, and Javascript—is available from the HMT’s code repository.

References


* Sokolowski, Robert. “Quotation.” The Review of Metaphysics 37.4 (1984) : 699-723. Print. 24 May 2011.
** Howard, V.A., “On Musical Quotation”, Monist 58 (1974) 310.

Wednesday, July 18, 2012

HTML CTS Kit

Abstract

Announcing for download a package of html, javascript, and css that allows embedding into an html page passages of text served by a Canonical Text Services implementation, by inserting a CTS-URN into a <blockquote></blockquote> element, with a @class attribute “cts-text”. E.g.:
<blockquote class="cts-text" cite="urn:cts:greekLit:tlg0012.tlg001.msA:1.1>Iliad, 1.1</blockquote> 

Background

CTS stands for Canonical Text Services; it is the networked service developed for the Homer Multitext that allows discovery and retrieval of passages of texts using citations in URN format. In short, if an electronic edition or translation of a text is in a CTS service, a user or machine can request that passage using a documented protocol. All of the electronic texts edited for the Homer Multitext are exposed via a CTS service.

The Homer Multitext (HMT) has also developed an image service, which allows citation by URN to images and parts of images.

HTML CTS Kit

Anyone with experience in making web-pages in HTML knows how easy it is to include an image in a page:
<img src="http://url-to-image"/>
A web-browser will interpret that tag as a request to embed the identified image in the page, to show the image to the reader. In other words, the http://url-to-image will be resolved to the image itself.

This is how citation has always worked… an author includes a citation in a piece of writing, and the reader can resolve the citation to the quotation to which it points. In the digital age, we expect that resolution to happen automatically.

Web-browsers have always allowed urls to images to be resolved for readers, even when the images are on different servers from the server hosting the HTML page. It would be nice if text were as easy.
Canonical citation has been the foundation of Classical philology for centuries, and it is the heart and sole linking mechanism of the HMT. In the digital realm we have found this to be a rich, scaleable, and flexible method for building a complex and diverse digital library. The HTML CTS Kit is a package of files that allows authors working in HTML to cite texts concisely using canonical CTS URNs, and have those URNs resolve to the passages to which they point.

Here is a demonstration of a page that uses URNs to cite both CTS texts and a region-of-interest on an image. The page that the reader sees has rich content; the underlying source is very concise:
<h1>High Resolution Scholarship</h1>

<p>The first five lines of the <i>Iliad</i> on the Venetus A:</p>

<blockquote class="cts-text" cite="urn:cts:greekLit:tlg0012.tlg001.msA:7.1-7.5">
Iliad 7.1-7.5</blockquote>

<p>The Summary of Book 7 from the Venetus A, in Dactylic Hexameter:</p>

<img class="cite-img" 
   src="urn:cite:hmt:chsimg.VA091RN-0263:0.2412,0.0845,0.4013,0.0295"/>

<blockquote class="cts-text" cite="urn:cts:greekLit:tlg5026.chs01.msA:7">
Book 7 Summary</blockquote>

How it Works

An author can discover the CTS URN for a text by browing the Homer Multitext’s CTS service, or any other implementation of CTS, such as this one, from Furman, containing Biblical texts. The URN for “Homer, Iliad, Edition based on the Venetus A, Book 7, lines 1–15” is:

urn:cts:greekLit:tlg0012.tlg001.msA:7.1-7.15.

To cite this passage in an HTML page, an author can use the standard HTML5 blockquote element. This element is defined as allowing an attribute named cite; that attribute will hold the CTS URN. In order for the scripts in the HTML CTS Kit to recognize this blockquote as containing a CTS URN that should be resolved, the blockquote element should also have a class attribute, with a value of “cts-text”. blockquote elements should not be empty, so it is a good idea to put a human-readable citation inside the element; if the citation cannot resolve for any reason, that will be what the reader sees. The final citation will look like this:
<blockquote class="cts-text" cite="urn:cts:greekLit:tlg0012.tlg001.msA:1.1>Iliad, 1.1</blockquote> 
Assuming the correct scripts and stylesheets have been included in the HTML page (instructions are here), this is what will happen.
  • When the page loads, the script will find all of these <blockquote>…</blockquote> elements and perform an AJAX request, sending a “GetPassagePlus” request for each URN.
  • As the results of those requests come in, the scripts will process the XML returned by the CTS Services, using XSLT stylesheets to turn the XML into fragments of HTML.
  • Those HTML fragments will be inserted into the page.
  • CSS stylesheets will give some attractive presentation to the newly inserted quotations.
The XSLT and CSS is of course entirely customizeable by anyone who wants to change the structure or appearance of the resulting texts; what we provide is simply a default.

HTML CTS Kit uses the jQuery Javascript Library for most of its work, and the Sarissa library to process XSLT via Javascript.

License and Download

Like all code and data in the Homer Multitext, the HTML CTS Kit is available under an open-content license, and we hope people will find it useful. The official guide is here. Download links are here.

Idea for improvement

None of this works inside Blogger. If anyone can make it work with Blogger, we would love to hear about it!

Building the HMT web site

As part of our broader effort to automate the management of the expanding digital resources of the Homer Multitext project, we have recently defined four sections of the www.homermultitext.org web site:

  1. archival data (hmt-data)
  2. technical documentation (hmt-doc)
  3. programs developed for the HMT (hmt-code)
  4. end-user applications (hmt-apps)
The content is written in markdown in four repositories hosted on bitbucket.org.  The markdown pages are converted to HTML5 and formatted for inclusion in the HMT web site using mdweb,  a minimal system for managing structured documentation in markdown syntax which you can find among our first listings in the new hmt-code section of the site (here).

We hope that with this very lightweight documentation system we will be able to keep these sections of the web site up to date more easily.  The new system has already simplified mirroring those sections of the HMT web site:  you can currently find clones of all four sections on katoptron.holycross.edu.

To coordinate blog entries here with content on the homermultitext.org web site, we will include tags parallel to the four web site sections (data, doc, code, apps) on discussion here relevant to one of those sections.