Title: | Access documents from the Open Archive HAL |
---|---|
Description: | Access references and download documents from the Open Archive HAL <https://hal.archives-ouvertes.fr/> using the search API. |
Authors: | Nicolas Frerebeau [aut, cre] , Université Bordeaux Montaigne [cph, fnd] |
Maintainer: | Nicolas Frerebeau <[email protected]> |
License: | GPL (>= 3) |
Version: | 0.0.0.9000 |
Built: | 2024-09-29 04:04:12 UTC |
Source: | https://github.com/nfrerebeau/odyssey |
Initialize a request to the HAL API.
hal_api()
hal_api()
An object of class HALQuery
: a list
containing at least the following
components:
q
(default to "*:*
").
fl
default to "docid
" "label_s
").
fq
sort
rows
(default to 30
).
start
(default to 0
).
wt
(default to "json
").
hal_api()
hal_api()
Download Documents
hal_download(x, ...) ## S3 method for class 'HALQuery' hal_download( x, limit = 30, start = 0, progress = getOption("odyssey.progress"), verbose = getOption("odyssey.verbose"), ... )
hal_download(x, ...) ## S3 method for class 'HALQuery' hal_download( x, limit = 30, start = 0, progress = getOption("odyssey.progress"), verbose = getOption("odyssey.verbose"), ... )
x |
An object of class |
... |
Currently not used. |
limit |
An |
start |
An |
progress |
A |
verbose |
A |
An (invisible) logical
scalar, TRUE
for success and FALSE
if
any failure.
N. Frerebeau
Other search tools:
search()
## Not run: library(magrittr) ## Download the 10 most recent archaeological publication ## (if any files) hal_api() %>% hal_query("archéologie") %>% hal_filter("ART" %IN% "docType_s") %>% hal_sort("producedDate_tdate", decreasing = TRUE) %>% hal_download(limit = 10) ## End(Not run)
## Not run: library(magrittr) ## Download the 10 most recent archaeological publication ## (if any files) hal_api() %>% hal_query("archéologie") %>% hal_filter("ART" %IN% "docType_s") %>% hal_sort("producedDate_tdate", decreasing = TRUE) %>% hal_download(limit = 10) ## End(Not run)
Facet Search
hal_facet(x, ...) ## S3 method for class 'HALQuery' hal_facet( x, field, limit = 5, sort = c("index", "count"), prefix = NULL, contains = NULL, pivot = NULL, range = NULL, ignore_case = FALSE, ... )
hal_facet(x, ...) ## S3 method for class 'HALQuery' hal_facet( x, field, limit = 5, sort = c("index", "count"), prefix = NULL, contains = NULL, pivot = NULL, range = NULL, ignore_case = FALSE, ... )
x |
An object of class |
... |
Currently not used. |
field |
A |
limit |
An |
sort |
A |
prefix |
A |
contains |
A |
pivot |
A |
range |
A |
ignore_case |
A |
An object of class HALQuery
.
N. Frerebeau
Other query tools:
hal_filter()
,
hal_group()
,
hal_query()
,
hal_select()
,
hal_sort()
## Not run: library(magrittr) ## Most recent publication by journal hal_api() %>% hal_query("archéologie") %>% hal_facet( field = "docType_s", limit = 100, sort = "count", range = list( range = "producedDateY_i", start = 2000, end = 2020, gap = 1 ) ) %>% hal_search(limit = 10) ## End(Not run)
## Not run: library(magrittr) ## Most recent publication by journal hal_api() %>% hal_query("archéologie") %>% hal_facet( field = "docType_s", limit = 100, sort = "count", range = list( range = "producedDateY_i", start = 2000, end = 2020, gap = 1 ) ) %>% hal_search(limit = 10) ## End(Not run)
Filter Results
hal_filter(x, ...) ## S3 method for class 'HALQuery' hal_filter(x, value, field = NULL, ...)
hal_filter(x, ...) ## S3 method for class 'HALQuery' hal_filter(x, value, field = NULL, ...)
x |
An object of class |
... |
Currently not used. |
value |
A |
field |
A |
An object of class HALQuery
.
N. Frerebeau
Other query tools:
hal_facet()
,
hal_group()
,
hal_query()
,
hal_select()
,
hal_sort()
library(magrittr) ## Simple filer hal1 <- hal_api() %>% hal_filter("file", "submitType_s") hal1$fq ## Advanced filter hal2 <- hal_api() %>% hal_filter(c("THESE", "HDR"), "docType_s") hal2$fq ## Multiple filters hal3 <- hal_api() %>% hal_filter("[NOW-1MONTHS/DAY TO NOW/HOUR]", "submittedDate_tdate") %>% hal_filter("-notice", "submitType_s") hal3$fq ## Range filters hal4 <- hal_api() %>% hal_filter("[2000 TO 2013]", "submittedDateY_i") hal4$fq hal5 <- hal_api() %>% hal_filter("[Aa TO Ab]", "city_s") hal5$fq
library(magrittr) ## Simple filer hal1 <- hal_api() %>% hal_filter("file", "submitType_s") hal1$fq ## Advanced filter hal2 <- hal_api() %>% hal_filter(c("THESE", "HDR"), "docType_s") hal2$fq ## Multiple filters hal3 <- hal_api() %>% hal_filter("[NOW-1MONTHS/DAY TO NOW/HOUR]", "submittedDate_tdate") %>% hal_filter("-notice", "submitType_s") hal3$fq ## Range filters hal4 <- hal_api() %>% hal_filter("[2000 TO 2013]", "submittedDateY_i") hal4$fq hal5 <- hal_api() %>% hal_filter("[Aa TO Ab]", "city_s") hal5$fq
Group Results
hal_group(x, ...) ## S3 method for class 'HALQuery' hal_group(x, field, limit = 1, sort = "score", decreasing = FALSE, ...)
hal_group(x, ...) ## S3 method for class 'HALQuery' hal_group(x, field, limit = 1, sort = "score", decreasing = FALSE, ...)
x |
An object of class |
... |
Currently not used. |
field |
A |
limit |
An |
sort |
A |
decreasing |
A |
An object of class HALQuery
.
N. Frerebeau
Other query tools:
hal_facet()
,
hal_filter()
,
hal_query()
,
hal_select()
,
hal_sort()
## Not run: library(magrittr) ## Most recent publication by journal hal_api() %>% hal_query("archéologie") %>% hal_select("producedDate_tdate") %>% hal_filter("ART" %IN% "docType_s") %>% hal_sort("producedDate_tdate", decreasing = TRUE) %>% hal_group(field = "journalTitle_s", limit = 1, sort = "producedDate_tdate", decreasing = TRUE) %>% hal_search(limit = 10) ## End(Not run)
## Not run: library(magrittr) ## Most recent publication by journal hal_api() %>% hal_query("archéologie") %>% hal_select("producedDate_tdate") %>% hal_filter("ART" %IN% "docType_s") %>% hal_sort("producedDate_tdate", decreasing = TRUE) %>% hal_group(field = "journalTitle_s", limit = 1, sort = "producedDate_tdate", decreasing = TRUE) %>% hal_search(limit = 10) ## End(Not run)
Build Query
hal_query(x, ...) ## S3 method for class 'HALQuery' hal_query(x, value, field = NULL, ...) x %OR% y x %AND% y x %NOT% y x %BY% y x %IN% y x %TO% y
hal_query(x, ...) ## S3 method for class 'HALQuery' hal_query(x, value, field = NULL, ...) x %OR% y x %AND% y x %NOT% y x %BY% y x %IN% y x %TO% y
x , y
|
A |
... |
Currently not used. |
value |
A |
field |
A |
An object of class HALQuery
.
N. Frerebeau
Other query tools:
hal_facet()
,
hal_filter()
,
hal_group()
,
hal_select()
,
hal_sort()
library(magrittr) ## Select fields hal1 <- hal_api() %>% hal_query("asie") hal1$q term <- list("japon", "france") hal2 <- hal_api() %>% hal_query(term, field = "title_t") hal2$q term <- list("Journal", c("Histoire", "History")) hal3 <- hal_api() %>% hal_query(term, field = "title_t") hal3$q ## Update query hal4 <- hal_query(hal1, "agricol?") hal4$q ## Operators term <- list("Paris", "France", "history") %NOT% list("Texas", "history") hal5 <- hal_api() %>% hal_query(term %IN% "text") hal5$q term <- c("aluminium", "fer") %BY% 3 %IN% "title_t" hal6 <- hal_api() %>% hal_query(term) hal6$q term <- list("ecology" %IN% "title_t", "cell" %IN% "text") hal7 <- hal_api() %>% hal_query(term) hal7$q
library(magrittr) ## Select fields hal1 <- hal_api() %>% hal_query("asie") hal1$q term <- list("japon", "france") hal2 <- hal_api() %>% hal_query(term, field = "title_t") hal2$q term <- list("Journal", c("Histoire", "History")) hal3 <- hal_api() %>% hal_query(term, field = "title_t") hal3$q ## Update query hal4 <- hal_query(hal1, "agricol?") hal4$q ## Operators term <- list("Paris", "France", "history") %NOT% list("Texas", "history") hal5 <- hal_api() %>% hal_query(term %IN% "text") hal5$q term <- c("aluminium", "fer") %BY% 3 %IN% "title_t" hal6 <- hal_api() %>% hal_query(term) hal6$q term <- list("ecology" %IN% "title_t", "cell" %IN% "text") hal7 <- hal_api() %>% hal_query(term) hal7$q
Select Fields
hal_select(x, ...) ## S3 method for class 'HALQuery' hal_select(x, ...)
hal_select(x, ...) ## S3 method for class 'HALQuery' hal_select(x, ...)
x |
An object of class |
... |
One or more |
An object of class HALQuery
.
N. Frerebeau
Other query tools:
hal_facet()
,
hal_filter()
,
hal_group()
,
hal_query()
,
hal_sort()
library(magrittr) ## Select fields hal1 <- hal_api() %>% hal_select("label_s") hal1$fl hal2 <- hal_api() %>% hal_select("halId_s", "uri_s") hal2$fl ## Update query hal3 <- hal_select(hal1, "docType_s") hal3$fl
library(magrittr) ## Select fields hal1 <- hal_api() %>% hal_select("label_s") hal1$fl hal2 <- hal_api() %>% hal_select("halId_s", "uri_s") hal2$fl ## Update query hal3 <- hal_select(hal1, "docType_s") hal3$fl
Sort Results
hal_sort(x, field, decreasing = FALSE, ...) hal_sort(x, field, decreasing = FALSE, ...)
hal_sort(x, field, decreasing = FALSE, ...) hal_sort(x, field, decreasing = FALSE, ...)
x |
An object of class |
field |
A |
decreasing |
A |
... |
Currently not used. |
An object of class HALQuery
.
N. Frerebeau
Other query tools:
hal_facet()
,
hal_filter()
,
hal_group()
,
hal_query()
,
hal_select()
library(magrittr) ## Select fields hal1 <- hal_api() %>% hal_sort("docid") hal1$sort ## Update query hal2 <- hal_sort(hal1, "producedDate_tdate", decreasing = TRUE) hal2$sort
library(magrittr) ## Select fields hal1 <- hal_api() %>% hal_sort("docid") hal1$sort ## Update query hal2 <- hal_sort(hal1, "producedDate_tdate", decreasing = TRUE) hal2$sort
Search
hal_count(x, ...) hal_search(x, ...) ## S3 method for class 'HALQuery' hal_count(x, path = "search", ...) ## S3 method for class 'HALQuery' hal_search( x, path = "search", limit = 30, start = 0, cursor = FALSE, parse = "df", concat = ",", progress = getOption("odyssey.progress"), verbose = getOption("odyssey.verbose"), ... )
hal_count(x, ...) hal_search(x, ...) ## S3 method for class 'HALQuery' hal_count(x, path = "search", ...) ## S3 method for class 'HALQuery' hal_search( x, path = "search", limit = 30, start = 0, cursor = FALSE, parse = "df", concat = ",", progress = getOption("odyssey.progress"), verbose = getOption("odyssey.verbose"), ... )
x |
An object of class |
... |
Currently not used. |
path |
A |
limit |
An |
start |
An |
cursor |
A |
parse |
A |
concat |
A |
progress |
A |
verbose |
A |
hal_count()
returns the total number of results.
hal_search()
returns a data.frame
or list
(according to type
).
N. Frerebeau
HAL reference frame documentation.
Other search tools:
hal_download()
## Not run: library(magrittr) ## Simple search topic <- list("archéologie", "Celtes", "France") # Combined with AND hal_api() %>% hal_query(topic) %>% hal_search(limit = 10) ## Get a list of archaeological journals topic <- c("archéologie", "archaeology", "archäologie") # Combined with OR hal_api() %>% hal_query(topic) %>% hal_select("title_s", "issn_s") %>% hal_filter("" %TO% "*" %IN% "issn_s") %>% hal_sort("title_s") %>% hal_search(path = "ref/journal") ## Get the most recent archaeological publication (in French) by journal hal_api() %>% hal_query("archéologie") %>% hal_select("producedDate_tdate") %>% hal_filter("ART" %IN% "docType_s") %>% hal_sort("producedDate_tdate", decreasing = TRUE) %>% hal_group( field = "journalTitle_s", sort = "producedDate_tdate", decreasing = TRUE ) %>% hal_search(limit = 10) ## Get a list of archaeological laboratories ## (only joint laboratories of the CNRS and a French university) topic <- list("archéologie" %IN% "text", "UMR" %IN% "code_t") hal_api() %>% hal_query(topic) %>% hal_select("name_s", "acronym_s", "code_s") %>% hal_filter("VALID" %IN% "valid_s") %>% hal_sort("acronym_s", decreasing = TRUE) %>% hal_search(path = "ref/structure", limit = 15) ## End(Not run)
## Not run: library(magrittr) ## Simple search topic <- list("archéologie", "Celtes", "France") # Combined with AND hal_api() %>% hal_query(topic) %>% hal_search(limit = 10) ## Get a list of archaeological journals topic <- c("archéologie", "archaeology", "archäologie") # Combined with OR hal_api() %>% hal_query(topic) %>% hal_select("title_s", "issn_s") %>% hal_filter("" %TO% "*" %IN% "issn_s") %>% hal_sort("title_s") %>% hal_search(path = "ref/journal") ## Get the most recent archaeological publication (in French) by journal hal_api() %>% hal_query("archéologie") %>% hal_select("producedDate_tdate") %>% hal_filter("ART" %IN% "docType_s") %>% hal_sort("producedDate_tdate", decreasing = TRUE) %>% hal_group( field = "journalTitle_s", sort = "producedDate_tdate", decreasing = TRUE ) %>% hal_search(limit = 10) ## Get a list of archaeological laboratories ## (only joint laboratories of the CNRS and a French university) topic <- list("archéologie" %IN% "text", "UMR" %IN% "code_t") hal_api() %>% hal_query(topic) %>% hal_select("name_s", "acronym_s", "code_s") %>% hal_filter("VALID" %IN% "valid_s") %>% hal_sort("acronym_s", decreasing = TRUE) %>% hal_search(path = "ref/structure", limit = 15) ## End(Not run)