Repository navigation
Take a whole-book PubMed record's title from its BookTitle - #167
Merged
Merged
Conversation
PubMed's eSummary leaves Title empty for a record that is a whole Bookshelf book rather than a chapter (PMID:23304742, AHRQ Comparative Effectiveness Review 86, for example), so the cached reference had no title. The article XML that fetch() already downloads for the abstract still names the book in BookDocument/Book/BookTitle. When the summary Title is empty, take the title from that XML: the chapter's ArticleTitle if there is one, else the BookTitle. Journal articles and chapters have a non-empty summary Title and are unaffected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UDqeWsdcTfKeW7LriK6a9f
Contributor
|
Claude finished @cmungall's task in 37s —— View job PR review: Take a whole-book PubMed record's title from its BookTitle
Verdict: looks good to merge. The fix is small and well targeted, and the test was written first against the real transport. I found no blocking issues. The notes below are minor or optional. What's good
Minor suggestions (optional)
PerformanceNo concern. It is one extra tree search, only on the rare empty-title path. Not doneI couldn't run the tests in this environment: running |
cmungall
pushed a commit
to monarch-initiative/dismech
that referenced
this pull request
Nov 18, 2026
linkml-reference-validator 0.5.2rc1 reads a whole-book PubMed record's title from its BookTitle (linkml/linkml-reference-validator#167). Before that, these three records cached with no title: PMID:23304742 (AHRQ CER 86, restless legs syndrome treatment), PMID:25695122 (IOM ME/CFS report) and PMID:31909928 (NICE cannabis-based medicinal products guideline). Re-fetched with `just fetch-reference --force`; the abstract text is unchanged (186/186 snippets in the citing entries still verify). The two evidence items citing PMID:23304742 get their reference_title from the cache via backfill_reference_titles.py, which takes the presence gate to zero, report-only items included. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UDqeWsdcTfKeW7LriK6a9f
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.
A PubMed record for a whole Bookshelf book, rather than a chapter, has an empty
Titlein its eSummary.PMIDSourcetherefore cached such references with no title, and anything downstream that compares or copies titles had nothing to work with.PMID:23304742(AHRQ Comparative Effectiveness Review 86) is an example. Its record is aPubmedBookArticlewhoseBookDocumenthas<BookTitle book="cer86">Treatment for Restless Legs Syndrome</BookTitle>and noArticleTitle. Biopython's eSummary parser does not expose aBookTitlefield at all, so the title can't come from the summary.Change
PMIDSource.fetchalready downloads and parses the article XML for the abstract. When the summaryTitleis empty, it now takes the title from that XML with a new static method,_parse_book_title: the chapter'sArticleTitleif present, otherwiseBook/BookTitle. Journal articles and chapters always have a non-empty summaryTitle, so the fallback never runs for them.Tests
_parse_book_titlecover a whole book, a chapter, and a non-book record.test_whole_book_record_takes_its_title_from_book_titleintests/test_pmid_network.pyruns the real Entrez transport and parser against the file's local HTTP server, with a summary/article pair shaped likePMID:23304742. Written first, it failed with'' == 'Treatment for Restless Legs Syndrome'; it passes with the change.just testpasses: 2,462 tests, mypy clean, ruff clean.''Treatment for Restless Legs Syndrome''Beyond Myalgic Encephalomyelitis/Chronic Fatigue Syndrome: Redefining an Illness''Cannabis-based medicinal productsPrimary Trimethylaminuria.Axonal Growth Abnormalities Underlying Ocular Cranial Nerve Disorders.Why now
monarch-initiative/dismech is about to make
reference_titlea required slot on evidence items. These three PMIDs are the only references it cites whose cache records no title, and it fills titles only by copying them from the cache, never by typing them.Generated by Claude Code