Skip to content

Support ISBN/book references in download-ref #37

Description

@chenpeizhi

Background

sci-brain's knowledge bases handle papers first-class (arXiv IDs, DOIs), but books only incidentally: a book or chapter with a DOI rides the DOI path if Semantic Scholar knows it; anything else enters as a hand-written stub with hand-written BibTeX — no metadata fetch, no validation. bibtex_to_manifest.py recognizes only eprint and doi fields. papis treats books as first-class citizens via an ISBN importer and per-type BibLaTeX knowledge (@book requires publisher/year, etc.). Research KBs need textbooks and monographs (e.g. Hewson's The Kondo Problem appears as a bare stub in quantum.harness's KB today). Motivation and full papis analysis: #30.

Objective

Make ISBN a supported identifier in download-ref: metadata fetched from an open bibliographic API, rendered as a typed KB entry, @book BibTeX generated — with the existing stub mechanism as the explicit no-metadata fallback.

Interface (Input → Output)

In: manifest schema gains "isbn": ["9780521599474", ...] (ISBN-10 or -13, hyphens tolerated and normalized); bibtex_to_manifest.py additionally recognizes isbn = {…} fields.
Out:

  • .raw/isbn/<isbn13>.json — normalized metadata (title, authors in the S2 shape, year, publisher) with a metadata_source marker.
  • Rendered <isbn13>_<slug>.md with frontmatter type: book, canonical_id: <isbn13>, isbn:, full_text: no (no PDF fetch — books are not legally downloadable; the note: key can point to a shelf/ebook).
  • append_bibtex.py propose/append emits @book{lastname_year_keyword, title, author, publisher, year, isbn}.
  • INDEX.md lists the entry (— in the full-text column).

Technical recommendations (non-binding)

OpenLibrary's https://openlibrary.org/isbn/<isbn>.json (+ authors endpoint) is keyless and stdlib-friendly; Google Books is an alternative. Normalize ISBN-10→13 with the standard check-digit arithmetic (~15 lines, no isbnlib dependency). Renderer support is a small render_isbn() following render_stubs' shape.

Verification

  1. Known-answer positive: manifest with ISBN 9780521599474.raw/isbn/9780521599474.json written; rendered .md frontmatter has type: book and title matching the OpenLibrary record for that ISBN (Hewson, The Kondo Problem to Heavy Fermions, Cambridge University Press — paste the fetched values in the PR); append_bibtex.py propose returns an @book entry containing publisher and year — which proves the full identifier→metadata→render→bib chain.
  2. kb_doctor's bib-required-keys (companion issue) passes on the generated @book entry — machine-checked type correctness. Until kb_doctor lands, assert the two fields are present with a grep pair in the test.
  3. Negative controls: (a) syntactically invalid ISBN 1234567890128 (bad check digit) → rejected at manifest validation with a clear message, no network call; (b) well-formed but unassigned ISBN → miss line, no files written, exit without traceback.
  4. Regression: existing arXiv/DOI manifests produce byte-identical results (new key is additive).

Assumes

  • OpenLibrary's coverage of the chosen verification ISBN is stable; if it drifts, substitute another canonical physics textbook ISBN and record it in the PR.

Dependencies

Part of #30. Pairs with the importer-chain child (shared normalization) and kb_doctor child (bib-required-keys).

Out of scope

Book PDF/EPUB retrieval; theses/reports (@phdthesis, @techreport — same pattern, add on demand); ISBN identity dedup beyond exact-match (covered by the dedup child once ISBN lands).

🤖 Generated with Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions