Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stefanieschneider/viafr
R Interface to the VIAF (Virtual International Authority File) API
https://github.com/stefanieschneider/viafr
api interface r viaf
Last synced: about 1 month ago
JSON representation
R Interface to the VIAF (Virtual International Authority File) API
- Host: GitHub
- URL: https://github.com/stefanieschneider/viafr
- Owner: stefanieschneider
- License: gpl-3.0
- Created: 2019-06-21T18:48:08.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-09-04T10:44:04.000Z (4 months ago)
- Last Synced: 2024-10-30T09:24:26.819Z (about 2 months ago)
- Topics: api, interface, r, viaf
- Language: R
- Size: 2.79 MB
- Stars: 8
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
---
output: github_document
---```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)options(width = "100")
require(magrittr)
require(viafr)
```# viafr
[![Lifecycle badge](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://lifecycle.r-lib.org/articles/stages.html#maturing)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.3265046.svg)](https://doi.org/10.5281/zenodo.3265046)
[![CRAN badge](http://www.r-pkg.org/badges/version/viafr)](https://cran.r-project.org/package=viafr)
[![AppVeyor build status](https://ci.appveyor.com/api/projects/status/github/stefanieschneider/viafr?branch=master&svg=true)](https://ci.appveyor.com/project/stefanieschneider/viafr)
[![Coverage status](https://codecov.io/github/stefanieschneider/viafr/coverage.svg?branch=master)](https://codecov.io/github/stefanieschneider/viafr?branch=master)## Overview
This R package uses the VIAF (Virtual International Authority File) API. VIAF is an OCLC service that combines multiple LAM (Library, Archive, and Museum) name authority files into a single name authority service. It thus provides direct access to linked names for the same entity across the world's major name authority files, including national and regional variations in language, character set, and spelling. For more information go to https://viaf.org/.
## Installation
You can install the released version of viafr from [CRAN](https://CRAN.R-project.org) with:
```r
install.packages("viafr")
```To install the development version from [GitHub](https://github.com/stefanieschneider/viafr) use:
```r
# install.packages("devtools")
devtools::install_github("stefanieschneider/viafr")
```## Usage
The viafr package functions use the VIAF (Virtual International Authority File) API. Optional VIAF API query parameters can be passed into each function. For information on supported query parameters, please see https://www.oclc.org/developer/api/oclc-apis/viaf.en.html.
`viaf_get()` returns a tibble, where each row contains information about the respective VIAF identifier, whereas `viaf_search()` and `viaf_suggest()` each produce a named list of tibbles, with each tibble containing information about the respective search query. The MARC 21 field definitions are used, see, e.g., https://www.loc.gov/marc/bibliographic/.
### Search VIAF records
```{r example_search, message=FALSE, warning=FALSE}
(result_search <- viaf_search("Menzel", maximumRecords = 5))# Retrieve a tibble of all source identifiers
(source_ids <- dplyr::pull(result_search$`Menzel`, source_ids))# Retrieve a tibble of data for the second search result
(text <- dplyr::pull(result_search$`Menzel`, text) %>% purrr::pluck(2))
```### Suggest VIAF records
```{r example_suggest, message=FALSE, warning=FALSE}
(result_suggest <- viaf_suggest("austen"))# Retrieve source identifiers for the most relevant search result
dplyr::filter(result_suggest$`austen`, score > 10000) %>%
dplyr::pull(source_ids) %>% purrr::pluck(1)
```## Contributing
Please report issues, feature requests, and questions to the [GitHub issue tracker](https://github.com/stefanieschneider/viafr/issues). We have a [Contributor Code of Conduct](https://github.com/stefanieschneider/viafr/blob/master/CODE_OF_CONDUCT.md). By participating in viafr you agree to abide by its terms.