feat: grant disease_context_qualifier to pinned EntityToDisease/PhenotypicFeature edge classes - #120
Merged
Conversation
…typicFeature edge classes Biolink declares disease_context_qualifier only on the ChemicalEntityToDiseaseOrPhenotypicFeatureAssociation lineage, while FDA_regulatory_approvals lives only on the EntityToDisease / EntityToPhenotypicFeature classes DAKP pins via category_override -- so a contraindication edge could natively carry one slot or the other, never both. Add CLASS_FIELD_OVERRIDES (biolink.py): a class-scoped grant table in the DISABLED_EDGE_FIELDS / KNOWN_PENDING_EDGE_FIELDS policy style. prune_to_class keeps granted slots on rows resolved to a granted class instead of nulling and rescuing them, and _validation_record strips granted fields from its in-memory validation copy so the deliberate gap is not reported as extra_forbidden. A tripwire test asserts every granted field stays absent from its class, forcing removal of the stale grant when a biolink-model release widens the slot.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus 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
Aug 25, 2026
Cut 15.1.0 and bump the package version in pyproject.toml, uv.lock, and CITATION.cff. Minor: one feature and one fix since 15.0.0, no breaking changes. A class-scoped policy override (CLASS_FIELD_OVERRIDES) grants disease_context_qualifier to the EntityToDisease / EntityToPhenotypicFeature edge classes DAKP pins via category_override, so prune_to_class keeps the qualifier instead of nulling and rescuing it, with a tripwire test that fails the suite once an upstream Biolink widening makes the grant stale (#120). Also fixes number_of_cases being matched by STUDY_SIZE_PREFIX_PATTERN and coerced into study_size, destroying the edge field; a new STUDY_SIZE_EXEMPT_PATTERN leaves the exact Biolink slot alone (#119). Changelog: - Versioned the Unreleased section as 15.1.0, gave the #120 entry its PR link, and added a Fixed entry for the number_of_cases coercion fix. Docs: none needed here. #120 shipped with no docs changes and #119 is a coercion fix with no user-facing surface. Testing: - uv run pytest -q -> 1092 passed, 15 skipped (94% coverage) - uv run ruff check . && uv run ruff format --check . && uv run pyright -> clean / 0 errors - uv lock --check -> up to date - uv run mkdocs build --strict -> clean
SkyeAv
added a commit
to glusman-team/dakp
that referenced
this pull request
Aug 25, 2026
…, move FAERS count to number_of_cases - Bump tablassert[qc] floor to >=15.1.0. - Un-TODO the contraindication disease_context_qualifier: 15.1's CLASS_FIELD_OVERRIDES (SkyeAv/Tablassert#120) grants the slot to the pinned EntityToDisease/EntityToPhenotypicFeature classes, so the nullable Disease-guarded qualifier survives prune_to_class on the edge. - Migrate the FAERS case count annotation from the evidence_count alias to the literal Biolink slot number_of_cases: 15.1's STUDY_SIZE_EXEMPT_PATTERN (SkyeAv/Tablassert#119) stops the study-size classifier from renaming the column onto Study.study_size; the kgx_end_to_end tripwire fired as designed. legacy_tsv N_cases reads number_of_cases accordingly. - Regenerate tables/*.yaml from the generator; update RIG target consideration to note the grant pending upstream Biolink widening.
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.
Motivation
DAKP pins its contraindication/treats edges to
EntityToDiseaseAssociation/EntityToPhenotypicFeatureAssociationviastatement.category_override(#118), because only those classes declareFDA_regulatory_approvals. Biolink declaresdisease_context_qualifieronly on theChemicalEntityToDiseaseOrPhenotypicFeatureAssociationlineage — so one edge can natively carry one slot or the other, never both, andprune_to_classnulls the qualifier on the pinned rows (DAKP'sgraph.yamldocuments the gap: "Revisit if Biolink widens either slot").Change
New
CLASS_FIELD_OVERRIDEStable inbiolink.py, following theDISABLED_EDGE_FIELDS/KNOWN_PENDING_EDGE_FIELDSpolicy-table precedent:disease_context_qualifieris granted toEntityToDiseaseAssociationandEntityToPhenotypicFeatureAssociation, deliberately ahead of the pinned model.lib.prune_to_class: per-class acceptance now ORs the grant in, so granted rows keep the qualifier instead of nulling and rescuing it into the pruned column. The multivalued-wrap scan still keys on classes that declare the slot, so granted classes can't corrupt the wrap.biolink._validation_record: granted fields the record's own class doesn't declare are stripped from the in-memory validation copy (mirroring the existingRetrievalSource.idalias shim), so the deliberate gap is not reported asextra_forbidden. Emitted files are unchanged.Verification
prune_to_classkeeps the qualifier on granted rows and still prunes it on ungranted classes;validate_recordtolerates the grant on the granted class only; tripwire guards the grant against model releases.ruff check/ruff format --checkclean.