Develop#611
Merged
Merged
Conversation
…Crossref
New public function completeMetadata() fills missing bibliographic
metadata for records that have a DOI, querying OpenAlex first (broader
coverage of AB/CR/C1/TC) and then Crossref for residual gaps. Existing
non-empty values are never overwritten - the per-cell vacancy predicate
matches the one used by missingData(). Provenance is recorded both as a
per-row M$ENRICH column (compact tags like "AB:OA; TC:OA; CR:CR") and as
a long-format attr(M, "enrichment") data frame (SR, field, source,
timestamp).
Coverage matrix is honest: ID (Keywords Plus) and WC (WoS categories) are
always skipped (WoS-proprietary), TC requires OpenAlex, DE is off by
default. OpenAlex is auto-skipped when M$DB[1] == "OPENALEX". TC = 0 is
treated as vacant for the TC field only, so Scopus exports with all-zero
citation counts can be refreshed via OpenAlex.
Biblioshiny integration:
- Complete and Undo buttons in the Missing Data audit modal
- Sub-modal pre-selects Poor/Critical/Completely-missing fields
- Polite email and OpenAlex API key are read from Settings (no per-modal
credential typing)
- New before/after comparison modal opened after each enrichment, with
per-tag Before %, After %, delta, and OpenAlex vs Crossref fill counts
Implementation:
- New R/completeMetadata.R (~530 lines): httr2-based Crossref client with
polite-pool UA + req_retry(); openalexR-based OpenAlex client with
referenced_works -> WoS-CR string resolution
- New R/resolveOAReferences.R: shared OpenAlex CR-string helpers
(abbreviate_source_name, format_cr_author, build_single_cr) extracted
from biblioshiny so they can be reused without a Shiny dependency
- httr2, jsonlite, xml2 moved to Imports (added in classic)
- 86 new offline unit tests covering DOI normaliser, vacancy predicate,
JATS abstract stripping, Crossref/OpenAlex extractors, fill-only merge
contract, two-pass aggregation, and M$ENRICH provenance
- TC vacancy predicate now matches missingData()'s collection-level rule:
TC = 0 is treated as vacant only when sum(M$TC) == 0, never per-cell.
Scopus exports with all-zero TC still get refreshed via OpenAlex while
collections with mixed legitimate zeros are no longer touched.
- M$ENRICH column projects the per-row provenance attribute into a
compact tag string (AB:OA; TC:OA; CR:CR) for at-a-glance inspection.
Biblioshiny - Metadata completion result modal:
- Fixed before/after percentages showing identical values: the "after"
snapshot is now read from completeMetadata()'s return value instead of
the reactive missingdf, which was stale because its host modal was
already closed when the result modal opened.
- Delta column rendered as coloured badges (blue down-arrow for gains,
red up-arrow for regressions). A leading icon prevents renderBibliobox
from auto-detecting the column as numeric and stripping the HTML.
Biblioshiny - Synonym / Stopword pop-ups:
- popUpGeneric() default size was "40%", which is not a valid
show_alert() enum and was silently dropped to a very narrow modal.
Changed to size = "l" and wrapped the term column values in
white-space: nowrap so single words like "bibliometrics" or
"entrepreneurship" no longer break mid-word.
Biblioshiny - Unified Text Editing layout:
- Stop Words / Synonyms boxes in Most Frequent Words, WordCloud, Treemap,
Word Dynamics and Trend Topics now use the same panel layout as the
Co-occurrence Network menu (orange Stop Words panel + green Synonyms
panel with icons). All existing input ids are preserved so no
server-side change was required.
NEWS / NEWS.md updated for both repos.
240/240 testthat assertions pass; biblioshiny ui.R parses cleanly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
completeMetadata():
TC = 0 is treated as vacant only when sum(M$TC) == 0, never per-cell.
Scopus exports with all-zero TC still get refreshed via OpenAlex while
collections with mixed legitimate zeros are no longer touched.
compact tag string (AB:OA; TC:OA; CR:CR) for at-a-glance inspection.
Biblioshiny - Metadata completion result modal:
snapshot is now read from completeMetadata()'s return value instead of
the reactive missingdf, which was stale because its host modal was
already closed when the result modal opened.
red up-arrow for regressions). A leading icon prevents renderBibliobox
from auto-detecting the column as numeric and stripping the HTML.
Biblioshiny - Synonym / Stopword pop-ups:
show_alert() enum and was silently dropped to a very narrow modal.
Changed to size = "l" and wrapped the term column values in
white-space: nowrap so single words like "bibliometrics" or
"entrepreneurship" no longer break mid-word.
Biblioshiny - Unified Text Editing layout:
Word Dynamics and Trend Topics now use the same panel layout as the
Co-occurrence Network menu (orange Stop Words panel + green Synonyms
panel with icons). All existing input ids are preserved so no
server-side change was required.
NEWS / NEWS.md updated for both repos.
240/240 testthat assertions pass; biblioshiny ui.R parses cleanly.