Skip to content

Cache OA full text for reference-snippet validation (reusable)#227

Merged
realmarcin merged 1 commit into
mainfrom
feat/cache-oa-fulltext
Jul 20, 2026
Merged

Cache OA full text for reference-snippet validation (reusable)#227
realmarcin merged 1 commit into
mainfrom
feat/cache-oa-fulltext

Conversation

@realmarcin

Copy link
Copy Markdown
Contributor

What

validate-references only had PubMed abstracts cached, so evidence snippets
taken from a paper's Methods/Results (common for interaction/mechanism records)
couldn't be verified — they'd flag as "text not found ... only abstract available."

Adds scripts/cache_fulltext.py + just cache-fulltext PMID:...: resolves
the PMID → PMCID via Europe PMC, and if the paper is open-access, fetches the
full-text XML, converts to plain text (subscript/superscript-aware so H2/CH4
stay intact for substring matching), and appends it to
references_cache/PMID_<id>.txt. OA-only, idempotent, never fabricates — non-OA
papers are reported and skipped.

Applied to PMID:36847519

The source paper for the Cellulose_Methane_Quad_Culture_SynCom causal graph (#226)
— Wang 2023 mBio, PMC10128006. just validate-references on that record now
passes (0 issues), clearing both the new causal-edge snippets and the record's
pre-existing full-text cultivation snippets.

Verification

  • just cache-fulltext PMID:36847519 → appended 70,874 chars from PMC10128006
  • just validate-references kb/communities/Cellulose_Methane_Quad_Culture_SynCom.yamlpassed
  • Re-run is idempotent ([ok] already cached)

Reusable for the ongoing causal-mode curation (each new interaction record can cache
its OA source with one command).

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings July 20, 2026 22:53

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

…-fulltext)

validate-references only had PubMed abstracts cached, so snippets taken from a
paper's Methods/Results (common for evidence-heavy interaction records) couldn't be
verified. Add scripts/cache_fulltext.py + `just cache-fulltext PMID:...`: resolve
the PMID to a PMCID via Europe PMC, and if the paper is open-access, fetch the
full-text XML, convert to plain text (subscript/superscript-aware so H2/CH4 stay
intact), and append it to references_cache/PMID_<id>.txt. OA-only, idempotent, never
fabricates (non-OA papers are reported and skipped).

Apply it to PMID:36847519 (Wang 2023 mBio, PMC10128006) — the source paper for the
Cellulose_Methane_Quad_Culture_SynCom causal graph (#226). `just validate-references`
on that record now passes (0 issues), clearing both the new causal-edge snippets and
the record's pre-existing full-text cultivation snippets.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@realmarcin
realmarcin force-pushed the feat/cache-oa-fulltext branch from 8e57cea to a5a95d5 Compare July 20, 2026 22:53
@realmarcin
realmarcin merged commit 96af1cc into main Jul 20, 2026
2 checks passed
@realmarcin
realmarcin deleted the feat/cache-oa-fulltext branch July 20, 2026 22:56
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.

2 participants