NEWS


openalexSnapshot 0.3.6

openalexSnapshot 0.3.5

openalexSnapshot 0.3.4

Bug fix: a failed index build no longer poisons a later build of another corpus

The default temp_dir of build_corpus_index(), build_citation_index() and build_doi_index() was named after the dataset only (e.g. tempdir()/works_id_idx_tmp). The "batch done" markers left there by a failed build were picked up by a later build, in the same R session, of a different corpus with the same dataset name, which then skipped those batches and built an incomplete index or failed. The default now also carries a hash of the corpus path, so only a re-run of the same build resumes from it.

Bug fix: re-running build_corpus_index(root_dir = , data_sets = NULL) failed

Every folder under parquet/ was treated as a dataset, including the <dataset>_id_idx/ and <dataset>_cite_idx/ index folders, so a second run tried to index the index and failed. Folders whose name ends in _idx are now skipped.

Bug fix: lookup_by_id(root_dir = , data_sets = NULL) found no index

Dataset discovery looked for <dataset>_id_idx.parquet files, but the ID index is a <dataset>_id_idx/ directory, so every call failed with "No index files found". It now discovers the index directories.

openalexSnapshot 0.3.3

Bug fix: lookup_by_id(output = ) lost most records

Output parts were named after the source file's basename, but every updated_date=... folder reuses part_0000.parquet, part_0001.parquet, ... A works extract from 1,835 source files therefore had only 160 output names: parallel writers overwrote or lock-blocked each other, and an extract of about 7.4 million works kept 1.4 million. Parts (and worker spill directories) are now named by the path relative to the parquet root.

Failed reads and writes were turned into warnings, so the call still reported success. They are now errors.

lookup_by_id() returns each id once

Input ids are de-duplicated, and if the index holds an id in several source files, only the record from the latest updated_date= partition is kept.

Bug fix: parallel lookup of a large id set exceeded future.globals.maxSize

The worker closure carried the full set of index matches with it (about 1 GiB for 7.4 million ids). It now carries only what the workers need.

Source comments are ASCII-only

Three em dashes in R/ comments caused getSrcLines() translation warnings in a US-ASCII locale.

openalexSnapshot 0.3.2

Bug fix: rewriting an index sidecar no longer fails on Windows

.oas_read_index_meta() read _index_meta.parquet with arrow's default mmap = TRUE, which keeps the file memory-mapped for the rest of the session. Windows then refuses any write to that path:

IOError: Failed to open local file '.../works_cite_idx/_index_meta.parquet'.
Detail: [Windows error 1224] The requested operation cannot be performed on
a file with a user-mapped section open.

So rebuilding a citation or corpus index in an R session that had already queried it -- get_citing() or lookup_by_id() read the sidecar -- failed on Windows and worked everywhere else. The sidecar is now read with mmap = FALSE. This is the same defect, and the same fix, as the _snowball_run.parquet manifest in openalexSnowball 0.15.0.

openalexSnapshot 0.3.1

Bug fix: the json extension is now installed explicitly

Every CI job failed -- and would fail on any machine that had not already used DuckDB's json extension -- with

Extension Autoloading Error: An error occurred while trying to
automatically install the required extension 'json'

referenced_works is stored as JSON text in some corpora, and reading it uses json_extract_string(). The package relied on DuckDB autoloading the extension on demand, but autoinstall_known_extensions defaults to FALSE, so autoloading can only succeed where the extension happens to already be installed. It is, on a developer machine that has used it before; it is not, on a fresh runner. That is why the suite passed locally and failed everywhere else. (openalexPro has always run INSTALL json explicitly, which is why its CI was unaffected.)

New internal .oas_ensure_json() runs INSTALL json; LOAD json; and is called from the two places that decide JSON text is in play -- .oas_refs_expr() and get_cited()'s reference unnesting -- so a corpus whose referenced_works is a native list still needs no extension at all. If the install fails, the error now says what is missing and how to install it, rather than surfacing DuckDB's autoload message.

openalexSnapshot 0.3.0

Bug fix: parallel lookup workers shared one spill directory

.oas_lookup_one_index() opened each worker's DuckDB connection with no temp_dir, so every worker in the pool inherited DuckDB's default -- .tmp, relative to the working directory. Concurrent instances then wrote colliding duckdb_temp_storage_*.tmp files into one place and corrupted each other's spill. This is exactly the hazard build_citation_index() documents and guards against; the lookup path, which pro_snowball(snapshot = ) drives in parallel, did not.

Each worker now gets a private directory under tempdir(), removed on exit. get_citing() and get_cited() get the same treatment for their own connections, which matters when several callers run at once.

lookup_by_id() can be given a memory budget

.oas_lookup_one_index() has always accepted memory_limit, but the exported lookup_by_id() had no such argument and never passed one, so it was unreachable -- every worker ran at DuckDB's default of ~80% of system RAM, each. lookup_by_id() now takes memory_limit and temp_dir and forwards both; get_citing() / get_cited() gain temp_dir alongside the memory_limit they already had.

openalexSnapshot 0.2.0

New: offline citation graph

The snapshot can now answer "which works cite this one?" without network access. cited_by_api_url is a URL and useless offline, but the citing direction is recoverable by inverting the referenced_works every work already carries.

The package is now pure R

The ID index is now a partitioned directory

Indexes are written sorted

Design change: pure R by default, Rust as an optional accelerator

openalexSnapshot 0.0.0.9000