Retrieve structured metadata for scholarly identifiers from external registries.
Usage
id_metadata(
x,
type = c("auto", scholidonline_types()),
provider = c("auto", .scholidonline_providers()),
fields = NULL,
...,
quiet = FALSE
)Arguments
- x
A character vector of identifiers.
- type
A single identifier type string, or
"auto"to infer the type for each element ofx. Seescholidonline_types()for supported values.- provider
A single provider string specifying which online service to use. Use
"auto"to use the default provider for the resolved identifier type. In most cases,"auto"is appropriate.- fields
An optional character vector naming the columns to return. If
NULL, all default columns are returned. Unknown field names are ignored.- ...
Reserved for future provider-specific arguments.
- quiet
A single logical value; if
TRUE, suppress provider warnings and messages where possible.
Value
A data.frame with one row per input identifier. By default, the
returned columns are input, type, provider, title, year,
container, doi, pmid, pmcid, and url. Inputs that cannot be
identified, normalized, or resolved are returned as rows with missing
metadata fields.
Details
id_metadata() is vectorized over x and returns a data.frame with one row
per input identifier.
For providers that support batch lookup, such as arXiv, multiple identifiers may be resolved using a single provider request. This does not change the public return shape: the output still contains one row per input identifier.
The function returns a harmonized cross-provider data.frame with columns
title, year, container, doi, pmid, pmcid, and url. For
bibliographic identifiers, container is typically a journal or source
title and linked DOI/PMID/PMCID fields may be populated. For other types,
the same columns are reused with type-appropriate meaning (for example,
protein name and organism for UniProt, organization name and country for
ROR, or accession title and organism for NCBI accessions). Bibliographic
link columns are NA when not applicable.
For NCBI accession types such as BioProject, title is the registry's
short project or record title from Entrez ESummary, not the full description
shown on the NCBI website. Use url for the complete record.
type must be a single value or "auto". For mixed identifier columns,
omit type or use type = "auto" so each element is classified
separately.
Examples
# \donttest{
out <- id_metadata("10.1038/nature12373", type = "doi")
knitr::kable(out)
#>
#>
#> |input |type |provider |title | year|container |doi |pmid |pmcid |url |
#> |:-------------------|:----|:--------|:--------------------------------------------|----:|:---------|:-------------------|:----|:-----|:-----------------------------------|
#> |10.1038/nature12373 |doi |crossref |Nanometre-scale thermometry in a living cell | 2013|Nature |10.1038/nature12373 |NA |NA |https://doi.org/10.1038/nature12373 |
out <- id_metadata(c("31452104", "PMC6821181"))
knitr::kable(out)
#>
#>
#> |input |type |provider |title | year|container |doi |pmid |pmcid |url |
#> |:----------|:-----|:--------|:--------------------------------------------------------|----:|:----------------|:---|:--------|:----------|:-----------------------------------------------------|
#> |31452104 |pmid |ncbi |Molegro Virtual Docker for Docking. | 2019|Methods Mol Biol |NA |31452104 |NA |https://pubmed.ncbi.nlm.nih.gov/31452104/ |
#> |PMC6821181 |pmcid |ncbi |Figure and caption extraction from biomedical documents. | 2019|Bioinformatics |NA |NA |PMC6821181 |https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6821181/ |
out <- id_metadata(
"10.1038/nature12373",
fields = c("title", "year", "doi")
)
knitr::kable(out)
#>
#>
#> |title | year|doi |
#> |:--------------------------------------------|----:|:-------------------|
#> |Nanometre-scale thermometry in a living cell | 2013|10.1038/nature12373 |
# }