dc_search: DataCite Solr web service for search, facet, stats, and mlt...

Description Usage Arguments Details References Examples

Description

DataCite Solr web service for search, facet, stats, and mlt queries

Usage

1
2
3
4
5
6
7
dc_search(..., proxy = NULL, callopts = list())

dc_facet(..., proxy = NULL, callopts = list())

dc_stats(..., proxy = NULL, callopts = list())

dc_mlt(..., proxy = NULL, callopts = list())

Arguments

...

Solr parameters passed on to the respective solrium package function. See Details below.

proxy

List of arguments for a proxy connection, including one or more of: url, port, username, password, and auth. See proxy for help, which is used to construct the proxy connection.

callopts

Curl options in a named list passed on to HttpClient, see curl-options

Details

See the solrium package documentation for available parameters. For each of dc_search, dc_facet, dc_stats, and dc_mlt see the equivalently named function in solrium:

Fields you can search on and retrieve back are:

If you want to use wt='csv' you'll need solrium package version 0.1.8.99 or greater. Installation instructions at https://github.com/ropensci/solrium#quick-start.

References

https://support.datacite.org/docs/datacite-search-user-documentation

Examples

 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
library(crul)
url <- "https://search.datacite.org/api"
if (crul::HttpClient$new(url=url)$get()$success()) {

# Search
## various searches
### containing laser
dc_search(q = "laser", fl=c('doi','publicationYear'), rows=5)

### containing laser and safety
dc_search(q = "laser safety", fl=c('doi','publicationYear'),
  rows=5)

### containing laser and not medicine
dc_search(q = "laser -medicine", fl=c('doi',
  'publicationYear'), rows=5)

}

## Not run: 
### containing laser and red or green
dc_search(q = "laser AND (red OR green)", fl=c('doi',
  'publicationYear'), rows=5)

### containing wind turbine as a phrase in the title
dc_search(q = 'title:"wind turbine"', fl=c('doi','title'),
  rows=5)

### containing geology in metadata field subject
dc_search(q = "subject:geology", fl=c('doi','subject'),
  rows=5)

### belonging to DataCite members BL or TIB
dc_search(q = "allocator:(BL OR TIB)", fl=c('doi','allocator'),
  rows=5)

### published between 2000 and 2005
dc_search(q = "publicationYear:[2000 TO 2005]",
  fl=c('doi','publicationYear'), rows=5)

### uploaded to DataCite in the last 5 days
dc_search(q = "uploaded:[NOW-5DAYS TO NOW]",
  fl=c('doi','uploaded'), rows=5)

## search with csv output
### If you want to use wt=csv, install development version of
### solr package, see Details
dc_search(q = 'wind', fl=c('doi','title'), wt='csv')

# Faceting
dc_facet(q = "wind", facet.field='publisher_facet')

# Stats
dc_stats(q = "ecology", stats.field='date')

# More like this (aka mlt)
dc_mlt(q = "ecology", mlt.fl='title', mlt.count=5,
  fl=c('doi','title'))


## End(Not run)

rdatacite documentation built on May 8, 2019, 1:03 a.m.