linkml-reference-validator 0.5.2rc1__tar.gz → 0.7.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (279) hide show
  1. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/PKG-INFO +1 -1
  2. linkml_reference_validator-0.7.0/docs/how-to/use-signed-excerpts.md +122 -0
  3. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/docs/reference/cli.md +36 -0
  4. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/mkdocs.yml +1 -0
  5. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/src/linkml_reference_validator/cli/__init__.py +7 -0
  6. linkml_reference_validator-0.7.0/src/linkml_reference_validator/cli/excerpts.py +129 -0
  7. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/src/linkml_reference_validator/cli/shared.py +8 -0
  8. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/src/linkml_reference_validator/cli/validate.py +10 -0
  9. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/src/linkml_reference_validator/etl/sources/doi.py +89 -2
  10. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/src/linkml_reference_validator/models.py +104 -0
  11. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/src/linkml_reference_validator/plugins/reference_validation_plugin.py +52 -9
  12. linkml_reference_validator-0.7.0/src/linkml_reference_validator/signed_excerpts.py +226 -0
  13. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/src/linkml_reference_validator/validation/supporting_text_validator.py +216 -15
  14. linkml_reference_validator-0.7.0/tests/test_doi_title_cleaning.py +164 -0
  15. linkml_reference_validator-0.7.0/tests/test_signed_excerpts_and_fair_use.py +394 -0
  16. linkml_reference_validator-0.7.0/tests/test_signed_excerpts_sync.py +349 -0
  17. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/.claude/.mcp.json +0 -0
  18. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/.claude/settings.json +0 -0
  19. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/.copier-answers.yml +0 -0
  20. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/.devcontainer/devcontainer.json +0 -0
  21. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/.devcontainer/post_create.sh +0 -0
  22. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/.editorconfig +0 -0
  23. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/.github/actions/claude-code-action/action.yml +0 -0
  24. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/.github/actions/claude-issue-summarize-action/action.yml +0 -0
  25. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/.github/actions/claude-issue-triage-action/action.yml +0 -0
  26. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/.github/ai-controllers.json +0 -0
  27. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/.github/copilot-instructions.md +0 -0
  28. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/.github/copilot-setup-steps.yml +0 -0
  29. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/.github/dependabot.yml +0 -0
  30. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/.github/workflows/claude-code-review.yml +0 -0
  31. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/.github/workflows/claude-issue-summarize.yml +0 -0
  32. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/.github/workflows/claude-issue-triage.yml +0 -0
  33. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/.github/workflows/claude-ontology-review.yml +0 -0
  34. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/.github/workflows/claude.yml +0 -0
  35. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/.github/workflows/deploy-docs.yaml +0 -0
  36. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/.github/workflows/dragon-ai.yml +0 -0
  37. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/.github/workflows/main.yaml +0 -0
  38. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/.github/workflows/pypi-publish.yaml +0 -0
  39. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/.gitignore +0 -0
  40. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/.goosehints +0 -0
  41. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/.pre-commit-config.yaml +0 -0
  42. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/.yamllint.yaml +0 -0
  43. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/AGENTS.md +0 -0
  44. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/BUG_GEO_ACCESSION_TO_UID.md +0 -0
  45. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/BUG_ZENODO_DOI_AND_URL_HANDLING.md +0 -0
  46. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/CLAUDE.md +0 -0
  47. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/CLI-ISSUES.md +0 -0
  48. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/CODE_OF_CONDUCT.md +0 -0
  49. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/CONTRIBUTING.md +0 -0
  50. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/FEATURE_REQUEST_REPAIR.md +0 -0
  51. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/LICENSE +0 -0
  52. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/README.md +0 -0
  53. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/REVIEW2.md +0 -0
  54. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/REVIEW3.md +0 -0
  55. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/ai.just +0 -0
  56. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/benchmarks/repeated_quotes.py +0 -0
  57. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/copilot-instructions.md +0 -0
  58. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/docs/about.md +0 -0
  59. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/docs/assets/zotero-find-full-text.png +0 -0
  60. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/docs/concepts/content-types.md +0 -0
  61. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/docs/concepts/editorial-conventions.md +0 -0
  62. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/docs/concepts/how-it-works.md +0 -0
  63. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/docs/elements/.gitkeep +0 -0
  64. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/docs/how-to/add-reference-source.md +0 -0
  65. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/docs/how-to/export-cache-to-zotero.md +0 -0
  66. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/docs/how-to/fetch-full-text-and-pdfs.md +0 -0
  67. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/docs/how-to/repair-validation-errors.md +0 -0
  68. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/docs/how-to/skip-unsupported-references.md +0 -0
  69. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/docs/how-to/use-local-files-and-urls.md +0 -0
  70. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/docs/how-to/validate-clinical-trials.md +0 -0
  71. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/docs/how-to/validate-dois.md +0 -0
  72. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/docs/how-to/validate-entrez.md +0 -0
  73. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/docs/how-to/validate-obo-files.md +0 -0
  74. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/docs/how-to/validate-titles.md +0 -0
  75. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/docs/how-to/validate-urls.md +0 -0
  76. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/docs/how-to/validate-wikipedia.md +0 -0
  77. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/docs/index.md +0 -0
  78. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/docs/notebooks/01_getting_started.ipynb +0 -0
  79. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/docs/notebooks/02_advanced_usage.ipynb +0 -0
  80. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/docs/notebooks/03_python_api.ipynb +0 -0
  81. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/docs/notebooks/04_obo_validation.ipynb +0 -0
  82. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/docs/notebooks/05_geo_validation.ipynb +0 -0
  83. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/docs/quickstart.md +0 -0
  84. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/docs/reference/cache-format.md +0 -0
  85. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/docs/reference/splitting.md +0 -0
  86. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/docs/setup-guide.md +0 -0
  87. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/docs/superpowers/plans/2026-06-12-modular-pdf-fulltext-fetching.md +0 -0
  88. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/docs/superpowers/plans/2026-08-05-private-library-full-text.md +0 -0
  89. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/docs/superpowers/specs/2026-06-12-modular-pdf-fulltext-fetching-design.md +0 -0
  90. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/docs/superpowers/specs/2026-08-05-private-library-full-text-design.md +0 -0
  91. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/docs/templates-linkml/README.md +0 -0
  92. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/docs/todo.md +0 -0
  93. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/docs/troubleshooting.md +0 -0
  94. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/docs/tutorials/complete-workflow.md +0 -0
  95. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/examples/README.md +0 -0
  96. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/justfile +0 -0
  97. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/mypy.ini +0 -0
  98. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/notebooks/01_getting_started.ipynb +0 -0
  99. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/notebooks/02_advanced_usage.ipynb +0 -0
  100. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/notebooks/03_python_api.ipynb +0 -0
  101. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/notebooks/README.md +0 -0
  102. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/project/README.md +0 -0
  103. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/project.justfile +0 -0
  104. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/pyproject.toml +0 -0
  105. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/pytest.ini +0 -0
  106. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/skills/linkml-reference-validator/SKILL.md +0 -0
  107. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/skills/linkml-reference-validator/references/configuration.md +0 -0
  108. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/skills/linkml-reference-validator/references/guardrails.md +0 -0
  109. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/src/linkml_reference_validator/__init__.py +0 -0
  110. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/src/linkml_reference_validator/_version.py +0 -0
  111. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/src/linkml_reference_validator/cache.py +0 -0
  112. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/src/linkml_reference_validator/cli/cache.py +0 -0
  113. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/src/linkml_reference_validator/cli/lookup.py +0 -0
  114. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/src/linkml_reference_validator/cli/repair.py +0 -0
  115. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/src/linkml_reference_validator/etl/__init__.py +0 -0
  116. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/src/linkml_reference_validator/etl/acquire.py +0 -0
  117. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/src/linkml_reference_validator/etl/csl_export.py +0 -0
  118. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/src/linkml_reference_validator/etl/extract/__init__.py +0 -0
  119. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/src/linkml_reference_validator/etl/extract/base.py +0 -0
  120. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/src/linkml_reference_validator/etl/extract/drawio.py +0 -0
  121. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/src/linkml_reference_validator/etl/extract/html.py +0 -0
  122. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/src/linkml_reference_validator/etl/extract/pdf.py +0 -0
  123. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/src/linkml_reference_validator/etl/extract/svg.py +0 -0
  124. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/src/linkml_reference_validator/etl/extract/svg_geometry.py +0 -0
  125. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/src/linkml_reference_validator/etl/extract/untrusted_xml.py +0 -0
  126. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/src/linkml_reference_validator/etl/extract/xml.py +0 -0
  127. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/src/linkml_reference_validator/etl/fulltext/__init__.py +0 -0
  128. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/src/linkml_reference_validator/etl/fulltext/base.py +0 -0
  129. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/src/linkml_reference_validator/etl/fulltext/bioc.py +0 -0
  130. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/src/linkml_reference_validator/etl/fulltext/bookshelf.py +0 -0
  131. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/src/linkml_reference_validator/etl/fulltext/epmc.py +0 -0
  132. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/src/linkml_reference_validator/etl/fulltext/epmc_preprint.py +0 -0
  133. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/src/linkml_reference_validator/etl/fulltext/json_api.py +0 -0
  134. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/src/linkml_reference_validator/etl/fulltext/loader.py +0 -0
  135. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/src/linkml_reference_validator/etl/fulltext/openalex.py +0 -0
  136. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/src/linkml_reference_validator/etl/fulltext/pmc.py +0 -0
  137. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/src/linkml_reference_validator/etl/fulltext/unpaywall.py +0 -0
  138. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/src/linkml_reference_validator/etl/fulltext/zotero.py +0 -0
  139. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/src/linkml_reference_validator/etl/identifiers.py +0 -0
  140. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/src/linkml_reference_validator/etl/reference_fetcher.py +0 -0
  141. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/src/linkml_reference_validator/etl/rules.py +0 -0
  142. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/src/linkml_reference_validator/etl/sources/__init__.py +0 -0
  143. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/src/linkml_reference_validator/etl/sources/base.py +0 -0
  144. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/src/linkml_reference_validator/etl/sources/clinicaltrials.py +0 -0
  145. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/src/linkml_reference_validator/etl/sources/entrez.py +0 -0
  146. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/src/linkml_reference_validator/etl/sources/file.py +0 -0
  147. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/src/linkml_reference_validator/etl/sources/json_api.py +0 -0
  148. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/src/linkml_reference_validator/etl/sources/loader.py +0 -0
  149. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/src/linkml_reference_validator/etl/sources/pmid.py +0 -0
  150. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/src/linkml_reference_validator/etl/sources/ppr.py +0 -0
  151. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/src/linkml_reference_validator/etl/sources/url.py +0 -0
  152. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/src/linkml_reference_validator/etl/sources/utils.py +0 -0
  153. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/src/linkml_reference_validator/etl/sources/wikipedia.py +0 -0
  154. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/src/linkml_reference_validator/etl/text_extractor.py +0 -0
  155. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/src/linkml_reference_validator/field_detection.py +0 -0
  156. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/src/linkml_reference_validator/matching.py +0 -0
  157. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/src/linkml_reference_validator/plugins/REVIEW.md +0 -0
  158. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/src/linkml_reference_validator/plugins/__init__.py +0 -0
  159. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/src/linkml_reference_validator/validation/__init__.py +0 -0
  160. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/src/linkml_reference_validator/validation/fuzzy_text_utils.py +0 -0
  161. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/src/linkml_reference_validator/validation/repairer.py +0 -0
  162. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/__init__.py +0 -0
  163. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/conftest.py +0 -0
  164. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/data/test_data_deep_nesting_invalid.yaml +0 -0
  165. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/data/test_data_deep_nesting_valid.yaml +0 -0
  166. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/data/test_data_invalid.yaml +0 -0
  167. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/data/test_data_valid.yaml +0 -0
  168. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/data/test_schema.yaml +0 -0
  169. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/data/test_schema_deep_nesting.yaml +0 -0
  170. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/fixtures/GEO_GSE12345.md +0 -0
  171. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/fixtures/PMC_TEST001.md +0 -0
  172. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/fixtures/PMC_TEST001.txt +0 -0
  173. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/fixtures/PMC_TEST002.md +0 -0
  174. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/fixtures/PMC_TEST002.txt +0 -0
  175. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/fixtures/PMID_TEST001.md +0 -0
  176. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/fixtures/PMID_TEST001.txt +0 -0
  177. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/fixtures/PMID_TEST002.md +0 -0
  178. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/fixtures/PMID_TEST002.txt +0 -0
  179. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/fixtures/PMID_TEST003.md +0 -0
  180. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/fixtures/PMID_TEST003.txt +0 -0
  181. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/fixtures/bookshelf/esummary_20301710.xml +0 -0
  182. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/fixtures/bookshelf/gene_NBK1116/men1.nxml +0 -0
  183. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/fixtures/bookshelf/pubmed_20301710.xml +0 -0
  184. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/fixtures/clinicaltrials_NCT00000001.md +0 -0
  185. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/fixtures/fulltext_html/README.md +0 -0
  186. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/fixtures/fulltext_html/dspace-32894695.html +0 -0
  187. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/fixtures/fulltext_html/iris-19049553.html +0 -0
  188. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/fixtures/fulltext_html/plos-0000308.html +0 -0
  189. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/fixtures/jats/PMC5593426.xml +0 -0
  190. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/fixtures/jats/README.md +0 -0
  191. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/fixtures/sample.obo +0 -0
  192. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_absent_abstract_recovery.py +0 -0
  193. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_acquire.py +0 -0
  194. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_bookshelf_provider.py +0 -0
  195. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_bot_challenge.py +0 -0
  196. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_cache_author_recovery.py +0 -0
  197. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_cache_filename_collisions.py +0 -0
  198. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_cache_read_robustness.py +0 -0
  199. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_cache_validation.py +0 -0
  200. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_cli.py +0 -0
  201. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_cli_cache_enrich.py +0 -0
  202. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_cli_cache_export.py +0 -0
  203. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_cli_cache_reference.py +0 -0
  204. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_cli_lookup.py +0 -0
  205. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_cli_repair.py +0 -0
  206. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_clinicaltrials_cache.py +0 -0
  207. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_clinicaltrials_integration.py +0 -0
  208. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_deep_nesting.py +0 -0
  209. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_doi_preprint.py +0 -0
  210. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_doi_url_encoding.py +0 -0
  211. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_drawio.py +0 -0
  212. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_e2e_integration.py +0 -0
  213. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_empty_snippets.py +0 -0
  214. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_epmc_preprint_provider.py +0 -0
  215. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_extractor_fidelity.py +0 -0
  216. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_extractors.py +0 -0
  217. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_field_detection.py +0 -0
  218. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_field_detection_qualifiers.py +0 -0
  219. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_file_reference_cache.py +0 -0
  220. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_frontmatter_and_doi_case.py +0 -0
  221. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_fulltext_loader.py +0 -0
  222. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_fulltext_providers.py +0 -0
  223. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_fuzzy_suggestions.py +0 -0
  224. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_geo_integration.py +0 -0
  225. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_greek_variants.py +0 -0
  226. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_html_fulltext_acceptance.py +0 -0
  227. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_html_scope_text.py +0 -0
  228. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_identifiers.py +0 -0
  229. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_inline_abstract_headings.py +0 -0
  230. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_jats_tables.py +0 -0
  231. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_json_api_source.py +0 -0
  232. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_ligature_normalization.py +0 -0
  233. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_long_cache_filenames.py +0 -0
  234. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_meaning_changes.py +0 -0
  235. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_meaning_symbols.py +0 -0
  236. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_models.py +0 -0
  237. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_multivalued_reference.py +0 -0
  238. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_no_cache_downgrade.py +0 -0
  239. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_normalized_content_cache.py +0 -0
  240. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_open_access_policy.py +0 -0
  241. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_optional_linkml_dependency.py +0 -0
  242. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_pdf_url_title.py +0 -0
  243. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_plugin_integration.py +0 -0
  244. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_plugin_value_shapes.py +0 -0
  245. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_pmc_fulltext.py +0 -0
  246. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_pmid_network.py +0 -0
  247. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_ppr_source.py +0 -0
  248. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_publisher_typography.py +0 -0
  249. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_real_validation.py +0 -0
  250. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_reference_fetcher.py +0 -0
  251. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_repair.py +0 -0
  252. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_repair_data_output.py +0 -0
  253. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_repair_thresholds.py +0 -0
  254. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_rules.py +0 -0
  255. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_serve_stale_html_optin.py +0 -0
  256. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_source_network_errors.py +0 -0
  257. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_source_utils.py +0 -0
  258. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_sources.py +0 -0
  259. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_split_supporting_text.py +0 -0
  260. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_supporting_text_validator.py +0 -0
  261. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_svg_edges.py +0 -0
  262. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_svg_extractor.py +0 -0
  263. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_text_extractor.py +0 -0
  264. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_title_only_shapes.py +0 -0
  265. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_title_validation.py +0 -0
  266. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_trust_cached_entries.py +0 -0
  267. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_unknown_slot_traversal.py +0 -0
  268. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_url_fragment_cache.py +0 -0
  269. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_url_html_sanitize.py +0 -0
  270. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_url_html_to_text.py +0 -0
  271. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_url_source_cache_version.py +0 -0
  272. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_validation_config.py +0 -0
  273. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_validation_counts.py +0 -0
  274. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_welded_markers.py +0 -0
  275. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_wikipedia_source.py +0 -0
  276. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_word_boundaries.py +0 -0
  277. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_xml_extractor_text.py +0 -0
  278. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/tests/test_zotero_provider.py +0 -0
  279. {linkml_reference_validator-0.5.2rc1 → linkml_reference_validator-0.7.0}/uv.lock +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: linkml_reference_validator
3
- Version: 0.5.2rc1
3
+ Version: 0.7.0
4
4
  Summary: Validation of supporting text from references and publications
5
5
  Author-email: Chris Mungall <cjmungall@lbl.gov>
6
6
  License-Expression: Apache-2.0
@@ -0,0 +1,122 @@
1
+ # Using Signed Excerpts from a Private Full-Text Store
2
+
3
+ A public repository cannot commit closed-access full texts to its
4
+ `references_cache/`, so a quote taken from the body of a paywalled paper fails
5
+ ordinary validation. Signed excerpts close that gap. A **private store** holds
6
+ the full texts and verifies short, fair-use excerpts against them. The
7
+ verified excerpts are then copied into the public repository, where the
8
+ validator accepts an exact match against them.
9
+
10
+ The store is any directory of YAML bundles. The reference setup is
11
+ [claimstore](https://github.com/monarch-initiative/claimstore), a private
12
+ repository that runs this validator over its own full texts and writes its
13
+ bundles to `signed_excerpts/`.
14
+
15
+ ## How validation uses signed excerpts
16
+
17
+ Set `signed_excerpts_dir` in `.linkml-reference-validator.yaml`:
18
+
19
+ ```yaml
20
+ validation:
21
+ cache_dir: references_cache
22
+ signed_excerpts_dir: signed_excerpts
23
+ ```
24
+
25
+ An excerpt then passes if EITHER:
26
+
27
+ 1. it matches the reference in `references_cache/` as usual, OR
28
+ 2. it exactly matches (after collapsing whitespace) an excerpt recorded for
29
+ that reference in `signed_excerpts/<REF_ID>.yaml`.
30
+
31
+ Any edit to a signed excerpt in the public repository makes it fail, so the
32
+ public copy cannot drift from what the private store verified.
33
+
34
+ A bundle is named like a cache file (`PMID_12345.yaml`,
35
+ `DOI_10.1038_s41418-020-0601-5.yaml`) and looks like this:
36
+
37
+ ```yaml
38
+ reference_id: PMID:12345
39
+ title: Example title
40
+ excerpts:
41
+ - text: The verbatim quote ... with omitted words marked by an ellipsis.
42
+ claim_text: Optional paraphrase of the claim the quote supports.
43
+ target_repo:
44
+ - dismech:kb/disorders/Example.yaml
45
+ ```
46
+
47
+ Only `reference_id` and each excerpt's `text` are used by validation. Other
48
+ fields (claims, NER annotations, checksums) are carried along unchanged.
49
+
50
+ ## Syncing bundles with `excerpts sync`
51
+
52
+ `excerpts sync` copies bundles from a local checkout of the private store
53
+ into `signed_excerpts_dir`. Files are copied byte for byte, so the public copy
54
+ is exactly what the store verified.
55
+
56
+ ```bash
57
+ linkml-reference-validator excerpts sync --source ../claimstore/signed_excerpts
58
+ ```
59
+
60
+ With no filters every bundle is copied. A store usually serves several
61
+ repositories, so two filters narrow the selection. A bundle is copied if it
62
+ passes EITHER filter:
63
+
64
+ - `--target-repo NAME` selects bundles with an excerpt whose `target_repo`
65
+ is `NAME` or starts with `NAME:`.
66
+ - `--referenced-in GLOB` (repeatable) selects bundles whose `reference_id` is
67
+ cited in a file matching the glob. This catches excerpts that were never
68
+ tagged with a `target_repo`. Globs are relative to the working directory,
69
+ and a glob that matches no files is an error. The `reference_id` is matched
70
+ as written in the bundle (ignoring case), without the prefix normalization
71
+ that validation applies, so bundles should use the same CURIE form as the
72
+ citing data.
73
+
74
+ List every directory whose files are validated against `signed_excerpts_dir`.
75
+ With `--prune`, a bundle cited only from a directory left out of the list is
76
+ deleted.
77
+
78
+ Other options:
79
+
80
+ - `--prune` deletes bundles in the destination that are no longer selected.
81
+ Files that are not YAML, such as a README, are left alone. Pruning is refused
82
+ if nothing is selected, so a wrong source cannot empty the destination.
83
+ - `--check` writes nothing and exits 1 if the destination is out of date. Other
84
+ errors (missing source, malformed bundle, bad glob) exit 2.
85
+ - `--signed-excerpts-dir DIR` overrides the destination from the config.
86
+
87
+ ### Configuring a repository
88
+
89
+ Put the selection in the config file so that everyone syncs the same way. The
90
+ source path depends on where each person cloned the private store, so supply it
91
+ with `--source` or the `LRV_SIGNED_EXCERPTS_SOURCE` environment variable. It can
92
+ also go in `signed_excerpts_sync.source_dir`, but then it is the same for everyone.
93
+
94
+ ```yaml
95
+ validation:
96
+ signed_excerpts_dir: signed_excerpts
97
+ signed_excerpts_sync:
98
+ target_repo: dismech
99
+ referenced_in:
100
+ - kb/disorders/*.yaml
101
+ - kb/modules/*.yaml
102
+ prune: true
103
+ ```
104
+
105
+ Options given on the command line override the config.
106
+
107
+ ### Example: dismech
108
+
109
+ [dismech](https://github.com/monarch-initiative/dismech) cites claimstore
110
+ excerpts in `kb/disorders/`. Its config holds the settings above, and its
111
+ justfile wraps the command:
112
+
113
+ ```bash
114
+ # needs read access to the private monarch-initiative/claimstore repo
115
+ git clone git@github.com:monarch-initiative/claimstore.git ../claimstore
116
+ just sync-signed-excerpts # uses ../claimstore by default
117
+ CLAIMSTORE_DIR=~/repos/claimstore just sync-signed-excerpts
118
+ ```
119
+
120
+ Then commit the changed `signed_excerpts/*.yaml` files with the disorder files
121
+ that quote them. Validation in dismech CI reads only the committed
122
+ `signed_excerpts/` and never needs access to the private store.
@@ -18,6 +18,7 @@ linkml-reference-validator [OPTIONS] COMMAND [ARGS]...
18
18
  - `validate` - Validate supporting text against references
19
19
  - `repair` - Repair supporting text validation errors
20
20
  - `cache` - Manage reference cache
21
+ - `excerpts` - Manage signed excerpts synced from a private full-text store
21
22
 
22
23
  ---
23
24
 
@@ -677,6 +678,41 @@ repair:
677
678
 
678
679
  ---
679
680
 
681
+ ## excerpts sync
682
+
683
+ Copy signed excerpt bundles from a local checkout of a private full-text store
684
+ into `signed_excerpts_dir`. See
685
+ [Using Signed Excerpts](../how-to/use-signed-excerpts.md).
686
+
687
+ ### Usage
688
+
689
+ ```bash
690
+ linkml-reference-validator excerpts sync [OPTIONS]
691
+ ```
692
+
693
+ ### Options
694
+
695
+ - `--source, -s PATH` - Bundle directory in the private store (env: `LRV_SIGNED_EXCERPTS_SOURCE`)
696
+ - `--signed-excerpts-dir PATH` - Destination (default: `signed_excerpts_dir` from config)
697
+ - `--target-repo NAME` - Select bundles tagged for this repo in `target_repo`
698
+ - `--referenced-in GLOB` - Select bundles whose reference is cited in matching files (repeatable)
699
+ - `--prune / --no-prune` - Remove destination bundles that are no longer selected
700
+ - `--check` - Write nothing; exit 1 if the destination is out of date
701
+ - `--config PATH` - Configuration file
702
+
703
+ Defaults for `--target-repo`, `--referenced-in`, `--prune` and `--source` come from
704
+ the `signed_excerpts_sync` section of the config.
705
+
706
+ ### Exit Codes
707
+
708
+ - `0` - Synced (or, with `--check`, already up to date)
709
+ - `1` - With `--check`, out of date
710
+ - `2` - Configuration or input error: no source or destination, source directory
711
+ missing, a malformed bundle, a `--referenced-in` glob that is absolute or matches
712
+ no files, or `--prune` with nothing selected
713
+
714
+ ---
715
+
680
716
  ## cache
681
717
 
682
718
  Manage reference cache.
@@ -43,6 +43,7 @@ nav:
43
43
  - Validating Reference Titles: how-to/validate-titles.md
44
44
  - Using Local Files and URLs: how-to/use-local-files-and-urls.md
45
45
  - Fetching Full Text and PDFs: how-to/fetch-full-text-and-pdfs.md
46
+ - Using Signed Excerpts: how-to/use-signed-excerpts.md
46
47
  - Exporting a Cache to Zotero: how-to/export-cache-to-zotero.md
47
48
  - Adding a New Reference Source: how-to/add-reference-source.md
48
49
  - Skipping Unsupported References: how-to/skip-unsupported-references.md
@@ -4,6 +4,7 @@ import typer
4
4
 
5
5
  # Import subcommand modules
6
6
  from .cache import cache_app, reference_command
7
+ from .excerpts import excerpts_app
7
8
  from .lookup import lookup_command
8
9
  from .repair import repair_app
9
10
  from .validate import data_command, text_command, validate_app
@@ -34,6 +35,12 @@ app.add_typer(
34
35
  help="Manage reference cache",
35
36
  )
36
37
 
38
+ app.add_typer(
39
+ excerpts_app,
40
+ name="excerpts",
41
+ help="Manage signed excerpts synced from a private full-text store",
42
+ )
43
+
37
44
  # Register top-level lookup command
38
45
  app.command(name="lookup")(lookup_command)
39
46
 
@@ -0,0 +1,129 @@
1
+ """Commands for managing signed excerpts synced from a private full-text store."""
2
+
3
+ from pathlib import Path
4
+ from typing import Optional
5
+
6
+ import typer
7
+ from ruamel.yaml import YAMLError # type: ignore
8
+ from typing_extensions import Annotated
9
+
10
+ from linkml_reference_validator.signed_excerpts import sync_signed_excerpts
11
+ from .shared import ConfigFileOption, SignedExcerptsDirOption, load_validation_config
12
+
13
+ excerpts_app = typer.Typer(
14
+ help="Manage signed excerpts synced from a private full-text store",
15
+ no_args_is_help=True,
16
+ )
17
+
18
+
19
+ @excerpts_app.command(name="sync")
20
+ def sync_command(
21
+ source: Annotated[
22
+ Optional[Path],
23
+ typer.Option(
24
+ "--source",
25
+ "-s",
26
+ envvar="LRV_SIGNED_EXCERPTS_SOURCE",
27
+ help=(
28
+ "Signed excerpts directory in a local checkout of the private store "
29
+ "(e.g. ../claimstore/signed_excerpts). Overrides signed_excerpts_sync.source_dir."
30
+ ),
31
+ ),
32
+ ] = None,
33
+ signed_excerpts_dir: SignedExcerptsDirOption = None,
34
+ target_repo: Annotated[
35
+ Optional[str],
36
+ typer.Option(
37
+ "--target-repo",
38
+ help="Select bundles tagged for this repo in excerpt target_repo (e.g. dismech)",
39
+ ),
40
+ ] = None,
41
+ referenced_in: Annotated[
42
+ Optional[list[str]],
43
+ typer.Option(
44
+ "--referenced-in",
45
+ help="Glob of data files; select bundles whose reference is cited there (repeatable)",
46
+ ),
47
+ ] = None,
48
+ prune: Annotated[
49
+ Optional[bool],
50
+ typer.Option(
51
+ "--prune/--no-prune",
52
+ help="Remove destination bundles that are no longer selected",
53
+ ),
54
+ ] = None,
55
+ check: Annotated[
56
+ bool,
57
+ typer.Option(
58
+ "--check",
59
+ help="Write nothing; exit 1 if the destination is out of date",
60
+ ),
61
+ ] = False,
62
+ config_file: ConfigFileOption = None,
63
+ ):
64
+ """Copy signed excerpt bundles from a private store into signed_excerpts_dir.
65
+
66
+ Options given on the command line override the `signed_excerpts_sync`
67
+ section of the config file.
68
+
69
+ Examples:
70
+
71
+ linkml-reference-validator excerpts sync --source ../claimstore/signed_excerpts
72
+
73
+ linkml-reference-validator excerpts sync -s ../claimstore/signed_excerpts \\
74
+ --signed-excerpts-dir signed_excerpts --target-repo dismech \\
75
+ --referenced-in 'kb/disorders/*.yaml' --prune
76
+ """
77
+ config = load_validation_config(config_file, load_custom_sources=False)
78
+ settings = config.signed_excerpts_sync
79
+
80
+ source_dir = source or settings.source_dir
81
+ if source_dir is None:
82
+ typer.echo(
83
+ "No source given: pass --source, set LRV_SIGNED_EXCERPTS_SOURCE, "
84
+ "or set signed_excerpts_sync.source_dir in the config.",
85
+ err=True,
86
+ )
87
+ raise typer.Exit(2)
88
+ dest_dir = signed_excerpts_dir or config.signed_excerpts_dir
89
+ if dest_dir is None:
90
+ typer.echo(
91
+ "No destination: pass --signed-excerpts-dir or set signed_excerpts_dir in the config.",
92
+ err=True,
93
+ )
94
+ raise typer.Exit(2)
95
+ # Problems with the private store or the selection are user errors, so
96
+ # report them as such (exit 2) rather than as a traceback; exit 1 is
97
+ # reserved for --check finding drift.
98
+ try:
99
+ report = sync_signed_excerpts(
100
+ source_dir,
101
+ dest_dir,
102
+ target_repo=(target_repo if target_repo is not None else settings.target_repo)
103
+ or None,
104
+ referenced_in=referenced_in or settings.referenced_in,
105
+ prune=prune if prune is not None else settings.prune,
106
+ dry_run=check,
107
+ )
108
+ except FileNotFoundError as e:
109
+ typer.echo(f"{e} (is the private store cloned there?)", err=True)
110
+ raise typer.Exit(2)
111
+ except (ValueError, YAMLError) as e:
112
+ typer.echo(str(e), err=True)
113
+ raise typer.Exit(2)
114
+
115
+ verb = "would be " if check else ""
116
+ for label, names in [
117
+ ("added", report.added),
118
+ ("updated", report.updated),
119
+ ("removed", report.removed),
120
+ ]:
121
+ for name in names:
122
+ typer.echo(f" {label}: {name}")
123
+ typer.echo(
124
+ f"{source_dir} -> {dest_dir}: {len(report.added)} {verb}added, "
125
+ f"{len(report.updated)} {verb}updated, {len(report.removed)} {verb}removed, "
126
+ f"{len(report.unchanged)} unchanged"
127
+ )
128
+ if check and report.changed:
129
+ raise typer.Exit(1)
@@ -19,6 +19,14 @@ CacheDirOption = Annotated[
19
19
  ),
20
20
  ]
21
21
 
22
+ SignedExcerptsDirOption = Annotated[
23
+ Optional[Path],
24
+ typer.Option(
25
+ "--signed-excerpts-dir",
26
+ help="Directory of pre-verified ('signed') excerpts for exact-match fallback",
27
+ ),
28
+ ]
29
+
22
30
  VerboseOption = Annotated[
23
31
  bool,
24
32
  typer.Option(
@@ -18,6 +18,7 @@ from linkml_reference_validator.validation.supporting_text_validator import (
18
18
 
19
19
  from .shared import (
20
20
  CacheDirOption,
21
+ SignedExcerptsDirOption,
21
22
  VerboseOption,
22
23
  ConfigFileOption,
23
24
  FullTextOption,
@@ -48,6 +49,7 @@ def text_command(
48
49
  ] = None,
49
50
  config_file: ConfigFileOption = None,
50
51
  cache_dir: CacheDirOption = None,
52
+ signed_excerpts_dir: SignedExcerptsDirOption = None,
51
53
  full_text: FullTextOption = True,
52
54
  verbose: VerboseOption = False,
53
55
  ):
@@ -71,6 +73,8 @@ def text_command(
71
73
  config = load_validation_config(config_file)
72
74
  if cache_dir:
73
75
  config.cache_dir = cache_dir
76
+ if signed_excerpts_dir:
77
+ config.signed_excerpts_dir = signed_excerpts_dir
74
78
  config.fetch_full_text = full_text
75
79
 
76
80
  validator = SupportingTextValidator(config)
@@ -137,6 +141,7 @@ def text_file_command(
137
141
  ] = False,
138
142
  config_file: ConfigFileOption = None,
139
143
  cache_dir: CacheDirOption = None,
144
+ signed_excerpts_dir: SignedExcerptsDirOption = None,
140
145
  full_text: FullTextOption = True,
141
146
  verbose: VerboseOption = False,
142
147
  ):
@@ -167,6 +172,8 @@ def text_file_command(
167
172
  config = load_validation_config(config_file)
168
173
  if cache_dir:
169
174
  config.cache_dir = cache_dir
175
+ if signed_excerpts_dir:
176
+ config.signed_excerpts_dir = signed_excerpts_dir
170
177
  config.fetch_full_text = full_text
171
178
 
172
179
  typer.echo(f"Extracting text from {file_path}")
@@ -242,6 +249,7 @@ def data_command(
242
249
  ] = None,
243
250
  config_file: ConfigFileOption = None,
244
251
  cache_dir: CacheDirOption = None,
252
+ signed_excerpts_dir: SignedExcerptsDirOption = None,
245
253
  full_text: FullTextOption = True,
246
254
  verbose: VerboseOption = False,
247
255
  ):
@@ -268,6 +276,8 @@ def data_command(
268
276
  config = load_validation_config(config_file)
269
277
  if cache_dir:
270
278
  config.cache_dir = cache_dir
279
+ if signed_excerpts_dir:
280
+ config.signed_excerpts_dir = signed_excerpts_dir
271
281
  config.fetch_full_text = full_text
272
282
 
273
283
  # NOTE: `linkml` is an optional dependency. Import it only when this command is invoked.
@@ -11,6 +11,7 @@ Examples:
11
11
  True
12
12
  """
13
13
 
14
+ import html
14
15
  import logging
15
16
  import re
16
17
  import time
@@ -44,6 +45,27 @@ _JATS_ABSTRACT_BLOCKS = frozenset(
44
45
  )
45
46
 
46
47
 
48
+ # Inline formatting tags that Crossref and DataCite leave in titles: HTML
49
+ # (``<i>``, ``<sub>``...), JATS without a prefix (``<italic>``, ``<sc>``...) and
50
+ # any namespaced tag (``<jats:italic>``, ``<mml:mi>``). Only these are stripped,
51
+ # so a bare comparison such as ``x<y`` or a title about ``<canvas>`` survives.
52
+ # Attributes must be ``name="value"`` pairs, so ``A<B and C>D`` is not a tag.
53
+ _INLINE_TAG_NAMES = (
54
+ "i|b|u|em|strong|sub|sup|sc|scp|small|span|tt|code|br|"
55
+ "italic|bold|underline|monospace|inline-formula|styled-content"
56
+ )
57
+ _INLINE_TAG = re.compile(
58
+ r"</?(?:[A-Za-z][\w.-]*:[A-Za-z][\w.-]*|(?:" + _INLINE_TAG_NAMES + r"))"
59
+ r"""(?:\s+[\w:.-]+\s*=\s*(?:"[^"]*"|'[^']*'))*\s*/?>"""
60
+ )
61
+ # The whitespace Crossref leaves between a closing tag and the punctuation
62
+ # after it (``</b>\n :``). Spacing away from a tag is left as written.
63
+ _SPACE_AFTER_CLOSING_TAG = re.compile(
64
+ r"(</(?:[A-Za-z][\w.-]*:[A-Za-z][\w.-]*|(?:" + _INLINE_TAG_NAMES + r"))\s*>)"
65
+ r"\s+(?=[:;,.!?])"
66
+ )
67
+
68
+
47
69
  @ReferenceSourceRegistry.register
48
70
  class DOISource(ReferenceSource):
49
71
  """Fetch references from Crossref using DOI, with DataCite fallback.
@@ -129,7 +151,7 @@ class DOISource(ReferenceSource):
129
151
  return None
130
152
 
131
153
  title_list = message.get("title", [])
132
- title = title_list[0] if title_list else ""
154
+ title = self._clean_title(title_list[0] if title_list else "")
133
155
 
134
156
  authors = self._parse_crossref_authors(message.get("author", []))
135
157
 
@@ -234,7 +256,7 @@ class DOISource(ReferenceSource):
234
256
 
235
257
  # Extract title
236
258
  titles = attributes.get("titles", [])
237
- title = titles[0].get("title", "") if titles else ""
259
+ title = self._clean_title(titles[0].get("title", "") if titles else "")
238
260
 
239
261
  # Extract authors
240
262
  authors = self._parse_datacite_creators(attributes.get("creators", []))
@@ -523,6 +545,71 @@ class DOISource(ReferenceSource):
523
545
  return str(date_parts[0][0])
524
546
  return ""
525
547
 
548
+ def _clean_title(self, title: str) -> str:
549
+ """Reduce a Crossref or DataCite title to plain, single-spaced text.
550
+
551
+ Crossref keeps inline HTML/JATS markup (``<i>``, ``<b>``, ``<sub>``,
552
+ ``<scp>``, ``<jats:italic>``...) in some titles and wraps them across
553
+ lines with indentation. Left in, the tag names survive
554
+ ``normalize_text`` as stray words, so a correct curated title fails
555
+ ``validate_title``, and the wrapping shows up as a spurious cache diff.
556
+
557
+ Only known inline formatting tags are stripped (``<br>`` becomes a
558
+ space), then entities are unescaped. This repeats, up to three times,
559
+ so escaped and double-escaped markup (``&lt;i&gt;``,
560
+ ``&amp;lt;i&amp;gt;``) goes too. Anything else that looks like a tag
561
+ stays as text: a bare ``x<y`` is not markup, and a title about the
562
+ ``<canvas>`` element keeps it. Known trade-off: a title about one of
563
+ the stripped tags themselves (e.g. ``<i>``) loses that tag name.
564
+
565
+ Whitespace is collapsed, and the space a closing tag leaves before
566
+ punctuation is removed. Spacing away from any tag, such as French
567
+ ``Titre : sous-titre``, is kept as written.
568
+
569
+ Args:
570
+ title: Title as returned by Crossref or DataCite
571
+
572
+ Returns:
573
+ Plain-text title
574
+
575
+ Examples:
576
+ >>> source = DOISource()
577
+ >>> source._clean_title(
578
+ ... "Novel variants in\\n <i>COL2A1</i>\\n"
579
+ ... " causing rare spondyloepiphyseal dysplasia congenita")
580
+ 'Novel variants in COL2A1 causing rare spondyloepiphyseal dysplasia congenita'
581
+ >>> source._clean_title(
582
+ ... "<b>httk</b>\\n :\\n <i>R</i>\\n"
583
+ ... " Package for High-Throughput Toxicokinetics")
584
+ 'httk: R Package for High-Throughput Toxicokinetics'
585
+ >>> source._clean_title("<i>BRCA1, BRCA2</i>\\n , and PALB2")
586
+ 'BRCA1, BRCA2, and PALB2'
587
+ >>> source._clean_title("Uptake of H<sub>2</sub>O")
588
+ 'Uptake of H2O'
589
+ >>> source._clean_title("&amp;lt;i&amp;gt;R&amp;lt;/i&amp;gt; Package")
590
+ 'R Package'
591
+ >>> source._clean_title("Proof that x<y holds when p &lt; 0.05")
592
+ 'Proof that x<y holds when p < 0.05'
593
+ >>> source._clean_title("The &lt;canvas&gt; element")
594
+ 'The <canvas> element'
595
+ >>> source._clean_title("Titre : sous-titre")
596
+ 'Titre : sous-titre'
597
+ >>> source._clean_title("")
598
+ ''
599
+ """
600
+ text = title
601
+ for _ in range(3):
602
+ stripped = _SPACE_AFTER_CLOSING_TAG.sub(r"\1", text)
603
+ stripped = _INLINE_TAG.sub(
604
+ lambda m: " " if m.group(0).lstrip("</").startswith("br") else "",
605
+ stripped,
606
+ )
607
+ unescaped = html.unescape(stripped)
608
+ if unescaped == text:
609
+ break
610
+ text = unescaped
611
+ return " ".join(text.split())
612
+
526
613
  def _clean_abstract(self, abstract: str) -> str:
527
614
  """Clean JATS/XML markup from abstract text.
528
615
 
@@ -419,6 +419,51 @@ class RepairConfig(BaseModel):
419
419
  )
420
420
 
421
421
 
422
+ class SignedExcerptsSyncConfig(BaseModel):
423
+ """Settings for ``excerpts sync``, which copies signed excerpt bundles from a
424
+ private full-text store (e.g. claimstore) into a public repo's
425
+ ``signed_excerpts_dir``.
426
+
427
+ With no ``target_repo`` and no ``referenced_in`` every bundle is copied.
428
+ Otherwise a bundle is copied if it is tagged for ``target_repo`` OR its
429
+ ``reference_id`` is cited in a file matching ``referenced_in``.
430
+
431
+ Examples:
432
+ >>> SignedExcerptsSyncConfig().prune
433
+ False
434
+ >>> c = SignedExcerptsSyncConfig(target_repo="dismech", referenced_in=["kb/disorders/*.yaml"])
435
+ >>> c.target_repo, c.referenced_in
436
+ ('dismech', ['kb/disorders/*.yaml'])
437
+ """
438
+
439
+ source_dir: Optional[Path] = Field(
440
+ default=None,
441
+ description=(
442
+ "Directory of signed excerpt bundles in a local checkout of the private "
443
+ "store (e.g. ../claimstore/signed_excerpts). Usually supplied per user "
444
+ "with --source or LRV_SIGNED_EXCERPTS_SOURCE instead."
445
+ ),
446
+ )
447
+ target_repo: Optional[str] = Field(
448
+ default=None,
449
+ description=(
450
+ "Select bundles with an excerpt whose target_repo entry is this name or "
451
+ "starts with '<name>:' (e.g. 'dismech' matches 'dismech:kb/disorders/X.yaml')."
452
+ ),
453
+ )
454
+ referenced_in: list[str] = Field(
455
+ default_factory=list,
456
+ description=(
457
+ "Glob patterns (relative to the working directory) of data files; select "
458
+ "bundles whose reference_id is cited in any of them."
459
+ ),
460
+ )
461
+ prune: bool = Field(
462
+ default=False,
463
+ description="Remove bundles from the destination that are no longer selected.",
464
+ )
465
+
466
+
422
467
  class ReferenceValidationConfig(BaseModel):
423
468
  r"""Configuration for reference validation.
424
469
 
@@ -457,12 +502,32 @@ class ReferenceValidationConfig(BaseModel):
457
502
  0
458
503
  >>> ReferenceValidationConfig(min_excerpt_length=20).min_excerpt_length
459
504
  20
505
+ >>> ReferenceValidationConfig().max_excerpt_length
506
+ 0
507
+ >>> ReferenceValidationConfig(max_excerpt_length=400).max_excerpt_length
508
+ 400
460
509
  """
461
510
 
462
511
  cache_dir: Path = Field(
463
512
  default=Path("references_cache"),
464
513
  description="Directory for caching downloaded references",
465
514
  )
515
+ signed_excerpts_dir: Optional[Path] = Field(
516
+ default=None,
517
+ description=(
518
+ "Optional directory of pre-verified ('signed') excerpts synced from a "
519
+ "private full-text store (e.g. claimstore). An excerpt is trusted if "
520
+ "it EITHER substring-matches the reference cache OR exact-matches an "
521
+ "excerpt recorded for that reference in signed_excerpts_dir."
522
+ ),
523
+ )
524
+ signed_excerpts_sync: SignedExcerptsSyncConfig = Field(
525
+ default_factory=SignedExcerptsSyncConfig,
526
+ description=(
527
+ "How `excerpts sync` selects bundles from the private store to copy "
528
+ "into signed_excerpts_dir."
529
+ ),
530
+ )
466
531
  private_cache_dir: Path = Field(
467
532
  default_factory=lambda: Path.home()
468
533
  / ".cache"
@@ -524,6 +589,45 @@ class ReferenceValidationConfig(BaseModel):
524
589
  "empty and whitespace-only excerpts are always rejected regardless."
525
590
  ),
526
591
  )
592
+ max_excerpt_length: int = Field(
593
+ default=0,
594
+ ge=0,
595
+ description=(
596
+ "Maximum number of non-whitespace characters of quoted text allowed "
597
+ "in a single excerpt (across all '...' parts) for fair-use compliance. "
598
+ "Set to 0 to disable the check."
599
+ ),
600
+ )
601
+ max_excerpt_part_length: int = Field(
602
+ default=0,
603
+ ge=0,
604
+ description=(
605
+ "Maximum number of non-whitespace characters of quoted text allowed "
606
+ "in any single contiguous part between '...' separators. Encourages "
607
+ "concise, ellipsis-interspersed quotations under fair use. "
608
+ "Set to 0 to disable the check."
609
+ ),
610
+ )
611
+ max_total_chars_per_reference: int = Field(
612
+ default=0,
613
+ ge=0,
614
+ description=(
615
+ "Maximum cumulative non-whitespace characters quoted across all distinct "
616
+ "excerpts citing the same reference within a validation run. "
617
+ "Set to 0 to disable the check."
618
+ ),
619
+ )
620
+ max_reference_fraction: float = Field(
621
+ default=0.0,
622
+ ge=0.0,
623
+ le=1.0,
624
+ description=(
625
+ "Maximum fraction (0.0 to 1.0) of a reference's total non-whitespace "
626
+ "character length that may be cumulatively quoted across all distinct "
627
+ "excerpts citing that reference. Protects short works under fair use. "
628
+ "Set to 0.0 to disable the check."
629
+ ),
630
+ )
527
631
  reference_prefix_map: dict[str, str] = Field(
528
632
  default_factory=dict,
529
633
  description=(