/
pg_identify.R
31 lines (30 loc) · 1.15 KB
/
pg_identify.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#' Identify information about the Pangaea repository
#'
#' @export
#' @param ... Curl debugging options passed on to [oai::id()]
#' @return list
#' @references [OAI-PMH documentation](https://www.openarchives.org/pmh/)
#' @seealso wraps [oai::id()]
#' @family oai methods
#' @examples \dontrun{
#' pg_identify()
#' }
pg_identify <- function(...) {
res <- oai::id(url = baseoai(), ...)
structure(as.list(res), class = "pg_identify")
}
#' @export
print.pg_identify <- function(x, ...){
cat("<Pangaea>", "\n", sep = "")
cat(" repositoryName: ", x$repositoryName, "\n", sep = "")
cat(" baseURL: ", x$baseURL, "\n", sep = "")
cat(" protocolVersion: ", x$protocolVersion, "\n", sep = "")
cat(" adminEmail: ", x$adminEmail, "\n", sep = "")
cat(" adminEmail: ", x$adminEmail, "\n", sep = "")
cat(" earliestDatestamp: ", x$earliestDatestamp, "\n", sep = "")
cat(" deletedRecord: ", x$deletedRecord, "\n", sep = "")
cat(" granularity: ", x$granularity, "\n", sep = "")
cat(" compression: ", paste0(x[ names(x) %in% "compression" ],
collapse = ","), "\n", sep = "")
cat(" description: ", x$description, "\n", sep = "")
}