Cache OA full text for reference-snippet validation (reusable)#227
Merged
Conversation
…-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
force-pushed
the
feat/cache-oa-fulltext
branch
from
July 20, 2026 22:53
8e57cea to
a5a95d5
Compare
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.
What
validate-referencesonly had PubMed abstracts cached, so evidence snippetstaken 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:...: resolvesthe 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/CH4stay intact for substring matching), and appends it to
references_cache/PMID_<id>.txt. OA-only, idempotent, never fabricates — non-OApapers are reported and skipped.
Applied to PMID:36847519
The source paper for the
Cellulose_Methane_Quad_Culture_SynComcausal graph (#226)— Wang 2023 mBio, PMC10128006.
just validate-referenceson that record nowpasses (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 PMC10128006just validate-references kb/communities/Cellulose_Methane_Quad_Culture_SynCom.yaml→ passed[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