feat: carry DAKP prevention predicates ahead of pinned Biolink via PREDICATE_OVERRIDES - #193
Merged
Merged
Conversation
…EDICATE_OVERRIDES Adds a named predicate override (`biolink.PREDICATE_OVERRIDES`) so DAKP can author `prevents`, `applied_to_prevent`, and `contraindicated_in_the_prevention_of` today: three predicates the pinned biolink-model 4.4.4 (and upstream master) do not define, two of which DAKP's assertion pipeline already documents as deferred for exactly that reason. - `PREDICATE_OVERRIDES` unions into the model-derived `related to` slot hierarchy, so `Predicates` gains the three members and `statement.predicate` validates and emits ordinary `biolink:` CURIEs. - Drift tripwire asserts every member stays absent from installed slots; the moment Biolink adopts one, the suite fails and the stale name is removed. - `validate_kgx`'s pending score forgives `predicate: literal_error` / enum failures only for override members on the failing record; strict `valid` is unchanged and unlisted predicates still fail both scores. - Open-str classes (base `Association`, DAKP-pinned EntityToDisease / EntityToPhenotypicFeature) accept the predicates natively; constrained vocabularies (ChemicalEntityToBiologicalProcessAssociation Literal, GeneToDiseasePredicateEnum) count as deliberate pending gaps. - CHANGELOG entry and one-line note in docs/configuration/table.md; no DAKP fixture/config changes. Verified: 254 passed across test_biolink / test_models / test_realworld_configs / test_agent_assembly / test_agent_derive / test_study; 11 lib predicate tests; ruff clean; pyright 0 errors.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
SkyeAv
added a commit
that referenced
this pull request
Sep 18, 2026
Cut 19.1.0 and bump package version in pyproject.toml, uv.lock, and CITATION.cff. Minor: add the `tablassert quick-map` fullmap term-inspection command (#191) and carry the DAKP prevention predicate family ahead of the pinned Biolink model via PREDICATE_OVERRIDES (#193). The README PyPI downloads badge now serves from pepy instead of shields (#190, #192). Changelog: - Version the Unreleased section as 19.1.0, add the missing #191 entry under Added, add a Changed entry for #190/#192, and add the PR link to the existing #193 entry. Docs: none needed here; #191 and #193 shipped their own docs. Testing: - make check -> pass: 1649 passed, 52 skipped; Rust tests 156 passed, 1 ignored; lint, format, pyright, and clippy pass. - uv lock --check -> pass. - uv run mkdocs build --strict -> pass.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a named predicate override (
biolink.PREDICATE_OVERRIDES) so DAKP can authorprevents,applied_to_prevent, andcontraindicated_in_the_prevention_oftoday: three predicates the pinned biolink-model 4.4.4 (and upstream master) do not define, two of which DAKP's assertion pipeline already documents as deferred for exactly that reason.Predicate Override
src/tablassert/biolink.pygainsPREDICATE_OVERRIDESbesideCATEGORY_OVERRIDES;_predicate_values()unions it into the model-derivedrelated toslot hierarchy, soPredicatesgainsPREVENTS,APPLIED_TO_PREVENT, andCONTRAINDICATED_IN_THE_PREVENTION_OF.statement.predicatevalidates and emits the ordinarybiolink:CURIE, and the TYPE_CHECKING stub is extended for the new members.test_predicate_overrides_track_the_installed_modelasserts every member is still absent from the installed slot hierarchy; the moment Biolink adopts one, the suite fails and the stale name is removed, restoring fully model-derived vocabulary (same philosophy as theCATEGORY_OVERRIDES/CLASS_FIELD_OVERRIDEStripwires).Pending Validation Gap
validate_kgx's pending score (valid_excluding_pending) now forgivespredicate: literal_error/predicate: enumfailures only when the record's own predicate is an override member. Open-strclasses (baseAssociation, theEntityToDisease/EntityToPhenotypicFeatureclasses DAKP pins viacategory_override) accept the predicates natively and stay strictly valid; constrained vocabularies (e.g.ChemicalEntityToBiologicalProcessAssociation's exhaustiveLiteral, theGeneToDiseasePredicateEnumfamily) reject them and count as deliberate gaps, never malformed records. Strictvalidis unchanged.PREDICATE_OVERRIDESmembership plus the failing field, so a smuggled non-Biolink predicate under the identical error shape still fails both scores; covered by an explicit control edge.Docs
CHANGELOG.mdUnreleased entry; one-line note on thepredicaterow indocs/configuration/table.md.statement.predicatefield.Testing
uv run pytest tests/test_biolink.py tests/test_models.py tests/test_realworld_configs.py tests/test_agent_assembly.py tests/test_agent_derive.py tests/test_study.py -n 0 -q->254 passed, 17 skippeduv run pytest tests/test_lib.py -n 0 -q -k 'predicate or edge_category or demot'->11 passed, 246 deselecteduv run ruff check+uv run ruff format --checkon touched files -> cleanuv run pyright src/tablassert/biolink.py tests/test_biolink.py tests/test_models.py->0 errors, 0 warningsQuestions for the reviewer