Using Mms Web Services

THL Toolbox > Developers' Zone > Ruby on Rails Development > RoR Media Management-MMS Application Development > How to Use MMS Web-Services

How to Use MMS Web-Services

Contributor(s): Than Grove

Images

To find out the XML metadata for a single image, locate the image in MMS and add ".xml" to the URL. This will produce an XML file that contains information about the image along with the different URLs to the various sizes. These URLs can be used when a particular size is needed to be displayed. For example, the URL external link: http://mms.thlib.org/media_objects/604.xml produces the following XML:

<picture>
   <id>604</id>
   <copyright id="604">
   <copyright_holder title="ILCS" website="http://www.rub.edu.bt" id="3"/>
      <reproduction_type title="only private uses permitted" website="" id="4"/>
   </copyright>
   <associated_category title="Ritual Documentation" id="3816"/>
   <associated_category title="Namkha Lhakhang Tang Rabney" id="4030"/>
   <associated_feature fid="18104" title="Namkha"/>
   <image thumbnail="compact" height="95" url="http://mms.thlib.org/images/0000/1795/604_compact.jpg" size="3015" width="95"/>
   <image thumbnail="essay" height="225" url="http://mms.thlib.org/images/0000/1795/604_essay.jpg" size="21428" width="300"/>
   <image thumbnail="huge" height="300" url="http://mms.thlib.org/images/0000/1795/604_huge.jpg" size="56051" width="400"/>
   <image thumbnail="large" height="300" url="http://mms.thlib.org/images/0000/1795/604_large.jpg" size="35325" width="400"/>
   <image thumbnail="normal" height="300" url="http://mms.thlib.org/images/0000/1795/604_normal.jpg" size="35325" width="400"/>
   <image thumbnail="search" height="113" url="http://mms.thlib.org/images/0000/1795/604_search.jpg" size="5398" width="150"/>
   <image thumbnail="thumb" height="120" url="http://mms.thlib.org/images/0000/1795/604_thumb.jpg" size="4404" width="120"/>
</picture>

Full List of Tags

The API will provide the following tags (if data is available in the database):

  • id
  • type
  • photographer (id, fullname)
  • resource_type (id, header)
  • taken_on
  • quality_type (id, title)
  • recording_note
  • private_note
  • rotation (in degrees)
  • recording_orientation (id, title)
  • publisher (id, title, country_id, country)
  • capture_device (model_id, model_title, model_exif_tag, maker_id, maker_title, exif_tag)
  • titles (title, translated_titles(id, lang, title))
  • captions (id, lang, title, caption_type(id, title))
  • descriptions (id, lang, title, description_type(id, title))
  • copyrights (copyright_holder(id, title, website), reproduction_type(id, type, title, website))
  • locations
  • keywords (id, title)
  • affiliations (sponsor(id, title), organization(id, title, website), project (id, title))
  • workflow (id, original_filename, original_medium_id, other_id, notes, sequence_order, metadata_source(id, filename), original_path)
  • associated_category (id, root_id, string_value, numeric_value)
  • locations
  • typescript (url, size, content_type)
  • images (url, thumbnail, width, height, size)
  • web_address (url, parent_resource_id)

Collections

If one wants the information about a specific collection of images, such as those with a parameter "?keyword_id=…", append the parameter "&format=xml" to the end of the URL. This will provide an "array" of XML nodes with information about each image in that group. These nodes do not however contain the URL for each individual version of each picture. Instead, the idea for that image must be used as described above to find the individual image locations. An example of this is:

external link: http://mms.thlib.org/media_objects?keyword_id=32&format=xml

Searches

One can perform a search on MMS through the URL by using GET parameters, namely by calling external link: http://mms.thlib.org/media_searches? followed by a list of key=value pairs. The most common search parameters are:

  • media_search_title : This is the search keyword(s), such as "mountain"
  • media_search_type : this can be either "simple" or "boolean". Simple is a regular search, boolean is advanced search.

An example is: external link: http://mms.thlib.org/media_searches?media_search_title=+mountain&media_search_type=boolean

Provided for unrestricted use by the external link: Tibetan and Himalayan Library