Use the Kew Reconciliation Service to match a name against IPNI.

match_krs(query, .wait = 0.2, .retries = 3)

Arguments

query

The name to match using the reconciliation service. Use a named list to match parts of a name.

.wait

Time to wait before making a request, to help rate limiting.

.retries

The max number of times to retry the request to KRS. KRS seems to fail every other request, so adding a small number of retries helps prevent unnecessary failure.

Value

Returns an object of class krs_match that is a simple structure with slots for:

Details

The Kew Reconciliation Service (KRS) allows name matching against IPNI using an Open Refine reconcilliation API.

See also

Examples

# Match a name.
match_krs("Solanum sanchez-vegae")
#> <KRS match: 1 names matched to 'Solanum sanchez-vegae'>
#> List of 1
#>  $ :List of 5
#>   ..$ id   : chr "77103635-1"
#>   ..$ name : chr "Solanaceae Solanum sanchez-vegae S.Knapp"
#>   ..$ type :List of 1
#>   .. ..$ :List of 2
#>   .. .. ..$ id  : chr "/biology/organism_classification/scientific_name"
#>   .. .. ..$ name: chr "Scientific name"
#>   ..$ score: num 100
#>   ..$ match: logi TRUE

# Match a name using name parts
match_krs(list(genus="Solanum", species="sanchez-vegae", author="Knapp"))
#> <KRS match: 1 names matched to genus='Solanum', species='sanchez-vegae', author='Knapp'>
#> List of 1
#>  $ :List of 5
#>   ..$ id   : chr "77103635-1"
#>   ..$ name : chr "Solanaceae Solanum sanchez-vegae S.Knapp"
#>   ..$ type :List of 1
#>   .. ..$ :List of 2
#>   .. .. ..$ id  : chr "/biology/organism_classification/scientific_name"
#>   .. .. ..$ name: chr "Scientific name"
#>   ..$ score: num 100
#>   ..$ match: logi TRUE

# Format a returned match as a dataframe
match <- match_krs(list(genus="Solanum", species="sanchez-vegae", author="Knapp"))
tidy(match)
#> # A tibble: 1 × 5
#>   id         name                                     type           score match
#>   <chr>      <chr>                                    <list>         <dbl> <lgl>
#> 1 77103635-1 Solanaceae Solanum sanchez-vegae S.Knapp <tibble [1 × …   100 TRUE