adsfolio.pdf.document_identity_evidence
Corroborate PDF identity evidence from mutual DocInfo, text, and provider matches.
This module provides a narrowly scoped helper to corroborate a PDF’s self-stated identity without relying on file names, fixed journal names, or numeric heuristics.
- class adsfolio.pdf.document_identity_evidence.DocumentDoiEvidence(doi, reason='')[source]
Bases:
objectStore a corroborated DOI or the reason corroboration failed.
- Parameters:
- class adsfolio.pdf.document_identity_evidence.PageCitationEvidence(matched, reason='')[source]
Bases:
objectStore the result of the page-1 citation check.
- Parameters:
- adsfolio.pdf.document_identity_evidence.check_document_doi_evidence(pdf_bytes, provider_document)[source]
Check the metadata DOI against the first page and provider record.
All of these conditions must hold:
DocInfo
/Subjectcontains exactly one explicitly labeled DOI, or/WPS-ARTICLEDOIcontains one article DOI.The first page repeats that DOI with exact token boundaries.
The metadata and provider titles match after documented formatting normalization.
The provider record explicitly lists the same DOI.
- Parameters:
- Returns:
Normalized DOI on success. Otherwise, the reason for refusal.
- Return type:
Notes
Title comparison folds case and collapses whitespace. It normalizes canonical Unicode, curly quotation marks, and spaced subtitle separators. It also accepts balanced provider display tags and valid HTML entities. Title content and unknown tags remain significant. Each resulting title part must match exactly. DOI tokens retain their punctuation and use exact token boundaries. When only the publisher article DOI is present, page 1 must also contain the full provider title. In that case the DocInfo title may omit dashes, but its remaining characters must match.
- adsfolio.pdf.document_identity_evidence.check_page_citation_evidence(pdf_bytes, provider_document)[source]
Check that page 1 shows the provider record’s citation data.
This check is for PDFs that state no DOI or arXiv ID, such as scans of papers published before DOIs. Page 1 must show all of these:
The full provider title as the only text on its lines. Footnote marks, digits, and punctuation may surround it. Case, spacing, typographic dashes and quotes, and words hyphenated across a line break do not matter.
The first author’s surname as a whole word.
The publication year as a whole number.
The volume and then the first page, on one text line, as whole tokens. An example is “ICARUS 73, 462–481 (1988)”.
A DOI on page 1 that the provider record does not list refuses the match. A line that holds only the heading Erratum, Errata, Corrigendum, Correction, Addendum, or Retraction also refuses it. Such a notice repeats the title and citation of the original paper.
- Parameters:
- Returns:
The result and, after a refusal, the first failed condition.
- Return type:
- adsfolio.pdf.document_identity_evidence.corroborate_document_doi_evidence(pdf_bytes, provider_document)[source]
Return the document DOI when metadata, page 1, and provider agree.
- Parameters:
- Returns:
Corroborated DOI, or None when a required check fails.
- Return type:
str or None
See also
check_document_doi_evidenceCheck evidence and explain a refusal.