linkml-reference-validator 0.5.1__tar.gz → 0.6.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 (275) hide show
  1. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/PKG-INFO +17 -1
  2. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/README.md +16 -0
  3. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/docs/concepts/content-types.md +1 -0
  4. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/docs/how-to/add-reference-source.md +4 -0
  5. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/docs/how-to/validate-urls.md +1 -0
  6. linkml_reference_validator-0.6.0/docs/how-to/validate-wikipedia.md +118 -0
  7. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/docs/reference/cache-format.md +2 -0
  8. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/mkdocs.yml +1 -0
  9. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/src/linkml_reference_validator/cache.py +3 -0
  10. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/src/linkml_reference_validator/cli/shared.py +8 -0
  11. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/src/linkml_reference_validator/cli/validate.py +10 -0
  12. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/src/linkml_reference_validator/etl/reference_fetcher.py +29 -2
  13. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/src/linkml_reference_validator/etl/sources/__init__.py +4 -1
  14. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/src/linkml_reference_validator/etl/sources/base.py +42 -0
  15. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/src/linkml_reference_validator/etl/sources/doi.py +89 -2
  16. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/src/linkml_reference_validator/etl/sources/json_api.py +3 -1
  17. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/src/linkml_reference_validator/etl/sources/pmid.py +42 -0
  18. linkml_reference_validator-0.6.0/src/linkml_reference_validator/etl/sources/wikipedia.py +231 -0
  19. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/src/linkml_reference_validator/models.py +58 -0
  20. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/src/linkml_reference_validator/plugins/reference_validation_plugin.py +52 -9
  21. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/src/linkml_reference_validator/validation/supporting_text_validator.py +216 -15
  22. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_cache_validation.py +6 -0
  23. linkml_reference_validator-0.6.0/tests/test_doi_title_cleaning.py +164 -0
  24. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_pmid_network.py +26 -0
  25. linkml_reference_validator-0.6.0/tests/test_signed_excerpts_and_fair_use.py +394 -0
  26. linkml_reference_validator-0.6.0/tests/test_wikipedia_source.py +370 -0
  27. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/.claude/.mcp.json +0 -0
  28. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/.claude/settings.json +0 -0
  29. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/.copier-answers.yml +0 -0
  30. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/.devcontainer/devcontainer.json +0 -0
  31. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/.devcontainer/post_create.sh +0 -0
  32. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/.editorconfig +0 -0
  33. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/.github/actions/claude-code-action/action.yml +0 -0
  34. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/.github/actions/claude-issue-summarize-action/action.yml +0 -0
  35. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/.github/actions/claude-issue-triage-action/action.yml +0 -0
  36. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/.github/ai-controllers.json +0 -0
  37. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/.github/copilot-instructions.md +0 -0
  38. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/.github/copilot-setup-steps.yml +0 -0
  39. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/.github/dependabot.yml +0 -0
  40. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/.github/workflows/claude-code-review.yml +0 -0
  41. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/.github/workflows/claude-issue-summarize.yml +0 -0
  42. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/.github/workflows/claude-issue-triage.yml +0 -0
  43. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/.github/workflows/claude-ontology-review.yml +0 -0
  44. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/.github/workflows/claude.yml +0 -0
  45. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/.github/workflows/deploy-docs.yaml +0 -0
  46. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/.github/workflows/dragon-ai.yml +0 -0
  47. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/.github/workflows/main.yaml +0 -0
  48. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/.github/workflows/pypi-publish.yaml +0 -0
  49. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/.gitignore +0 -0
  50. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/.goosehints +0 -0
  51. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/.pre-commit-config.yaml +0 -0
  52. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/.yamllint.yaml +0 -0
  53. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/AGENTS.md +0 -0
  54. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/BUG_GEO_ACCESSION_TO_UID.md +0 -0
  55. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/BUG_ZENODO_DOI_AND_URL_HANDLING.md +0 -0
  56. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/CLAUDE.md +0 -0
  57. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/CLI-ISSUES.md +0 -0
  58. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/CODE_OF_CONDUCT.md +0 -0
  59. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/CONTRIBUTING.md +0 -0
  60. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/FEATURE_REQUEST_REPAIR.md +0 -0
  61. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/LICENSE +0 -0
  62. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/REVIEW2.md +0 -0
  63. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/REVIEW3.md +0 -0
  64. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/ai.just +0 -0
  65. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/benchmarks/repeated_quotes.py +0 -0
  66. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/copilot-instructions.md +0 -0
  67. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/docs/about.md +0 -0
  68. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/docs/assets/zotero-find-full-text.png +0 -0
  69. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/docs/concepts/editorial-conventions.md +0 -0
  70. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/docs/concepts/how-it-works.md +0 -0
  71. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/docs/elements/.gitkeep +0 -0
  72. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/docs/how-to/export-cache-to-zotero.md +0 -0
  73. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/docs/how-to/fetch-full-text-and-pdfs.md +0 -0
  74. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/docs/how-to/repair-validation-errors.md +0 -0
  75. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/docs/how-to/skip-unsupported-references.md +0 -0
  76. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/docs/how-to/use-local-files-and-urls.md +0 -0
  77. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/docs/how-to/validate-clinical-trials.md +0 -0
  78. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/docs/how-to/validate-dois.md +0 -0
  79. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/docs/how-to/validate-entrez.md +0 -0
  80. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/docs/how-to/validate-obo-files.md +0 -0
  81. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/docs/how-to/validate-titles.md +0 -0
  82. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/docs/index.md +0 -0
  83. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/docs/notebooks/01_getting_started.ipynb +0 -0
  84. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/docs/notebooks/02_advanced_usage.ipynb +0 -0
  85. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/docs/notebooks/03_python_api.ipynb +0 -0
  86. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/docs/notebooks/04_obo_validation.ipynb +0 -0
  87. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/docs/notebooks/05_geo_validation.ipynb +0 -0
  88. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/docs/quickstart.md +0 -0
  89. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/docs/reference/cli.md +0 -0
  90. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/docs/reference/splitting.md +0 -0
  91. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/docs/setup-guide.md +0 -0
  92. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/docs/superpowers/plans/2026-06-12-modular-pdf-fulltext-fetching.md +0 -0
  93. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/docs/superpowers/plans/2026-08-05-private-library-full-text.md +0 -0
  94. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/docs/superpowers/specs/2026-06-12-modular-pdf-fulltext-fetching-design.md +0 -0
  95. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/docs/superpowers/specs/2026-08-05-private-library-full-text-design.md +0 -0
  96. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/docs/templates-linkml/README.md +0 -0
  97. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/docs/todo.md +0 -0
  98. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/docs/troubleshooting.md +0 -0
  99. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/docs/tutorials/complete-workflow.md +0 -0
  100. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/examples/README.md +0 -0
  101. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/justfile +0 -0
  102. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/mypy.ini +0 -0
  103. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/notebooks/01_getting_started.ipynb +0 -0
  104. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/notebooks/02_advanced_usage.ipynb +0 -0
  105. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/notebooks/03_python_api.ipynb +0 -0
  106. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/notebooks/README.md +0 -0
  107. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/project/README.md +0 -0
  108. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/project.justfile +0 -0
  109. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/pyproject.toml +0 -0
  110. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/pytest.ini +0 -0
  111. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/skills/linkml-reference-validator/SKILL.md +0 -0
  112. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/skills/linkml-reference-validator/references/configuration.md +0 -0
  113. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/skills/linkml-reference-validator/references/guardrails.md +0 -0
  114. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/src/linkml_reference_validator/__init__.py +0 -0
  115. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/src/linkml_reference_validator/_version.py +0 -0
  116. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/src/linkml_reference_validator/cli/__init__.py +0 -0
  117. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/src/linkml_reference_validator/cli/cache.py +0 -0
  118. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/src/linkml_reference_validator/cli/lookup.py +0 -0
  119. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/src/linkml_reference_validator/cli/repair.py +0 -0
  120. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/src/linkml_reference_validator/etl/__init__.py +0 -0
  121. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/src/linkml_reference_validator/etl/acquire.py +0 -0
  122. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/src/linkml_reference_validator/etl/csl_export.py +0 -0
  123. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/src/linkml_reference_validator/etl/extract/__init__.py +0 -0
  124. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/src/linkml_reference_validator/etl/extract/base.py +0 -0
  125. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/src/linkml_reference_validator/etl/extract/drawio.py +0 -0
  126. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/src/linkml_reference_validator/etl/extract/html.py +0 -0
  127. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/src/linkml_reference_validator/etl/extract/pdf.py +0 -0
  128. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/src/linkml_reference_validator/etl/extract/svg.py +0 -0
  129. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/src/linkml_reference_validator/etl/extract/svg_geometry.py +0 -0
  130. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/src/linkml_reference_validator/etl/extract/untrusted_xml.py +0 -0
  131. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/src/linkml_reference_validator/etl/extract/xml.py +0 -0
  132. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/src/linkml_reference_validator/etl/fulltext/__init__.py +0 -0
  133. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/src/linkml_reference_validator/etl/fulltext/base.py +0 -0
  134. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/src/linkml_reference_validator/etl/fulltext/bioc.py +0 -0
  135. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/src/linkml_reference_validator/etl/fulltext/bookshelf.py +0 -0
  136. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/src/linkml_reference_validator/etl/fulltext/epmc.py +0 -0
  137. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/src/linkml_reference_validator/etl/fulltext/epmc_preprint.py +0 -0
  138. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/src/linkml_reference_validator/etl/fulltext/json_api.py +0 -0
  139. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/src/linkml_reference_validator/etl/fulltext/loader.py +0 -0
  140. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/src/linkml_reference_validator/etl/fulltext/openalex.py +0 -0
  141. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/src/linkml_reference_validator/etl/fulltext/pmc.py +0 -0
  142. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/src/linkml_reference_validator/etl/fulltext/unpaywall.py +0 -0
  143. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/src/linkml_reference_validator/etl/fulltext/zotero.py +0 -0
  144. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/src/linkml_reference_validator/etl/identifiers.py +0 -0
  145. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/src/linkml_reference_validator/etl/rules.py +0 -0
  146. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/src/linkml_reference_validator/etl/sources/clinicaltrials.py +0 -0
  147. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/src/linkml_reference_validator/etl/sources/entrez.py +0 -0
  148. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/src/linkml_reference_validator/etl/sources/file.py +0 -0
  149. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/src/linkml_reference_validator/etl/sources/loader.py +0 -0
  150. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/src/linkml_reference_validator/etl/sources/ppr.py +0 -0
  151. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/src/linkml_reference_validator/etl/sources/url.py +0 -0
  152. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/src/linkml_reference_validator/etl/sources/utils.py +0 -0
  153. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/src/linkml_reference_validator/etl/text_extractor.py +0 -0
  154. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/src/linkml_reference_validator/field_detection.py +0 -0
  155. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/src/linkml_reference_validator/matching.py +0 -0
  156. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/src/linkml_reference_validator/plugins/REVIEW.md +0 -0
  157. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/src/linkml_reference_validator/plugins/__init__.py +0 -0
  158. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/src/linkml_reference_validator/validation/__init__.py +0 -0
  159. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/src/linkml_reference_validator/validation/fuzzy_text_utils.py +0 -0
  160. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/src/linkml_reference_validator/validation/repairer.py +0 -0
  161. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/__init__.py +0 -0
  162. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/conftest.py +0 -0
  163. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/data/test_data_deep_nesting_invalid.yaml +0 -0
  164. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/data/test_data_deep_nesting_valid.yaml +0 -0
  165. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/data/test_data_invalid.yaml +0 -0
  166. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/data/test_data_valid.yaml +0 -0
  167. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/data/test_schema.yaml +0 -0
  168. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/data/test_schema_deep_nesting.yaml +0 -0
  169. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/fixtures/GEO_GSE12345.md +0 -0
  170. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/fixtures/PMC_TEST001.md +0 -0
  171. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/fixtures/PMC_TEST001.txt +0 -0
  172. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/fixtures/PMC_TEST002.md +0 -0
  173. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/fixtures/PMC_TEST002.txt +0 -0
  174. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/fixtures/PMID_TEST001.md +0 -0
  175. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/fixtures/PMID_TEST001.txt +0 -0
  176. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/fixtures/PMID_TEST002.md +0 -0
  177. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/fixtures/PMID_TEST002.txt +0 -0
  178. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/fixtures/PMID_TEST003.md +0 -0
  179. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/fixtures/PMID_TEST003.txt +0 -0
  180. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/fixtures/bookshelf/esummary_20301710.xml +0 -0
  181. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/fixtures/bookshelf/gene_NBK1116/men1.nxml +0 -0
  182. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/fixtures/bookshelf/pubmed_20301710.xml +0 -0
  183. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/fixtures/clinicaltrials_NCT00000001.md +0 -0
  184. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/fixtures/fulltext_html/README.md +0 -0
  185. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/fixtures/fulltext_html/dspace-32894695.html +0 -0
  186. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/fixtures/fulltext_html/iris-19049553.html +0 -0
  187. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/fixtures/fulltext_html/plos-0000308.html +0 -0
  188. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/fixtures/jats/PMC5593426.xml +0 -0
  189. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/fixtures/jats/README.md +0 -0
  190. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/fixtures/sample.obo +0 -0
  191. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_absent_abstract_recovery.py +0 -0
  192. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_acquire.py +0 -0
  193. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_bookshelf_provider.py +0 -0
  194. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_bot_challenge.py +0 -0
  195. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_cache_author_recovery.py +0 -0
  196. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_cache_filename_collisions.py +0 -0
  197. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_cache_read_robustness.py +0 -0
  198. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_cli.py +0 -0
  199. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_cli_cache_enrich.py +0 -0
  200. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_cli_cache_export.py +0 -0
  201. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_cli_cache_reference.py +0 -0
  202. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_cli_lookup.py +0 -0
  203. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_cli_repair.py +0 -0
  204. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_clinicaltrials_cache.py +0 -0
  205. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_clinicaltrials_integration.py +0 -0
  206. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_deep_nesting.py +0 -0
  207. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_doi_preprint.py +0 -0
  208. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_doi_url_encoding.py +0 -0
  209. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_drawio.py +0 -0
  210. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_e2e_integration.py +0 -0
  211. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_empty_snippets.py +0 -0
  212. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_epmc_preprint_provider.py +0 -0
  213. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_extractor_fidelity.py +0 -0
  214. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_extractors.py +0 -0
  215. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_field_detection.py +0 -0
  216. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_field_detection_qualifiers.py +0 -0
  217. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_file_reference_cache.py +0 -0
  218. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_frontmatter_and_doi_case.py +0 -0
  219. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_fulltext_loader.py +0 -0
  220. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_fulltext_providers.py +0 -0
  221. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_fuzzy_suggestions.py +0 -0
  222. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_geo_integration.py +0 -0
  223. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_greek_variants.py +0 -0
  224. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_html_fulltext_acceptance.py +0 -0
  225. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_html_scope_text.py +0 -0
  226. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_identifiers.py +0 -0
  227. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_inline_abstract_headings.py +0 -0
  228. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_jats_tables.py +0 -0
  229. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_json_api_source.py +0 -0
  230. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_ligature_normalization.py +0 -0
  231. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_long_cache_filenames.py +0 -0
  232. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_meaning_changes.py +0 -0
  233. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_meaning_symbols.py +0 -0
  234. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_models.py +0 -0
  235. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_multivalued_reference.py +0 -0
  236. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_no_cache_downgrade.py +0 -0
  237. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_normalized_content_cache.py +0 -0
  238. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_open_access_policy.py +0 -0
  239. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_optional_linkml_dependency.py +0 -0
  240. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_pdf_url_title.py +0 -0
  241. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_plugin_integration.py +0 -0
  242. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_plugin_value_shapes.py +0 -0
  243. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_pmc_fulltext.py +0 -0
  244. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_ppr_source.py +0 -0
  245. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_publisher_typography.py +0 -0
  246. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_real_validation.py +0 -0
  247. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_reference_fetcher.py +0 -0
  248. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_repair.py +0 -0
  249. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_repair_data_output.py +0 -0
  250. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_repair_thresholds.py +0 -0
  251. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_rules.py +0 -0
  252. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_serve_stale_html_optin.py +0 -0
  253. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_source_network_errors.py +0 -0
  254. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_source_utils.py +0 -0
  255. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_sources.py +0 -0
  256. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_split_supporting_text.py +0 -0
  257. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_supporting_text_validator.py +0 -0
  258. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_svg_edges.py +0 -0
  259. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_svg_extractor.py +0 -0
  260. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_text_extractor.py +0 -0
  261. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_title_only_shapes.py +0 -0
  262. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_title_validation.py +0 -0
  263. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_trust_cached_entries.py +0 -0
  264. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_unknown_slot_traversal.py +0 -0
  265. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_url_fragment_cache.py +0 -0
  266. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_url_html_sanitize.py +0 -0
  267. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_url_html_to_text.py +0 -0
  268. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_url_source_cache_version.py +0 -0
  269. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_validation_config.py +0 -0
  270. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_validation_counts.py +0 -0
  271. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_welded_markers.py +0 -0
  272. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_word_boundaries.py +0 -0
  273. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_xml_extractor_text.py +0 -0
  274. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.0}/tests/test_zotero_provider.py +0 -0
  275. {linkml_reference_validator-0.5.1 → linkml_reference_validator-0.6.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.1
3
+ Version: 0.6.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
@@ -448,6 +448,22 @@ reference:
448
448
  See the [full-text guide](docs/how-to/fetch-full-text-and-pdfs.md#preprints) for
449
449
  details and coverage caveats.
450
450
 
451
+ #### Wikipedia articles
452
+
453
+ ```yaml
454
+ reference:
455
+ id: WIKIPEDIA:Saanen_goat
456
+ supporting_text: "The Saanen originates in the historic region of Saanen"
457
+ ```
458
+
459
+ **Fetches:**
460
+ - The English Wikipedia article as plain text, from the MediaWiki API, so a
461
+ quote through a link or bold text still matches
462
+ - The revision read, its timestamp and canonical URL, recorded in the cache
463
+ (Wikipedia text is CC BY-SA 4.0 and changes over time)
464
+
465
+ See [Validating Wikipedia Articles](docs/how-to/validate-wikipedia.md).
466
+
451
467
  ---
452
468
 
453
469
  ## Schema Requirements
@@ -427,6 +427,22 @@ reference:
427
427
  See the [full-text guide](docs/how-to/fetch-full-text-and-pdfs.md#preprints) for
428
428
  details and coverage caveats.
429
429
 
430
+ #### Wikipedia articles
431
+
432
+ ```yaml
433
+ reference:
434
+ id: WIKIPEDIA:Saanen_goat
435
+ supporting_text: "The Saanen originates in the historic region of Saanen"
436
+ ```
437
+
438
+ **Fetches:**
439
+ - The English Wikipedia article as plain text, from the MediaWiki API, so a
440
+ quote through a link or bold text still matches
441
+ - The revision read, its timestamp and canonical URL, recorded in the cache
442
+ (Wikipedia text is CC BY-SA 4.0 and changes over time)
443
+
444
+ See [Validating Wikipedia Articles](docs/how-to/validate-wikipedia.md).
445
+
430
446
  ---
431
447
 
432
448
  ## Schema Requirements
@@ -8,6 +8,7 @@ When fetching references, the validator tracks what type of content was retrieve
8
8
  |-------|-----------|-------------|
9
9
  | `full_text_xml` | PMID (via PMC) | Full text retrieved from PubMed Central as XML |
10
10
  | `full_text_html` | PMID (via PMC) | Full text retrieved from PubMed Central as HTML (fallback) |
11
+ | `full_text` | WIKIPEDIA | The whole article as plain text |
11
12
  | `abstract_only` | PMID, DOI | Only the abstract was available |
12
13
  | `summary` | GEO, BioProject, BioSample, ClinicalTrials | Database summary/description field |
13
14
  | `local_file` | file: | Content read from local filesystem |
@@ -240,6 +240,10 @@ With this setup:
240
240
  - `MGNIFY:MGYS00000596` - Uses your custom MGnify source
241
241
  - `SRA:SRP123456` - Skipped (returns valid with INFO message)
242
242
 
243
+ A source you define with the same prefix as a built-in one (such as
244
+ `WIKIPEDIA`) takes precedence over the built-in source for that prefix. Its
245
+ `id_patterns` are still tried only after every other built-in source.
246
+
243
247
  ### Finding the Right JSONPath
244
248
 
245
249
  To figure out the correct JSONPath for a new API:
@@ -301,6 +301,7 @@ linkml-reference-validator validate text \
301
301
 
302
302
  ## See Also
303
303
 
304
+ - [Validating Wikipedia Articles](validate-wikipedia.md) - Prefer `WIKIPEDIA:Title` to a Wikipedia URL
304
305
  - [Using Local Files and URLs](use-local-files-and-urls.md) - Quick reference for file and URL sources
305
306
  - [Validating DOIs](validate-dois.md) - For journal articles with DOIs
306
307
  - [Validating OBO Files](validate-obo-files.md) - For ontology-specific validation
@@ -0,0 +1,118 @@
1
+ # Validating Wikipedia References
2
+
3
+ This guide shows how to validate supporting text against English Wikipedia articles.
4
+
5
+ ## Overview
6
+
7
+ The `WIKIPEDIA` source reads an article as plain text from the
8
+ [MediaWiki Action API](https://www.mediawiki.org/wiki/API:Main_page)
9
+ (`prop=extracts` with `explaintext`). It gets:
10
+
11
+ - **Title**: the article's title, after any redirect
12
+ - **Content**: the whole article body as plain text (`content_type: full_text`),
13
+ with section headings as plain lines
14
+ - **Version**: the article's canonical URL, the revision that was read and its timestamp
15
+ - **License**: `CC BY-SA 4.0`
16
+
17
+ Because the text has no markup, a quote that runs through a link or bold text
18
+ on the rendered page matches. A `url:https://en.wikipedia.org/wiki/...`
19
+ reference also works, but it reads the whole rendered page, navigation and
20
+ footer included, and does not record which revision it read.
21
+
22
+ ## Basic Usage
23
+
24
+ Cite the article by its title, as it appears in the article's URL:
25
+
26
+ ```bash
27
+ linkml-reference-validator validate text \
28
+ "The Saanen originates in the historic region of Saanen" \
29
+ WIKIPEDIA:Saanen_goat
30
+ ```
31
+
32
+ In data:
33
+
34
+ ```yaml
35
+ evidence:
36
+ - reference: WIKIPEDIA:Saanen_goat
37
+ supporting_text: The Saanen originates in the historic region of Saanen
38
+ ```
39
+
40
+ ## Accepted Identifier Formats
41
+
42
+ ```
43
+ WIKIPEDIA:Saanen_goat # as in the URL (recommended)
44
+ WIKIPEDIA:Saanen goat # spaces also work
45
+ WIKIPEDIA:Caf%C3%A9 # percent-encoded, as copied from a URL
46
+ wikipedia:Saanen_goat # the prefix is case-insensitive
47
+ ```
48
+
49
+ Every spelling normalizes to the one the article's URL uses, as MediaWiki
50
+ reads titles: spaces become underscores, percent-encoding is decoded and the
51
+ first letter is upper-cased, and a `#Section` anchor is dropped (the citation
52
+ is to the whole article). So `WIKIPEDIA:saanen goat` is `WIKIPEDIA:Saanen_goat`,
53
+ and all of them share the cache file `WIKIPEDIA_Saanen_goat.md`. A project
54
+ that defines its own `WIKIPEDIA` source keeps its IDs as written.
55
+
56
+ A redirect is followed: `WIKIPEDIA:Saanen` reads the article *Saanen goat*, and
57
+ the cached title says so. A title with no article, or an invalid one, is not found.
58
+
59
+ ## Wikipedia Changes Over Time
60
+
61
+ An article is edited, and a quote that matched last month may not match now.
62
+ The cache records what was checked:
63
+
64
+ ```yaml
65
+ ---
66
+ reference_id: WIKIPEDIA:Saanen_goat
67
+ content_type: full_text
68
+ title: Saanen goat
69
+ license: CC BY-SA 4.0
70
+ source_url: https://en.wikipedia.org/wiki/Saanen_goat
71
+ source_revision: '1250000001'
72
+ source_revision_timestamp: '2026-09-01T12:00:00Z'
73
+ ---
74
+ ```
75
+
76
+ Commit the cache with your data, and the quote stays checked against the
77
+ revision in it. `cache reference WIKIPEDIA:Saanen_goat --force` reads the
78
+ current revision. You can see the revision you quoted at
79
+ `https://en.wikipedia.org/w/index.php?oldid=<source_revision>`.
80
+
81
+ Wikipedia's text is licensed CC BY-SA 4.0: quoting it is fine, and a committed
82
+ cache holds a copy of it under that licence.
83
+
84
+ ## Rate Limits
85
+
86
+ Wikimedia asks API clients to identify themselves. The validator sends a
87
+ `User-Agent` naming itself and the `email` in your configuration, so set one:
88
+
89
+ ```yaml
90
+ # .linkml-reference-validator.yaml
91
+ validation:
92
+ email: you@example.org
93
+ ```
94
+
95
+ Wikimedia throttles busy clients with HTTP 429. A throttled request gets no
96
+ result; a cached copy is used when there is one, so caching the articles you
97
+ cite (and committing the cache) keeps validation working offline and in CI.
98
+
99
+ ## Your Own WIKIPEDIA Source
100
+
101
+ A project that defined its own `WIKIPEDIA` source in
102
+ `.linkml-reference-validator-sources.yaml` before this one existed keeps using
103
+ it: a source a project defines takes precedence over a built-in source with the
104
+ same prefix. Delete it to use the built-in source.
105
+
106
+ ## Limitations
107
+
108
+ - English Wikipedia only.
109
+ - A citation is to the article, not a revision: a fresh fetch reads the
110
+ current one.
111
+ - Tables, infoboxes, references and image captions are not in the plain-text
112
+ extract, so a quote from them is not found.
113
+
114
+ ## See Also
115
+
116
+ - [Validating URLs](validate-urls.md)
117
+ - [Adding a New Reference Source](add-reference-source.md)
118
+ - [Cache Format and Validation](../reference/cache-format.md)
@@ -53,6 +53,8 @@ All other known fields are optional and may be null:
53
53
  - Full-text metadata: `full_text_attempted`, `full_text_declined`,
54
54
  `full_text_provider`, `full_text_url`, `oa_status`, `license`, `local_pdf_path`,
55
55
  `full_text_access_type`, and `full_text_source_item_id`.
56
+ - Source version, for sources that change over time (such as `WIKIPEDIA`):
57
+ `source_url`, `source_revision`, and `source_revision_timestamp`.
56
58
  - Captured fields and attachments: `extra_fields_captured` and
57
59
  `supplementary_files`.
58
60
 
@@ -39,6 +39,7 @@ nav:
39
39
  - Validating Clinical Trials: how-to/validate-clinical-trials.md
40
40
  - Validating DOIs: how-to/validate-dois.md
41
41
  - Validating URLs: how-to/validate-urls.md
42
+ - Validating Wikipedia Articles: how-to/validate-wikipedia.md
42
43
  - Validating Reference Titles: how-to/validate-titles.md
43
44
  - Using Local Files and URLs: how-to/use-local-files-and-urls.md
44
45
  - Fetching Full Text and PDFs: how-to/fetch-full-text-and-pdfs.md
@@ -80,6 +80,9 @@ class CacheFrontmatter(BaseModel):
80
80
  local_pdf_path: str | None = None
81
81
  full_text_access_type: str | None = None
82
82
  full_text_source_item_id: str | None = None
83
+ source_url: str | None = None
84
+ source_revision: str | None = None
85
+ source_revision_timestamp: str | None = None
83
86
  extra_fields_captured: list[str] | None = None
84
87
  supplementary_files: list[CacheSupplementaryFile] | None = None
85
88
 
@@ -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.
@@ -40,6 +40,7 @@ from linkml_reference_validator.models import (
40
40
  from linkml_reference_validator.etl.sources import ReferenceSourceRegistry
41
41
  from linkml_reference_validator.etl.sources.clinicaltrials import NCT_ID_PATTERN
42
42
  from linkml_reference_validator.etl.sources.file import FileSource
43
+ from linkml_reference_validator.etl.sources.wikipedia import WikipediaSource, canonical_title
43
44
  from linkml_reference_validator.etl.acquire import ContentAcquirer, resolve_format, sniff_format
44
45
  from linkml_reference_validator.etl.identifiers import build_identifiers
45
46
  from linkml_reference_validator.etl.fulltext.base import PUBLISHER_FREE_ACCESS
@@ -1289,7 +1290,26 @@ class ReferenceFetcher:
1289
1290
  return reference_id.strip()
1290
1291
  if prefix == "file":
1291
1292
  return f"file:{FileSource.resolve_path(identifier, self.config)}"
1292
- return f"{prefix}:{identifier}"
1293
+ return self._canonical_wikipedia_id(f"{prefix}:{identifier}")
1294
+
1295
+ @staticmethod
1296
+ def _canonical_wikipedia_id(reference_id: str) -> str:
1297
+ """Spell a WIKIPEDIA title as its article URL does, when the built-in source reads it.
1298
+
1299
+ Every spelling of one article then shares one cache entry. A project's
1300
+ own WIKIPEDIA source keeps its IDs as written.
1301
+
1302
+ Examples:
1303
+ >>> ReferenceFetcher._canonical_wikipedia_id("WIKIPEDIA:saanen goat")
1304
+ 'WIKIPEDIA:Saanen_goat'
1305
+ >>> ReferenceFetcher._canonical_wikipedia_id("PMID:123")
1306
+ 'PMID:123'
1307
+ """
1308
+ if not reference_id.startswith("WIKIPEDIA:"):
1309
+ return reference_id
1310
+ if ReferenceSourceRegistry.get_source(reference_id) is not WikipediaSource:
1311
+ return reference_id
1312
+ return f"WIKIPEDIA:{canonical_title(reference_id.partition(':')[2])}"
1293
1313
 
1294
1314
  def _normalize_prefix(self, prefix: str) -> str:
1295
1315
  """Normalize prefix casing to match the reference sources."""
@@ -1400,10 +1420,11 @@ class ReferenceFetcher:
1400
1420
  prefix, identifier = self._parse_reference_id(
1401
1421
  reference_id, apply_prefix_map=False
1402
1422
  )
1403
- if prefix == "clinicaltrials":
1423
+ if prefix in ("clinicaltrials", "WIKIPEDIA"):
1404
1424
  reference_id = f"{prefix}:{identifier}"
1405
1425
  if prefix == "file":
1406
1426
  reference_id = f"file:{FileSource.resolve_path(identifier, self.config)}"
1427
+ reference_id = self._canonical_wikipedia_id(reference_id)
1407
1428
  # Other IDs already arrive normalized from fetch(). Reapplying arbitrary
1408
1429
  # prefix maps here could follow a second alias and change the cache key.
1409
1430
  return cache_key(reference_id)
@@ -1674,6 +1695,9 @@ class ReferenceFetcher:
1674
1695
  local_pdf_path=reference.local_pdf_path or None,
1675
1696
  full_text_access_type=reference.full_text_access_type or None,
1676
1697
  full_text_source_item_id=reference.full_text_source_item_id or None,
1698
+ source_url=reference.source_url or None,
1699
+ source_revision=reference.source_revision or None,
1700
+ source_revision_timestamp=reference.source_revision_timestamp or None,
1677
1701
  extra_fields_captured=captured,
1678
1702
  supplementary_files=[
1679
1703
  CacheSupplementaryFile.model_validate({
@@ -2202,6 +2226,9 @@ class ReferenceFetcher:
2202
2226
  local_pdf_path=frontmatter.get("local_pdf_path"),
2203
2227
  full_text_access_type=frontmatter.get("full_text_access_type"),
2204
2228
  full_text_source_item_id=frontmatter.get("full_text_source_item_id"),
2229
+ source_url=frontmatter.get("source_url"),
2230
+ source_revision=frontmatter.get("source_revision"),
2231
+ source_revision_timestamp=frontmatter.get("source_revision_timestamp"),
2205
2232
  is_preprint=frontmatter.get("is_preprint"),
2206
2233
  peer_review_status=frontmatter.get("peer_review_status"),
2207
2234
  full_text_attempted=bool(frontmatter.get("full_text_attempted", False)),
@@ -1,7 +1,8 @@
1
1
  """Reference source plugins.
2
2
 
3
3
  This package provides pluggable reference sources for fetching content
4
- from various origins (PubMed, Crossref, local files, URLs, ClinicalTrials.gov).
4
+ from various origins (PubMed, Crossref, local files, URLs, ClinicalTrials.gov,
5
+ Wikipedia).
5
6
 
6
7
  Custom sources can be defined via YAML configuration using JSONAPISource.
7
8
 
@@ -33,6 +34,7 @@ from linkml_reference_validator.etl.sources.entrez import (
33
34
  BioSampleSource,
34
35
  )
35
36
  from linkml_reference_validator.etl.sources.clinicaltrials import ClinicalTrialsSource
37
+ from linkml_reference_validator.etl.sources.wikipedia import WikipediaSource
36
38
 
37
39
  # Import JSON API source for programmatic use
38
40
  from linkml_reference_validator.etl.sources.json_api import (
@@ -58,6 +60,7 @@ __all__ = [
58
60
  "BioProjectSource",
59
61
  "BioSampleSource",
60
62
  "ClinicalTrialsSource",
63
+ "WikipediaSource",
61
64
  "JSONAPISource",
62
65
  "register_json_api_source",
63
66
  "load_custom_sources",
@@ -138,6 +138,48 @@ class ReferenceSourceRegistry:
138
138
  logger.debug(f"Registered source: {source_class.prefix()}")
139
139
  return source_class
140
140
 
141
+ @classmethod
142
+ def register_override(cls, source_class: type[ReferenceSource]) -> type[ReferenceSource]:
143
+ """Register a source that takes precedence over one already registered for its prefix.
144
+
145
+ The source is placed just ahead of the first registered source with the
146
+ same prefix (compared case-insensitively), and nowhere earlier, so any
147
+ bare-ID patterns it carries cannot displace the sources ahead of that
148
+ one. With no source for its prefix it is appended, as by ``register``.
149
+ This is how a project's own source definition replaces a built-in one.
150
+
151
+ Args:
152
+ source_class: The source class to register
153
+
154
+ Returns:
155
+ The source class
156
+
157
+ Examples:
158
+ >>> from linkml_reference_validator.etl.sources.base import (
159
+ ... ReferenceSource, ReferenceSourceRegistry
160
+ ... )
161
+ >>> saved = ReferenceSourceRegistry.list_sources()
162
+ >>> class OwnPMID(ReferenceSource):
163
+ ... @classmethod
164
+ ... def prefix(cls) -> str:
165
+ ... return "pmid"
166
+ ... def fetch(self, identifier, config):
167
+ ... return None
168
+ >>> _ = ReferenceSourceRegistry.register_override(OwnPMID)
169
+ >>> ReferenceSourceRegistry.get_source("PMID:1") is OwnPMID
170
+ True
171
+ >>> ReferenceSourceRegistry._sources = saved
172
+ """
173
+ if source_class in cls._sources:
174
+ return source_class
175
+ prefix = source_class.prefix().lower()
176
+ for index, existing in enumerate(cls._sources):
177
+ if existing.prefix().lower() == prefix:
178
+ cls._sources.insert(index, source_class)
179
+ logger.info(f"Source {source_class.prefix()} overrides the built-in source")
180
+ return source_class
181
+ return cls.register(source_class)
182
+
141
183
  @classmethod
142
184
  def get_source(cls, reference_id: str) -> Optional[type[ReferenceSource]]:
143
185
  """Find a source that can handle the given reference ID.
@@ -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
 
@@ -368,5 +368,7 @@ def register_json_api_source(source_config: JSONAPISourceConfig) -> type[Referen
368
368
  DynamicJSONAPISource.__name__ = class_name
369
369
  DynamicJSONAPISource.__qualname__ = class_name
370
370
 
371
- ReferenceSourceRegistry.register(DynamicJSONAPISource)
371
+ # A project's own definition of a prefix the validator also ships (such as
372
+ # WIKIPEDIA) is what the project asked for, so it goes ahead of the built-in.
373
+ ReferenceSourceRegistry.register_override(DynamicJSONAPISource)
372
374
  return DynamicJSONAPISource
@@ -203,6 +203,10 @@ class PMIDSource(ReferenceSource):
203
203
  # A failed refresh must not overwrite useful cached text with just
204
204
  # summary metadata. None also enables ReferenceFetcher's stale fallback.
205
205
  return None
206
+ if not title.strip() and article_xml:
207
+ # A whole-book record (an AHRQ evidence report, say) has an empty
208
+ # summary Title; its title is the BookDocument's BookTitle.
209
+ title = self._parse_book_title(article_xml) or ""
206
210
  abstract = self._parse_abstract(article_xml) if article_xml else None
207
211
  keywords = self._parse_mesh_terms(article_xml) if article_xml else None
208
212
  publication_types = (
@@ -487,6 +491,44 @@ class PMIDSource(ReferenceSource):
487
491
  # for str.
488
492
  return BeautifulSoup(xml_content, "xml")
489
493
 
494
+ @staticmethod
495
+ def _parse_book_title(soup: BeautifulSoup) -> Optional[str]:
496
+ """Return the title of a Bookshelf record from its PubMed XML.
497
+
498
+ PubMed's summary leaves ``Title`` empty for a record that is a whole
499
+ book rather than a chapter. The article XML still names it: a chapter
500
+ by its ``ArticleTitle``, a whole book by ``Book/BookTitle``.
501
+
502
+ Args:
503
+ soup: Parsed PubMed article XML
504
+
505
+ Returns:
506
+ The record's title, or None if this is not a Bookshelf record
507
+
508
+ Examples:
509
+ >>> from bs4 import BeautifulSoup
510
+ >>> xml = '''<PubmedBookArticle><BookDocument>
511
+ ... <Book><BookTitle book="cer86">Treatment for Restless Legs Syndrome</BookTitle></Book>
512
+ ... </BookDocument></PubmedBookArticle>'''
513
+ >>> PMIDSource._parse_book_title(BeautifulSoup(xml, "xml"))
514
+ 'Treatment for Restless Legs Syndrome'
515
+ >>> xml = '''<PubmedBookArticle><BookDocument>
516
+ ... <Book><BookTitle book="gene">GeneReviews</BookTitle></Book>
517
+ ... <ArticleTitle book="gene" part="men1">Multiple Endocrine Neoplasia Type 1</ArticleTitle>
518
+ ... </BookDocument></PubmedBookArticle>'''
519
+ >>> PMIDSource._parse_book_title(BeautifulSoup(xml, "xml"))
520
+ 'Multiple Endocrine Neoplasia Type 1'
521
+ >>> PMIDSource._parse_book_title(BeautifulSoup("<PubmedArticle/>", "xml")) is None
522
+ True
523
+ """
524
+ document = soup.find("BookDocument")
525
+ if document is None:
526
+ return None
527
+ for element in (document.find("ArticleTitle"), document.find("BookTitle")):
528
+ if element is not None and element.get_text().strip():
529
+ return element.get_text().strip()
530
+ return None
531
+
490
532
  @staticmethod
491
533
  def _parse_bookshelf_chapter(soup: BeautifulSoup) -> Optional[tuple[str, str]]:
492
534
  """Return ``(NBK accession, "<book>/<part>")`` for a Bookshelf chapter.