linkml-reference-validator 0.5.0__tar.gz → 0.5.2rc1__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 (273) hide show
  1. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/PKG-INFO +17 -1
  2. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/README.md +16 -0
  3. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/docs/concepts/content-types.md +1 -0
  4. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/docs/how-to/add-reference-source.md +4 -0
  5. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/docs/how-to/validate-urls.md +1 -0
  6. linkml_reference_validator-0.5.2rc1/docs/how-to/validate-wikipedia.md +118 -0
  7. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/docs/reference/cache-format.md +2 -0
  8. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/mkdocs.yml +1 -0
  9. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/src/linkml_reference_validator/cache.py +3 -0
  10. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/src/linkml_reference_validator/etl/extract/xml.py +66 -0
  11. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/src/linkml_reference_validator/etl/reference_fetcher.py +29 -2
  12. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/src/linkml_reference_validator/etl/sources/__init__.py +4 -1
  13. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/src/linkml_reference_validator/etl/sources/base.py +42 -0
  14. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/src/linkml_reference_validator/etl/sources/doi.py +31 -1
  15. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/src/linkml_reference_validator/etl/sources/json_api.py +3 -1
  16. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/src/linkml_reference_validator/etl/sources/pmid.py +136 -1
  17. linkml_reference_validator-0.5.2rc1/src/linkml_reference_validator/etl/sources/wikipedia.py +231 -0
  18. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/src/linkml_reference_validator/models.py +6 -0
  19. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/src/linkml_reference_validator/validation/supporting_text_validator.py +10 -3
  20. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_cache_validation.py +6 -0
  21. linkml_reference_validator-0.5.2rc1/tests/test_inline_abstract_headings.py +127 -0
  22. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_pmid_network.py +26 -0
  23. linkml_reference_validator-0.5.2rc1/tests/test_welded_markers.py +184 -0
  24. linkml_reference_validator-0.5.2rc1/tests/test_wikipedia_source.py +370 -0
  25. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/.claude/.mcp.json +0 -0
  26. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/.claude/settings.json +0 -0
  27. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/.copier-answers.yml +0 -0
  28. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/.devcontainer/devcontainer.json +0 -0
  29. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/.devcontainer/post_create.sh +0 -0
  30. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/.editorconfig +0 -0
  31. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/.github/actions/claude-code-action/action.yml +0 -0
  32. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/.github/actions/claude-issue-summarize-action/action.yml +0 -0
  33. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/.github/actions/claude-issue-triage-action/action.yml +0 -0
  34. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/.github/ai-controllers.json +0 -0
  35. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/.github/copilot-instructions.md +0 -0
  36. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/.github/copilot-setup-steps.yml +0 -0
  37. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/.github/dependabot.yml +0 -0
  38. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/.github/workflows/claude-code-review.yml +0 -0
  39. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/.github/workflows/claude-issue-summarize.yml +0 -0
  40. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/.github/workflows/claude-issue-triage.yml +0 -0
  41. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/.github/workflows/claude-ontology-review.yml +0 -0
  42. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/.github/workflows/claude.yml +0 -0
  43. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/.github/workflows/deploy-docs.yaml +0 -0
  44. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/.github/workflows/dragon-ai.yml +0 -0
  45. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/.github/workflows/main.yaml +0 -0
  46. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/.github/workflows/pypi-publish.yaml +0 -0
  47. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/.gitignore +0 -0
  48. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/.goosehints +0 -0
  49. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/.pre-commit-config.yaml +0 -0
  50. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/.yamllint.yaml +0 -0
  51. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/AGENTS.md +0 -0
  52. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/BUG_GEO_ACCESSION_TO_UID.md +0 -0
  53. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/BUG_ZENODO_DOI_AND_URL_HANDLING.md +0 -0
  54. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/CLAUDE.md +0 -0
  55. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/CLI-ISSUES.md +0 -0
  56. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/CODE_OF_CONDUCT.md +0 -0
  57. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/CONTRIBUTING.md +0 -0
  58. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/FEATURE_REQUEST_REPAIR.md +0 -0
  59. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/LICENSE +0 -0
  60. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/REVIEW2.md +0 -0
  61. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/REVIEW3.md +0 -0
  62. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/ai.just +0 -0
  63. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/benchmarks/repeated_quotes.py +0 -0
  64. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/copilot-instructions.md +0 -0
  65. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/docs/about.md +0 -0
  66. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/docs/assets/zotero-find-full-text.png +0 -0
  67. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/docs/concepts/editorial-conventions.md +0 -0
  68. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/docs/concepts/how-it-works.md +0 -0
  69. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/docs/elements/.gitkeep +0 -0
  70. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/docs/how-to/export-cache-to-zotero.md +0 -0
  71. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/docs/how-to/fetch-full-text-and-pdfs.md +0 -0
  72. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/docs/how-to/repair-validation-errors.md +0 -0
  73. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/docs/how-to/skip-unsupported-references.md +0 -0
  74. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/docs/how-to/use-local-files-and-urls.md +0 -0
  75. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/docs/how-to/validate-clinical-trials.md +0 -0
  76. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/docs/how-to/validate-dois.md +0 -0
  77. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/docs/how-to/validate-entrez.md +0 -0
  78. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/docs/how-to/validate-obo-files.md +0 -0
  79. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/docs/how-to/validate-titles.md +0 -0
  80. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/docs/index.md +0 -0
  81. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/docs/notebooks/01_getting_started.ipynb +0 -0
  82. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/docs/notebooks/02_advanced_usage.ipynb +0 -0
  83. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/docs/notebooks/03_python_api.ipynb +0 -0
  84. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/docs/notebooks/04_obo_validation.ipynb +0 -0
  85. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/docs/notebooks/05_geo_validation.ipynb +0 -0
  86. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/docs/quickstart.md +0 -0
  87. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/docs/reference/cli.md +0 -0
  88. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/docs/reference/splitting.md +0 -0
  89. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/docs/setup-guide.md +0 -0
  90. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/docs/superpowers/plans/2026-06-12-modular-pdf-fulltext-fetching.md +0 -0
  91. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/docs/superpowers/plans/2026-08-05-private-library-full-text.md +0 -0
  92. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/docs/superpowers/specs/2026-06-12-modular-pdf-fulltext-fetching-design.md +0 -0
  93. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/docs/superpowers/specs/2026-08-05-private-library-full-text-design.md +0 -0
  94. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/docs/templates-linkml/README.md +0 -0
  95. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/docs/todo.md +0 -0
  96. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/docs/troubleshooting.md +0 -0
  97. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/docs/tutorials/complete-workflow.md +0 -0
  98. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/examples/README.md +0 -0
  99. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/justfile +0 -0
  100. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/mypy.ini +0 -0
  101. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/notebooks/01_getting_started.ipynb +0 -0
  102. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/notebooks/02_advanced_usage.ipynb +0 -0
  103. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/notebooks/03_python_api.ipynb +0 -0
  104. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/notebooks/README.md +0 -0
  105. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/project/README.md +0 -0
  106. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/project.justfile +0 -0
  107. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/pyproject.toml +0 -0
  108. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/pytest.ini +0 -0
  109. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/skills/linkml-reference-validator/SKILL.md +0 -0
  110. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/skills/linkml-reference-validator/references/configuration.md +0 -0
  111. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/skills/linkml-reference-validator/references/guardrails.md +0 -0
  112. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/src/linkml_reference_validator/__init__.py +0 -0
  113. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/src/linkml_reference_validator/_version.py +0 -0
  114. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/src/linkml_reference_validator/cli/__init__.py +0 -0
  115. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/src/linkml_reference_validator/cli/cache.py +0 -0
  116. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/src/linkml_reference_validator/cli/lookup.py +0 -0
  117. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/src/linkml_reference_validator/cli/repair.py +0 -0
  118. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/src/linkml_reference_validator/cli/shared.py +0 -0
  119. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/src/linkml_reference_validator/cli/validate.py +0 -0
  120. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/src/linkml_reference_validator/etl/__init__.py +0 -0
  121. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/src/linkml_reference_validator/etl/acquire.py +0 -0
  122. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/src/linkml_reference_validator/etl/csl_export.py +0 -0
  123. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/src/linkml_reference_validator/etl/extract/__init__.py +0 -0
  124. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/src/linkml_reference_validator/etl/extract/base.py +0 -0
  125. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/src/linkml_reference_validator/etl/extract/drawio.py +0 -0
  126. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/src/linkml_reference_validator/etl/extract/html.py +0 -0
  127. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/src/linkml_reference_validator/etl/extract/pdf.py +0 -0
  128. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/src/linkml_reference_validator/etl/extract/svg.py +0 -0
  129. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/src/linkml_reference_validator/etl/extract/svg_geometry.py +0 -0
  130. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/src/linkml_reference_validator/etl/extract/untrusted_xml.py +0 -0
  131. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/src/linkml_reference_validator/etl/fulltext/__init__.py +0 -0
  132. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/src/linkml_reference_validator/etl/fulltext/base.py +0 -0
  133. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/src/linkml_reference_validator/etl/fulltext/bioc.py +0 -0
  134. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/src/linkml_reference_validator/etl/fulltext/bookshelf.py +0 -0
  135. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/src/linkml_reference_validator/etl/fulltext/epmc.py +0 -0
  136. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/src/linkml_reference_validator/etl/fulltext/epmc_preprint.py +0 -0
  137. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/src/linkml_reference_validator/etl/fulltext/json_api.py +0 -0
  138. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/src/linkml_reference_validator/etl/fulltext/loader.py +0 -0
  139. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/src/linkml_reference_validator/etl/fulltext/openalex.py +0 -0
  140. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/src/linkml_reference_validator/etl/fulltext/pmc.py +0 -0
  141. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/src/linkml_reference_validator/etl/fulltext/unpaywall.py +0 -0
  142. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/src/linkml_reference_validator/etl/fulltext/zotero.py +0 -0
  143. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/src/linkml_reference_validator/etl/identifiers.py +0 -0
  144. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/src/linkml_reference_validator/etl/rules.py +0 -0
  145. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/src/linkml_reference_validator/etl/sources/clinicaltrials.py +0 -0
  146. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/src/linkml_reference_validator/etl/sources/entrez.py +0 -0
  147. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/src/linkml_reference_validator/etl/sources/file.py +0 -0
  148. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/src/linkml_reference_validator/etl/sources/loader.py +0 -0
  149. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/src/linkml_reference_validator/etl/sources/ppr.py +0 -0
  150. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/src/linkml_reference_validator/etl/sources/url.py +0 -0
  151. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/src/linkml_reference_validator/etl/sources/utils.py +0 -0
  152. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/src/linkml_reference_validator/etl/text_extractor.py +0 -0
  153. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/src/linkml_reference_validator/field_detection.py +0 -0
  154. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/src/linkml_reference_validator/matching.py +0 -0
  155. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/src/linkml_reference_validator/plugins/REVIEW.md +0 -0
  156. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/src/linkml_reference_validator/plugins/__init__.py +0 -0
  157. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/src/linkml_reference_validator/plugins/reference_validation_plugin.py +0 -0
  158. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/src/linkml_reference_validator/validation/__init__.py +0 -0
  159. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/src/linkml_reference_validator/validation/fuzzy_text_utils.py +0 -0
  160. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/src/linkml_reference_validator/validation/repairer.py +0 -0
  161. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/__init__.py +0 -0
  162. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/conftest.py +0 -0
  163. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/data/test_data_deep_nesting_invalid.yaml +0 -0
  164. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/data/test_data_deep_nesting_valid.yaml +0 -0
  165. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/data/test_data_invalid.yaml +0 -0
  166. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/data/test_data_valid.yaml +0 -0
  167. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/data/test_schema.yaml +0 -0
  168. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/data/test_schema_deep_nesting.yaml +0 -0
  169. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/fixtures/GEO_GSE12345.md +0 -0
  170. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/fixtures/PMC_TEST001.md +0 -0
  171. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/fixtures/PMC_TEST001.txt +0 -0
  172. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/fixtures/PMC_TEST002.md +0 -0
  173. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/fixtures/PMC_TEST002.txt +0 -0
  174. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/fixtures/PMID_TEST001.md +0 -0
  175. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/fixtures/PMID_TEST001.txt +0 -0
  176. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/fixtures/PMID_TEST002.md +0 -0
  177. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/fixtures/PMID_TEST002.txt +0 -0
  178. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/fixtures/PMID_TEST003.md +0 -0
  179. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/fixtures/PMID_TEST003.txt +0 -0
  180. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/fixtures/bookshelf/esummary_20301710.xml +0 -0
  181. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/fixtures/bookshelf/gene_NBK1116/men1.nxml +0 -0
  182. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/fixtures/bookshelf/pubmed_20301710.xml +0 -0
  183. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/fixtures/clinicaltrials_NCT00000001.md +0 -0
  184. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/fixtures/fulltext_html/README.md +0 -0
  185. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/fixtures/fulltext_html/dspace-32894695.html +0 -0
  186. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/fixtures/fulltext_html/iris-19049553.html +0 -0
  187. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/fixtures/fulltext_html/plos-0000308.html +0 -0
  188. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/fixtures/jats/PMC5593426.xml +0 -0
  189. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/fixtures/jats/README.md +0 -0
  190. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/fixtures/sample.obo +0 -0
  191. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_absent_abstract_recovery.py +0 -0
  192. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_acquire.py +0 -0
  193. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_bookshelf_provider.py +0 -0
  194. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_bot_challenge.py +0 -0
  195. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_cache_author_recovery.py +0 -0
  196. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_cache_filename_collisions.py +0 -0
  197. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_cache_read_robustness.py +0 -0
  198. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_cli.py +0 -0
  199. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_cli_cache_enrich.py +0 -0
  200. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_cli_cache_export.py +0 -0
  201. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_cli_cache_reference.py +0 -0
  202. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_cli_lookup.py +0 -0
  203. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_cli_repair.py +0 -0
  204. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_clinicaltrials_cache.py +0 -0
  205. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_clinicaltrials_integration.py +0 -0
  206. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_deep_nesting.py +0 -0
  207. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_doi_preprint.py +0 -0
  208. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_doi_url_encoding.py +0 -0
  209. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_drawio.py +0 -0
  210. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_e2e_integration.py +0 -0
  211. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_empty_snippets.py +0 -0
  212. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_epmc_preprint_provider.py +0 -0
  213. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_extractor_fidelity.py +0 -0
  214. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_extractors.py +0 -0
  215. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_field_detection.py +0 -0
  216. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_field_detection_qualifiers.py +0 -0
  217. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_file_reference_cache.py +0 -0
  218. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_frontmatter_and_doi_case.py +0 -0
  219. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_fulltext_loader.py +0 -0
  220. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_fulltext_providers.py +0 -0
  221. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_fuzzy_suggestions.py +0 -0
  222. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_geo_integration.py +0 -0
  223. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_greek_variants.py +0 -0
  224. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_html_fulltext_acceptance.py +0 -0
  225. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_html_scope_text.py +0 -0
  226. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_identifiers.py +0 -0
  227. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_jats_tables.py +0 -0
  228. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_json_api_source.py +0 -0
  229. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_ligature_normalization.py +0 -0
  230. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_long_cache_filenames.py +0 -0
  231. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_meaning_changes.py +0 -0
  232. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_meaning_symbols.py +0 -0
  233. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_models.py +0 -0
  234. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_multivalued_reference.py +0 -0
  235. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_no_cache_downgrade.py +0 -0
  236. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_normalized_content_cache.py +0 -0
  237. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_open_access_policy.py +0 -0
  238. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_optional_linkml_dependency.py +0 -0
  239. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_pdf_url_title.py +0 -0
  240. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_plugin_integration.py +0 -0
  241. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_plugin_value_shapes.py +0 -0
  242. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_pmc_fulltext.py +0 -0
  243. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_ppr_source.py +0 -0
  244. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_publisher_typography.py +0 -0
  245. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_real_validation.py +0 -0
  246. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_reference_fetcher.py +0 -0
  247. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_repair.py +0 -0
  248. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_repair_data_output.py +0 -0
  249. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_repair_thresholds.py +0 -0
  250. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_rules.py +0 -0
  251. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_serve_stale_html_optin.py +0 -0
  252. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_source_network_errors.py +0 -0
  253. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_source_utils.py +0 -0
  254. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_sources.py +0 -0
  255. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_split_supporting_text.py +0 -0
  256. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_supporting_text_validator.py +0 -0
  257. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_svg_edges.py +0 -0
  258. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_svg_extractor.py +0 -0
  259. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_text_extractor.py +0 -0
  260. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_title_only_shapes.py +0 -0
  261. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_title_validation.py +0 -0
  262. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_trust_cached_entries.py +0 -0
  263. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_unknown_slot_traversal.py +0 -0
  264. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_url_fragment_cache.py +0 -0
  265. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_url_html_sanitize.py +0 -0
  266. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_url_html_to_text.py +0 -0
  267. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_url_source_cache_version.py +0 -0
  268. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_validation_config.py +0 -0
  269. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_validation_counts.py +0 -0
  270. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_word_boundaries.py +0 -0
  271. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_xml_extractor_text.py +0 -0
  272. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/tests/test_zotero_provider.py +0 -0
  273. {linkml_reference_validator-0.5.0 → linkml_reference_validator-0.5.2rc1}/uv.lock +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: linkml_reference_validator
3
- Version: 0.5.0
3
+ Version: 0.5.2rc1
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
 
@@ -119,6 +119,53 @@ BLOCK_ELEMENTS = frozenset(
119
119
  )
120
120
 
121
121
 
122
+ #: Dashes that can join the numbers of a citation range ("1-3", "1–3").
123
+ _DASHES = "-\u2010\u2011\u2012\u2013\u2014\u2015\u2212"
124
+
125
+
126
+ def _is_citation_marker(tag: Tag) -> bool:
127
+ """Whether ``tag`` is a bibliographic citation marker.
128
+
129
+ A JATS ``<xref ref-type="bibr">``, or a ``<sup>`` holding only such xrefs
130
+ and the commas and dashes between them. Inline markup is otherwise kept
131
+ contiguous (``H<sub>2</sub>O``), but a citation glued to the word before it
132
+ (``FOXL2<sup>8</sup>``) reads as another word, and one after a full stop
133
+ (``PGE2.<sup>41</sup>``) as a decimal number.
134
+
135
+ Examples:
136
+ >>> soup = BeautifulSoup('<p>A<sup><xref ref-type="bibr">8</xref></sup>'
137
+ ... '10<sup>6</sup></p>', "xml")
138
+ >>> [_is_citation_marker(sup) for sup in soup.find_all("sup")]
139
+ [True, False]
140
+ """
141
+ if tag.name == "xref":
142
+ return tag.get("ref-type") == "bibr"
143
+ if tag.name != "sup":
144
+ return False
145
+ xrefs = tag.find_all("xref")
146
+ if not xrefs or any(xref.get("ref-type") != "bibr" for xref in xrefs):
147
+ return False
148
+ loose = "".join(
149
+ str(child) for child in tag.children if type(child) in (NavigableString, CData)
150
+ )
151
+ return re.fullmatch(rf"[\s,;{re.escape(_DASHES)}]*", loose) is not None
152
+
153
+
154
+ def _welded_to_next_word(tag: Tag) -> bool:
155
+ """Whether the text right after ``tag`` starts with a letter, with no space.
156
+
157
+ That is what makes a bold lead-in a welded label (``R 2.6</bold>We``)
158
+ rather than part of a word (``IL</bold>-6``) or already spaced.
159
+
160
+ Examples:
161
+ >>> soup = BeautifulSoup("<x><p><bold>R 2.6</bold>We</p><p><bold>IL</bold>-6</p></x>", "xml")
162
+ >>> [_welded_to_next_word(b) for b in soup.find_all("bold")]
163
+ [True, False]
164
+ """
165
+ following = tag.next_sibling
166
+ return isinstance(following, NavigableString) and str(following)[:1].isalpha()
167
+
168
+
122
169
  def _block_text(node: Tag) -> str:
123
170
  """Keep inline text contiguous, separating blocks and excluding nested tables.
124
171
 
@@ -137,8 +184,27 @@ def _block_text(node: Tag) -> str:
137
184
  parts.append(str(child))
138
185
  elif isinstance(child, Tag) and child.name not in {"table", "table-wrap"}:
139
186
  value = walk(child)
187
+ lead_in = (
188
+ tag.name == "p"
189
+ and child.name == "bold"
190
+ and not "".join(parts).strip()
191
+ and _welded_to_next_word(child)
192
+ )
140
193
  if child.name in BLOCK_ELEMENTS:
141
194
  value = " " + value + " "
195
+ elif _is_citation_marker(child):
196
+ # No space before a dash that follows: "[1</xref>-3]" is
197
+ # a range, and " -3" would read as a minus sign.
198
+ following = child.next_sibling
199
+ dash_next = (
200
+ isinstance(following, NavigableString)
201
+ and str(following)[:1] in _DASHES
202
+ )
203
+ value = " " + value + ("" if dash_next else " ")
204
+ elif lead_in:
205
+ # A paragraph's bold lead-in label ("<bold>R 2.6</bold>We
206
+ # recommend") is not part of the sentence after it.
207
+ value = value + " "
142
208
  parts.append(value)
143
209
  return "".join(parts)
144
210
 
@@ -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.
@@ -12,6 +12,7 @@ Examples:
12
12
  """
13
13
 
14
14
  import logging
15
+ import re
15
16
  import time
16
17
  from typing import Optional
17
18
 
@@ -33,6 +34,16 @@ from linkml_reference_validator.etl.sources.utils import (
33
34
  logger = logging.getLogger(__name__)
34
35
 
35
36
 
37
+ #: JATS elements that end a run of text in a Crossref abstract. Their local
38
+ #: names, so ``jats:p`` and a bare ``p`` both count.
39
+ _JATS_ABSTRACT_BLOCKS = frozenset(
40
+ {
41
+ "title", "p", "sec", "list", "list-item", "label", "caption", "def-item",
42
+ "disp-quote", "div", "br",
43
+ }
44
+ )
45
+
46
+
36
47
  @ReferenceSourceRegistry.register
37
48
  class DOISource(ReferenceSource):
38
49
  """Fetch references from Crossref using DOI, with DataCite fallback.
@@ -515,6 +526,15 @@ class DOISource(ReferenceSource):
515
526
  def _clean_abstract(self, abstract: str) -> str:
516
527
  """Clean JATS/XML markup from abstract text.
517
528
 
529
+ Block elements (titles, paragraphs, sections, list items, and HTML
530
+ ``div`` and ``br``) become paragraphs separated by a blank line.
531
+ Crossref nests a structured abstract's sections as ``<jats:title>`` and
532
+ ``<jats:p>`` with no text between them, so stripping the tags alone
533
+ welded each heading onto the next sentence ("AbstractDisease
534
+ overviewAcute myeloid..."), and a quote beginning at that sentence
535
+ failed whole-word matching. Whitespace inside a paragraph is
536
+ collapsed; inline markup stays contiguous.
537
+
518
538
  Args:
519
539
  abstract: Abstract text potentially containing JATS markup
520
540
 
@@ -525,8 +545,18 @@ class DOISource(ReferenceSource):
525
545
  >>> source = DOISource()
526
546
  >>> source._clean_abstract("<jats:p>Test abstract.</jats:p>")
527
547
  'Test abstract.'
548
+ >>> source._clean_abstract(
549
+ ... "<jats:title>Abstract</jats:title><jats:sec><jats:title>Aim"
550
+ ... "</jats:title><jats:p>To test <jats:italic>it</jats:italic>.</jats:p>"
551
+ ... "</jats:sec>")
552
+ 'Abstract\\n\\nAim\\n\\nTo test it.'
528
553
  """
529
554
  if not abstract:
530
555
  return ""
531
556
  soup = BeautifulSoup(abstract, "html.parser")
532
- return soup.get_text().strip()
557
+ for tag in soup.find_all(True):
558
+ if tag.name.rpartition(":")[2] in _JATS_ABSTRACT_BLOCKS:
559
+ tag.insert_before("\n\n")
560
+ tag.insert_after("\n\n")
561
+ paragraphs = (" ".join(chunk.split()) for chunk in re.split(r"\n\s*\n", soup.get_text()))
562
+ return "\n\n".join(paragraph for paragraph in paragraphs if paragraph)
@@ -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