- Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathget_records.Rd
68 lines (59 loc) · 2.02 KB
/
get_records.Rd
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
% Generatedbyroxygen2:donoteditbyhand
% PleaseeditdocumentationinR/get_record.R
\name{get_records}
\alias{get_records}
\title{Getrecords}
\usage{
get_records(
ids,
prefix="oai_dc",
url="http://api.gbif.org/v1/oai-pmh/registry",
as="parsed",
...
)
}
\arguments{
\item{ids}{TheOAI-PMHidentifierfortherecord.Oneormore.Required.}
\item{prefix}{specifiesthemetadataformatthattherecordswillbe
returnedin.Default: \code{oai_dc}}
\item{url}{(character) OAI-PMHbaseurl.DefaultstotheURLfor
arXiv's OAI-PMH server (http://export.arxiv.org/oai2)
or GBIF'sOAI-PMH server (http://api.gbif.org/v1/oai-pmh/registry)}
\item{as}{(character) Whattoreturn.Oneof"parsed" (default),
or"raw" (rawtext)}
\item{...}{Curloptionspassedonto \code{\link[httr]{GET}}}
}
\value{
anamedlistofdata.frame's, or lists, or raw text
}
\description{
Get records
}
\details{
There are some finite set of results based on the OAI prefix.
We will provide parsers as we have time, and as users express interest.
For prefix types we have parsers for we return a list of data.frame's,
foreachidentifier, onedata.frameforthe \code{header} bitsofdata, and
onedata.frameforthe \code{metadata} bitsofdata.
Forprefixeswedon't have parsers for, we fall back to returning raw
XML, so you can at least parse the XML yourself.
Because some XML nodes are duplicated, we join values together of
duplicated node names, separated by a semicolon (\verb{;}) with no
spaces. You can seprarate them yourself easily.
}
\examples{
\dontrun{
get_records("87832186-00ea-44dd-a6bf-c2896c4d09b4")
ids <- c("87832186-00ea-44dd-a6bf-c2896c4d09b4",
"d981c07d-bc43-40a2-be1f-e786e25106ac")
(res <- get_records(ids))
lapply(res, "[[", "header")
lapply(res, "[[", "metadata")
do.call(rbind, lapply(res, "[[", "header"))
do.call(rbind, lapply(res, "[[", "metadata"))
# Get raw text
get_records("d981c07d-bc43-40a2-be1f-e786e25106ac", as = "raw")
# from arxiv.org
get_records("oai:arXiv.org:0704.0001", url = "http://export.arxiv.org/oai2")
}
}