| Title: | Interact with the Omeka S API from R |
|---|---|
| Description: | Interact with the Omeka S API from R. |
| Authors: | Giorgio Comai [aut, cre, cph] (ORCID: <https://orcid.org/0000-0002-0515-9542>) |
| Maintainer: | Giorgio Comai <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.0.0.9003 |
| Built: | 2026-05-21 08:57:34 UTC |
| Source: | https://codeberg.org/giocomai/omekasr |
Checks if the base url given or set for the session can be parsed
o_check_url(base_url = NULL, silent = FALSE, error = TRUE)o_check_url(base_url = NULL, silent = FALSE, error = TRUE)
base_url |
Endpoint of the API of the Omeka installation, or base url of
the website. Internally, it is ensured that the |
silent |
Logical, defaults to |
error |
Logical, defaults to |
A list with three elements: valid (either TRUE or FALSE),
value (returning base_url), and message (returning an informative
message about the result of the check, typically shown with
cli::cli_inform()).
try( o_check_url("wrong_url/api") ) o_check_url("wrong_url/api", error = FALSE) o_check_url("http://127.0.0.0")try( o_check_url("wrong_url/api") ) o_check_url("wrong_url/api", error = FALSE) o_check_url("http://127.0.0.0")
Retrieve results from Omeka S API
o_get(id, type = c("items", "properties"), base_url = NULL)o_get(id, type = c("items", "properties"), base_url = NULL)
id |
An Omeka S numeric identifier. |
type |
Defaults to "items". Accepted values include "item" and "properties". |
base_url |
Endpoint of the API of the Omeka installation, or base url of
the website. Internally, it is ensured that the |
A list object, with attributes detailing the source url, the type of API endpoint called, and the timestamp of data retrieval.
## Not run: o_get(id = 123, type = "items") o_get(id = "123", type = "items") # id can be given as character o_get(id = 12, type = "properties") ## End(Not run)## Not run: o_get(id = 123, type = "items") o_get(id = "123", type = "items") # id can be given as character o_get(id = 12, type = "properties") ## End(Not run)
Retrieve Omeka S item based on id
o_get_item(item_id, base_url = NULL)o_get_item(item_id, base_url = NULL)
item_id |
The numeric identifier of an Omeka S item. |
base_url |
Defaults to |
A list object, with everything returned by the API.
## Not run: o_get_item(id = 123) ## End(Not run)## Not run: o_get_item(id = 123) ## End(Not run)
Retrieve Omeka S property based on id
o_get_property(property_id, base_url = NULL)o_get_property(property_id, base_url = NULL)
property_id |
The numeric identifier of an Omeka S property. |
base_url |
Defaults to |
A list object, with everything returned by the API.
## Not run: o_get_property(property_id = 12) ## End(Not run)## Not run: o_get_property(property_id = 12) ## End(Not run)
Sets settings for the current session.
o_set(base_url = NULL, error = TRUE)o_set(base_url = NULL, error = TRUE)
base_url |
Endpoint of the API of the Omeka installation, or base url of
the website. Internally, it is ensured that the |
error |
Defaults to |
Invisibly, the settings as a list.
o_set(base_url = "https://example.com/api") base_url <- o_set()[["base_url"]] base_urlo_set(base_url = "https://example.com/api") base_url <- o_set()[["base_url"]] base_url
Performs a set of tests for troubleshooting common issues, and provides informative message.
o_sitrep(base_url = NULL)o_sitrep(base_url = NULL)
base_url |
Endpoint of the API of the Omeka installation, or base url of
the website. Internally, it is ensured that the |
Nothing, used for its side effects.
o_sitrep()o_sitrep()
S7 class representing an Omeka S item
omekas_item( data = list(), url = character(0), type = character(0), retrieved_at = Sys.time(), id = integer(0) )omekas_item( data = list(), url = character(0), type = character(0), retrieved_at = Sys.time(), id = integer(0) )
data |
A list; the parsed json from the API response. |
url |
Full URL from where the response was retrieved. |
type |
The type of contents or resource retrieved from the API, e.g. "items", or "properties". |
retrieved_at |
Time when the given resource was retrieved. |
id |
Numeric, the identifier of the resource requested. |
S7 class representing an Omeka S property
omekas_property( data = list(), url = character(0), type = character(0), retrieved_at = Sys.time(), id = integer(0) )omekas_property( data = list(), url = character(0), type = character(0), retrieved_at = Sys.time(), id = integer(0) )
data |
A list; the parsed json from the API response. |
url |
Full URL from where the response was retrieved. |
type |
The type of contents or resource retrieved from the API, e.g. "items", or "properties". |
retrieved_at |
Time when the given resource was retrieved. |
id |
Numeric, the identifier of the resource requested. |
S7 class representing an Omeka S API response
omekas_response( data = list(), url = character(0), type = character(0), retrieved_at = Sys.time() )omekas_response( data = list(), url = character(0), type = character(0), retrieved_at = Sys.time() )
data |
A list; the parsed json from the API response. |
url |
Full URL from where the response was retrieved. |
type |
The type of contents or resource retrieved from the API, e.g. "items", or "properties". |
retrieved_at |
Time when the given resource was retrieved. |