core_advanced_search: Advanced Search CORE

View source: R/core_advanced_search.R

core_advanced_searchR Documentation

Advanced Search CORE

Description

Advanced Search CORE

Usage

core_advanced_search(
  ...,
  page = 1,
  limit = 10,
  key = NULL,
  parse = TRUE,
  .list = list()
)

core_query(..., op = "AND")

Arguments

...

for core_query(), query fields, see Details. for core_advanced_search() any number of queries, results of calling core_query(). Required. See Details.

page

(character) page number (default: 1), optional

limit

(character) records to return (default: 10, minimum: 10, maximum: 100), optional

key

A CORE API key. Get one at https://core.ac.uk/api-keys/register. Once you have the key, you can pass it into this parameter, or as a much better option, store your key as an environment variable with the name CORE_KEY or an R option as core_key. See ?Startup for how to work with env vars and R options

parse

(logical) Whether to parse to list (FALSE) or data.frame (TRUE). Default: TRUE

.list

alternative to passing core_query() calls to ...; just create a list of them and pass to this parameter; easier for programming with

op

(character) operator to combine multiple fields. options: AND, OR

Details

query should be one or more calls to core_query(), (at least one is required):

  • title

  • description

  • fullText

  • authors

  • publisher: string, to be used as an absolute match against the publisher name metadata field

  • repositories.id: repository id

  • repositories.name: repository name

  • doi: string, to be used as an absolute match against the repository name metadata field (all other fields will be ignored if included)

  • oai

  • identifiers

  • language.name: string, to filter against languages specified in https://en.wikipedia.org/wiki/ISO_639-1

  • year: year to filter to

core_advanced_search does the HTTP request and parses, while core_advanced_search_ just does the HTTP request, gives back JSON as a character string

Value

data.frame with the following columns:

  • status: string, which will be 'OK' or 'Not found' or 'Too many queries' or 'Missing parameter' or 'Invalid parameter' or 'Parameter out of bounds'

  • totalHits: integer, Total number of items matching the search criteria

  • data: list, a list of relevant resource

References

https://core.ac.uk/docs/#!/all/searchBatch

Examples

## Not run: 
## compose queries
core_query(title="psychology", year=2014)
core_query(title="psychology", year=2014, op="OR")
core_query(identifiers='"oai:aura.abdn.ac.uk:2164/3837"',
  identifiers='"oai:aura.abdn.ac.uk:2164/3843"', op="OR")

## do actual searches
core_advanced_search(
  core_query(identifiers='"oai:aura.abdn.ac.uk:2164/3837"',
    identifiers='"oai:aura.abdn.ac.uk:2164/3843"', op="OR")
)

res <- core_advanced_search(
  core_query(title="psychology"),
  core_query(doi='"10.1186/1471-2458-6-309"'),
  core_query(language.name="german")
)
res

## End(Not run)

ropensci/rcoreoa documentation built on Sept. 14, 2022, 9:50 a.m.