Add causal-graph structural-integrity audit + fix 2 orphan nodes#115
Merged
Conversation
LinkML/validate-strict check field types but not graph connectivity. New scripts/audit_causal_graphs.py flags two structural defects the schema can't: DANGLING_EDGE edge subject/object not a declared node_id ORPHAN_NODE declared node referenced by no edge Wired into `just qc` (and thus CI) alongside the other audits; exits non-zero on any defect. Unit-tested (tests/test_audit_causal_graphs.py: clean / orphan / dangling cases). Fixes the 2 orphan nodes the audit surfaced: - physiology/urease_activity.yaml: the trait node (urease_activity_trait) was disconnected; added urease_function -[manifests as / METPO:2007400]-> urease_activity_trait so the molecular function links to the observable trait. - morphology/capsule.yaml: capsular_polysaccharide was orphaned; added capsule_assembly -[produces / biolink:produces]-> capsular_polysaccharide. Both edges carry literature evidence; FIX_ORPHAN_NODE curation events appended. audit-graphs now reports 0 findings. validate-strict 0 errors; full qc passes; 90 tests pass. Pages regenerated. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
What
A diagnostic sweep of the corpus showed it's structurally clean (0 dangling edges, 0 edges missing evidence) except 2 orphan nodes — nodes declared in a causal graph that no edge references. Nothing currently catches this: LinkML/
validate-strictcheck field types, not graph connectivity.This adds a causal-graph structural-integrity audit and fixes the 2 it finds.
New audit (
scripts/audit_causal_graphs.py,just audit-graphs)Flags two defects the schema can't, exits non-zero on any:
subject/objectis not a declarednode_id(typo / deleted node)Wired into
just qc(and thus CI). Unit-tested (tests/test_audit_causal_graphs.py: clean / orphan / dangling).The 2 orphan fixes
urease_activity.yaml— the trait node itself was disconnected. Addedurease_function -[manifests as / METPO:2007400]-> urease_activity_traitso the molecular function links to the observable phenotype.capsule.yaml—capsular_polysaccharidewas orphaned. Addedcapsule_assembly -[produces / biolink:produces]-> capsular_polysaccharide.Both new edges carry literature evidence;
FIX_ORPHAN_NODEcuration events appended.Verification
just audit-graphs→ 0 findings.just validate-strict→ 477 files, 0 errors.just qc→ passes. 90 tests pass (+3 new).🤖 Generated with Claude Code