An Omeka API client in R
First, make sure you have devtools.
Then, install this package from the GitHub repository.
First you must specify the API endpoint for the Omeka site that you are using. This will be stored in an environment variable. (To specify your API key, see
site_info <- omeka_get("site") war_dept <- omeka_get("items", 197)
The item is returned as a list. (If you get multiple items, then they are returned as a list of lists.) Some information about the item is easily accessed.
Most of the interesting information, however, is deeply nested within the list. You can use the following accessor function to get a named character vector of the item's metadata. Optionally you can pass a filter to get only certain kinds of metadata back.
element_texts(war_dept) element_texts(war_dept, filter = "Content Experts") element_texts(war_dept, filter = "Technology Used")
There is a function
get_all_items() which will download all the items on an Omeka site, but use this with caution.