Skip to content

DRUM

The Digital Repository at the University of Maryland (DRUM) collects, preserves, and provides public access to the scholarly output of the university. Faculty and researchers can upload research products for rapid dissemination, global visibility and impact, and long-term preservation.

OAI-PMH

API Description: OAI-PMH

Endpoint: https://api.drum.lib.umd.edu/server/oai/request

Example:

drum-oaipmh.sh
curl "https://api.drum.lib.umd.edu/server/oai/request?verb=Identify"

curl "https://api.drum.lib.umd.edu/server/oai/request?verb=ListSets"

curl "https://api.drum.lib.umd.edu/server/oai/request?verb=ListMetadataFormats"

Additional Examples:

OpenSearch

API Description: OpenSearch

Endpoint: https://api.drum.lib.umd.edu/server/opensearch/search

Example: drum-search.py

drum-search.py
#!/usr/bin/env python3

import urllib.request
from xml.etree import ElementTree

# Search DRUM using OpenSearch

ENDPOINT = 'https://api.drum.lib.umd.edu/server/opensearch/search'


def search(**params):
    ''' Search DRUM using OpenSearch, using named parameters '''

    # Build the URL
    params['rpp'] = 5  # get first 5 results
    search_url = ENDPOINT + '?' + urllib.parse.urlencode(params)

    print('\n========================')
    print(f'Search URL: {search_url}')

    # Get search results as parsed XML
    with urllib.request.urlopen(search_url) as request:
        atom = ElementTree.parse(request).getroot()

        # Iterate over the returned items
        for element in atom.findall('{http://www.w3.org/2005/Atom}entry'):

            # Extract Item information
            title = element.find('{http://www.w3.org/2005/Atom}title').text
            handle_url = element.find('{http://www.w3.org/2005/Atom}link').get('href')
            author = element.find('{http://www.w3.org/2005/Atom}author/{http://www.w3.org/2005/Atom}name').text

            print('----')
            print(f'Title:      {title}')
            print(f'Author:     {author}')
            print(f'Handle URL: {handle_url}')


# phrase is "Black Lives Matter"
search(query='"Black Lives Matter"')


# advisor is smela
# collection is http://hdl.handle.net/1903/2795 (Mechanical Engineering ETDs)
search(query='advisor:smela', scope='a96d44b7-57d2-46ed-80e9-98f316a82a19')


# community is http://hdl.handle.net/1903/2278 (Library Staff Research Works)
search(query='*:*', scope='14dd3089-86f9-4bac-949f-347e0c637984')

DSpace REST API

API Description: DSpace REST API

Endpoint: https://api.drum.lib.umd.edu/server/api

The endpoint is explorable using the HAL Browser at https://api.drum.lib.umd.edu/server.

Example:

drum-api.py
#!/usr/bin/env python3

import urllib.request
import json

# Get a list of items from DRUM using the REST API

ENDPOINT = 'https://api.drum.lib.umd.edu/server/api'

items_url = ENDPOINT + '/discover/browses/title/items'

# Get JSON results
with urllib.request.urlopen(items_url) as request:
    response = json.loads(request.read())

    # Iterate over the returned items
    for item in response['_embedded']['items']:
        md = item['metadata']
        if 'dc.identifier.uri' in md:
            link = "; ".join(entry['value'] for entry in md['dc.identifier.uri'])
        else:
            link = "n/a"
        if 'dc.title' in md:
            title = "; ".join(entry['value'] for entry in md['dc.title'])
        else:
            title = "n/a"

        print('----')
        print(f'Title: {title}')
        print(f'Link:  {link}')

Additional Example:

JSON-LD

Format Description: JSON-LD

You can extract schema.org DataSet structured data, encoded using JSON-LD, from HTML pages in our UMD Data Community.

Example: