Skip to content

Develop#611

Merged
massimoaria merged 4 commits into
masterfrom
develop
May 4, 2026
Merged

Develop#611
massimoaria merged 4 commits into
masterfrom
develop

Conversation

@massimoaria

Copy link
Copy Markdown
Owner

completeMetadata():

  • 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.

…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.
@massimoaria
massimoaria merged commit 40c09da into master May 4, 2026
0 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant