Skip to contents

Look up works in the corpus via OpenAlex or PubMed to retrieve associated concepts, topics, or MeSH terms and add them to the concepts table.

This enricher is idempotent: re-running it updates existing concept data rather than duplicating rows.

Usage

sm_enrich_concepts(
  corpus,
  source = c("openalex", "mesh"),
  verbose = TRUE,
  call = rlang::caller_env()
)

Arguments

corpus

An sm_corpus object.

source

One of "openalex" (fetch OpenAlex concepts via DOI) or "mesh" (fetch MeSH terms via PubMed PMID).

verbose

Print progress messages?

call

Caller environment for error reporting.

Value

An sm_corpus object with updated concepts table and new provenance rows.

Examples

if (FALSE) { # \dontrun{
corpus <- sm_example_corpus()
corpus <- sm_enrich_concepts(corpus, source = "openalex")
} # }