Skip to contents

Parse Zotero CSV export files into an sm_corpus object. Handles the standard Zotero CSV export format with columns for Key, Title, Author, Publication Year, DOI, Publication Title, Abstract, and Item Type.

Usage

sm_read_zotero(
  path,
  encoding = "UTF-8",
  verbose = TRUE,
  call = rlang::caller_env()
)

Arguments

path

Character scalar. Path to a Zotero CSV file.

encoding

Character scalar. File encoding (default "UTF-8").

verbose

Logical. Print progress messages?

call

Caller environment for error reporting.

Value

An sm_corpus object.

Implementation

The parser reads the Zotero CSV export format using readr::read_csv(). Zotero CSV exports have a standard set of column names. Key columns matched (case-insensitive): Key, Title, Author, Publication Year, DOI, Publication Title, Abstract Note, Item Type, ISSN, Language, Manual Tags, Automatic Tags. No bibliometrix engine is available since Zotero CSV is not a format supported by bibliometrix::convert2df().

References

Aria, M. & Cuccurullo, C. (2017). bibliometrix: An R-tool for comprehensive science mapping analysis. Journal of Informetrics, 11(4), 959–975. doi:10.1016/j.joi.2017.08.007

Examples

path <- tempfile(fileext = ".csv")
writeLines(c(
  "Key,Title,Author,Publication Year,DOI,Publication Title,Item Type",
  paste0('ABC123,Spatial omics methods,"Chen, Wei; Smith, Sarah",2023,',
         '10.1038/S41592-023-00001,Nature Methods,journalArticle')
), path)
corpus <- sm_read_zotero(path, verbose = FALSE)
corpus$works
#> # A tibble: 1 × 16
#>   work_id    doi   title abstract  year type  source_id cited_by_count oa_status
#>   <chr>      <chr> <chr> <chr>    <int> <chr> <chr>              <int> <chr>    
#> 1 W000000001 10.1… Spat… NA        2023 jour… S0000000…             NA NA       
#> # ℹ 7 more variables: language <chr>, pmid <chr>, arxiv_id <chr>,
#> #   openalex_id <chr>, is_retracted <lgl>, retraction_date <date>,
#> #   last_refreshed <dttm>
unlink(path)