NEWS


openalexConvert 0.1.3

openalexConvert 0.1.2

openalexConvert 0.1.1

openalexConvert 0.1.0

Zotero import rewritten

csljson_to_zotero_upload() is removed. It POSTed CSL JSON to the Zotero Web API, which only accepts Zotero item JSON and at most 50 items per request, so real uploads could not succeed; its tests only exercised mocked responses.

New csljson_to_zotero(files, method = c("local", "web")):

OpenAlex ID in the CSL note

corpus_to_csljson() now writes note as lines, the first being OpenAlex: W... (followed by the existing OA:...; OA_status:...; Citations:... line). Zotero imports note into Extra, so the ID is kept however the CSL JSON reaches Zotero, including File → Import. The CSL test fixtures were regenerated; only note changed. BibTeX/BibLaTeX output is unchanged (pandoc does not write note).

Zotero tags back into the project

New zotero_tags(project_dir) reads the tags of every item in the Zotero library selected in Zotero that has an OpenAlex ID in Extra (any of the four forms) and writes them to zotero_tags.parquet in the project directory: one row per work and tag, with the tag type (manual/automatic), the library (group ID, 0 = personal library) and the Zotero item key. Join it with the corpus on openalex_id. Re-running replaces that library's rows and keeps those of other libraries. Reading needs no API key.

DuckDB lambda syntax

corpus_to_csljson() failed with current DuckDB ("Deprecated lambda arrow (->) detected"). It now uses the lambda x: ... syntax.

openalexConvert 0.0.5

Tests no longer compare pandoc's exact output

Every r-universe check failed — Linux, macOS and Windows, all R versions — in test-001-corpus_csl_pandoc.R:

actual (r-universe):  year = {0000}
expected (fixture):   year = {0000},
                      doi = {10.1163/9789004190351_002}

r-universe builds with pandoc 3.9, which omits doi = {...} for these entry types; the fixtures had been regenerated in 0.0.4 on a machine with pandoc 3.12, which writes it. Same input, same code, different pandoc.

Those five comparisons were guarded by skip_on_ci(), which GitHub Actions honours — so CI stayed green — but r-universe does not set CI, so they ran there.

Byte-comparing pandoc's output tests pandoc, not this package. The tests now compare what csljson_convert_pandoc() is actually responsible for: that every record in comes out. BibTeX and BibLaTeX compare citation keys, LaTeX compares the OpenAlex ids carried in \bibitem, and the markdown test keeps its structural assertions (markdown renders citations as author-year text, so no ids survive to match on).

The skip_on_ci() guards are gone with them, so these five now run on every platform instead of being skipped on CI.

openalexConvert 0.0.4

Require openalexPro (>= 0.11.0)

.normalize_doi() delegates to openalexPro::extract_doi(normalize = TRUE) (R/corpus_to_csljson.R:430), and before openalexPro 0.11.0 that function silently truncated DOIs containing <, >, [ or ] -- returning a shorter string that still looked like a valid DOI, with no warning and no NA. Roughly 0.38% of real DOIs are affected (SICI-style ones, common in older journal content).

The dependency carried no version floor, so installing against an older openalexPro produced quietly corrupted DOIs in the CSL-JSON output.

Fixtures regenerated: they encoded the truncation bug

Once the floor was in place the suite failed, because every comparison fixture had been recorded while extract_doi() was still truncating. The fixtures expected the wrong answer:

generated: "10.1659/0276-4741(2005)025[0206:pfbcs]2.0.co;2"   <- correct
fixture:   "10.1659/0276-4741(2005)025"                       <- truncated

The BibTeX and BibLaTeX fixtures were stale in a second way: entries whose DOI had been lost now carry a doi = {...} field they previously lacked.

Every difference was verified to be DOI-related before regenerating -- 6 differing CSL fields and 187 differing .bib lines, all of them a DOI value or a doi = line (plus the trailing comma that appears on the line above a newly added field). Nothing else moved.

data-raw/regenerate_fixtures.R now does this reproducibly, and refuses to run outside a UTF-8 locale: in a C locale R renders non-ASCII author names as literal <U+00F3> escapes and pandoc writes Bay\textless U+00F3\textgreater n into the .bib files, which is exactly how a broken fixture gets committed and then becomes the expectation.

The suite now passes: 119 pass / 0 fail, from 105 pass / 14 fail.

openalexConvert 0.0.3

Bug fixes

Improvements