prisma fetch: resolve PMID→PMCID at queue time — PMC tier was blind (0 hits on 2,355 items) #657
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The 2026-08-19 palliative-rfi PDF fetch (2,355 queued) returned pmc=0 because
pending_queueonly reads aPMCID:line from the item extra field (or the URL), and the PubMed search pipeline writes onlyPMID:/DOI:— so the PMC tier never had an ID to try. First pass yielded just 354 PDFs (321 Unpaywall + 33 fallback), while a one-off backfill via NCBI's ID converter (/pmc/utils/idconv/v1.0/, redirects topmc.ncbi.nlm.nih.gov/tools/idconv/api/v1/articles/, 200 ids/request, returns pmid as int) found PMCIDs for 831 of the 1,995 misses — more recoverable open-access full text than the entire first pass fetched.Fix options: (a)
pending_queuebulk-resolves missing PMCIDs via idconv before the fetch loop (one batched call, cache into extra); or (b)article_to_sourcein the search scripts captures PMCID at ingest (efetch XML carriesArticleIdList). Prefer both: ingest-time capture + queue-time backfill for legacy items.Findings from the 2026-08-19 recovery attempt (state of the art for scripted PMC retrieval):
PMCID:in extra (NCBI idconv; note the API returns pmid as int). Queue parses them (811 verified)./pmc/articles/<id>/pdf/is a bot wall: returns 200text/html(~1.8KB challenge) to scripted clients — the tier could never work.fetch_pmcnow uses the sanctioned OA service (oa.fcgi), which resolves ~52% of our PMC items (sampled 21/40; free-to-read author manuscripts returnidIsNotOpenAccess).ftp://ftp.ncbi.nlm.nih.gov/pub/pmc/{oa_pdf,oa_package}/...— FTP denies (retired), and the HTTPS mirror now 404s everything under/pub/pmc/exceptPMC-ids.csv.gz+ adeprecated/stub.pmc-oa-opendatabucket — alive, but XML/TXT only (no PDFs) and my key-layout guesses 404; needs the filelist metadata to map PMCID→key, plusprisma.exportsupport for XML/TXT full text (arguably better than pdfminer output anyway); (b) Europe PMC RESTfullTextXML— currently unreachable from the rack (EBI connect timeout), retry later.Current coverage: 378/2,355 (321 Unpaywall + 33 fallback + 24 second-pass). The ~430 OA-subset texts are recoverable via (a)/(b); the ~1,100 non-PMC paywalled misses need institutional access and are out of scripted scope.
Investigation (2026-08-19) overturns this issue's premise and finds the real bug:
_from_url_pmcid): 795 of 1,945 pending items have PMCIDs. The NCBI ID converter, sampled on 100 of the 1,144 PMID-but-no-PMCID items, returned 0 new PMCIDs — records without a PMC URL genuinely have no PMC version.81cbe53) resolves fine (~16% of the 795 are in the OA subset), but itsftp://hrefs rewritten tohttps://ftp.ncbi.nlm.nih.gov/pub/pmc/oa_pdf/...now 404 — NCBI moved/pub/pmc/content under/pub/pmc/deprecated/.pmc-oa-opendataS3 bucket:https://pmc-oa-opendata.s3.amazonaws.com/PMC{id}.{ver}/PMC{id}.{ver}.pdf(list byprefix=PMC{id}.to find the version) — no rate limit, no bot challenge, verified live.Fix: S3 tier (primary, by PMCID) + OA-service tier with the
deprecated/path fix + Europe PMC tier behind a connection-failure circuit breaker. Then re-run the fetch.Post-fix re-run complete (2026-08-19, ~50 min, 8 workers): pmc: 399, fallback: 20, unpaywall: 0, missed: 1,526, errors: 0 — the PMC tier went 0 → 399 on the same queue. Stage-3 full-text coverage is now 829 of 2,355 (35%), up from 407 this morning. The S3 tier out-delivered the 16% OA-service sample estimate (~50% of PMC-having items) — the bucket covers articles the OA service labels not-OA. Remainder: ~400 PMC author manuscripts awaiting the Europe PMC tier (circuit breaker armed; EBI unreachable today — re-run
stack prisma fetch palliative-rfi -w 8when it recovers) plus ~1,100 items with no PMC version and no open copy.