Friday, April 1, 2011

A World of Numismatic Data at Your Fingertips

The JISC Common Repository Interfaces Group (CRIG) has a saying: "The coolest thing to do with your data will be thought of by someone else." The American Numismatic Society's MANTIS interface enables users to search, sort, and browse the collection in a way that is relevant to their own research questions. Users can view query results in the form of HTML pages or OpenLayers maps that draw on KML layers. These are probably the two most common avenues for interacting with the ANS's data, but we have developed several APIs that expose the data in the form of linked data and KML.

Currently, we offer an Atom feed and a KML API. An RDF feed is currently in the works and will be released in the coming weeks. These APIs are based on queries to the Solr search index and can be adjusted based on the user's demands.

Atom: http://numismatics.org/search/feed/?q=*:*
Object KML: http://numismatics.org/search/query.kml?q=*:*
Mint KML: http://numismatics.org/search/mints.kml?q=*:*

The feeds are formulated based on the Lucene query syntax. q=*:* passes a query for all results from all fields (i.e., the entire collection of objects). For example, http://numismatics.org/search/feed/?q=department_facet:"Greek" returns the Atom feed for all coins in the Greek department with 100 results per page. This is particularly useful to those who want to subscribe to the portion of the collection that is relevant to their own interests. The practicality of this feed extends beyond casual subscriptions to updates to the database. The Atom XML contains a reference to the next page in the feed. Each object entry includes a pointer to the HTML record of the coin, as well as pointers to other representations of the data, including, importantly, the source Encoded Archival Description XML file. This allows anyone to scrape the entire ANS collection. With more than 600,000 objects, the Atom feeds creates the potential for interesting quantitative analysis.


The KML APIs works similarly--feed it a Solr query and get results back that you can look at in Google Earth or a similar geographic framework. There are two APIs. The object API (query.kml) returns at most 500 results for the query, with points representing individual objects. The mint API returns a point for each mint the query illuminates. This is the foundation for the OpenLayers map function in MANTIS. There is no limit on the number of mints returned by this API. Providing access to thousands of coins (or the entire collection!) in a single KML file would probably bring down the server.

Refer to the Lucene query syntax linked above on appropriate text to pass to the q parameter. There are a wide variety of fields, detailed below. The field name typically corresponds with numismatic ontology or internal ANS database fields.

Text Fields
  • color_text
  • unitid_text (accession number)
  • legend_text
  • type_text
  • persname_text (any personal name: artist, portrait, issuer, etc.)
  • deity_text
  • geogname_text (geographical name, including mint, locality, region, and findspot)
  • fulltext (keyword search anywhere in the record)

Sortable Numbers
  • axis_sint
  • weight_sint (weight)
  • era_sint (century)
  • year_sint
  • dob_sint (date on object)

String Fields
  • color_display
  • dimensions_display
  • imagesponsor_display
  • unitid_display
  • unitdate_display (date of coin, in textual terms. e.g. 16 BC - AD 3)
  • unittitle_display
  • obv_leg_display (obverse legend)
  • obv_type_display (obverse type)
  • rev_leg_display (reverse legend)
  • rev_type_display (reverse type)
  • reference_display
  • prevcoll_display (previous collection)
  • sernum_display (serial number)
  • category_display
  • timestamp
  • artist_facet
  • authority_facetusefulness
  • category_facet
  • city_facet
  • decoration_facet
  • deity_facet
  • degree_facet
  • denomination_facet
  • department_facet
  • engraver_facet
  • era_facet
  • famname_facet (Dynasty)
  • findspot_facet
  • format_facet (object type)
  • issuer_facet
  • persname_facet (Person)
  • locality_facet
  • manufacture_facet
  • magistrate_facet
  • maker_facet
  • material_facet
  • moneyer_facet
  • mint_facet
  • region_facet
  • script_facet
  • series_facet
  • state_facet
  • subject_facet
  • subjectPerson_facet
  • subjectIssuer_facet
  • subjectEvent_facet
  • subjectPlace_facet

Images
The 'imagesavailable' field can return objects with images if the value is set to 'true'

Geographic
  • mint_geo (geographic coordinates)
  • mint_kml (nomisma.org mint KML URI)

A few notes. String fields (including mint_geo and mint_kml) require exact matches (enclosed by double quotes if the string is providing access to thousands of coins (or the entire collection!) in a single KML file would probably bring down the server.more than one word), but can accommodate Solr wildcards (* and ?).

Have at it!

Examples
http://numismatics.org/search/feed/?q=department_facet:"Islamic" AND weight_sint:[4 TO 5] - All Islamic coins that weigh between 4 and 5 grams

http://numismatics.org/search/feed/?q=type_text:temple AND imagesavailable:true AND department_facet:"Greek" - Greek coins depicting temples that have been photographed

No comments:

Post a Comment

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