Wednesday, July 18, 2018

Pagination of physical specimens and CSV downloads

I have made some minor modifications to the coin type pages in OCRE, CRRO, etc. A relatively small number of types across these corpora have more than 100 total specimens, but more importantly a very small handful of types are linked to several hundred or even more than 1,000(!) physical specimens. For example RIC 10 Honorius 1228 is associtaed with 2,396 physical specimens, nearly all of which are in the British Museum (presumably from one or more hoards). This is the single-largest number of specimens associated with a coin type. In these extreme cases, the amount of data to load into one HTML page is simply too great, resulting in the browser overloading and running out of memory.

In order to ameliorate this issue, I have introduced pagination. The number of results per page can be set in the Numishare config, but the default is 48 (16 rows of 3 columns). The page is set by a page request parameter, which is converted into a proper offset in the underlying SPARQL query. The pagination buttons, then, are crawlable by robots since each hyperlink will resolve to a URL (so no AJAX here).

Nearly 400 total coin type URIs have more than 48 specimens (out of roughly 55-60,000 total Hellenistic or Roman coin types across all projects) for which pagination controls will appear. About 100 types have more than 100 specimens and 5 have more than 1,000.

In addition, when physical specimens are present, the user can click to download a CSV file for the metadata about these specimens. It is the same basic query that populates the HTML page and includes URIs for each object, title, measurement data, URLs to images or IIIF services, findspot/hoard data, and source collection/dataset. This should make it easier to use coin type and specimen data for analysis in R or other platforms.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.