Let a community-level interaction name its participants (#312) - #525
Open
realmarcin wants to merge 1 commit into
Open
Let a community-level interaction name its participants (#312)#525realmarcin wants to merge 1 commit into
realmarcin wants to merge 1 commit into
Conversation
A COMMUNITY_LEVEL interaction was credited as connecting every member of the record, because EcologicalInteraction had no way to say which members it was about. In a record carrying both kinds of edge that credits a taxon in no pairwise edge via an unrelated community-level one: 407 of 522 taxa were credited solely that way. `participating_taxa` narrows it. Optional, and absent or empty means "every member" — so the corpus is bit-identical today: 55 findings before, 55 after, same breakdown across all four types. Nothing moves until a curator names participants, which is what makes it safe to land ahead of any curation. Three things came out of running it rather than reading it. Ids are not keys of taxonomy_by_term, so a participant named by CURIE credited *nobody* and disconnected the whole record. The name path returned the right count throughout, so a happy-path test would have shipped it. Fixing that by resolving names and ids together was worse, and nearly made the slot useless: curators copy the whole taxon_term block, so an entry normally carries both, and the id credited every member sharing it. In the worked example that is all 28 — one strain named, all 28 credited, no narrowing. It is precedence, not union: a name that matches wins, and the id is a fallback. Even then a CURIE is ambiguous where members share an id, which is exactly the strain-level SynCom shape the coarse credit hurts most. That is sound — an ambiguous reference cannot mean fewer members — but it means the slot silently does nothing there, so the guidance is on the slot and the behaviour is pinned rather than left to be rediscovered (#524). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Network integrity findingsWarnings only — a member with no interaction yet, or a participant matched by ontology id rather than by name, or one on a community-level interaction that resolves to no member. Reported, but does not fail the build. The full report is attached to the workflow run as an artifact. |
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
COMMUNITY_LEVELinteractions were credited as connecting every member of the record, becauseEcologicalInteractionhad no way to say which members a statement was about. In a record carrying both kinds of edge that credits a taxon in no pairwise edge via an unrelated community-level one — 407 of 522 taxa were credited solely that way.participating_taxa(optional, multivaluedTaxonDescriptor) narrows it, and the auditor's credit follows.It changes nothing today, by construction
Absent or empty means "every member". Measured before and after on the full corpus: 55 findings, identical breakdown (DISCONNECTED 19, UNKNOWN_TARGET 17, UNKNOWN_SOURCE 10, NAME_MISMATCH 9). Nothing moves until a curator names participants — which is what makes it safe to land ahead of curation, and is pinned by a test that walks the corpus rather than trusting the schema.
Three things came out of running it, not reading it
1. A CURIE-named participant credited nobody. Ids are not keys of
taxonomy_by_term, so an entry naming members byterm.idmatched nothing and disconnected the entire record — 28 of 28. The name path returned the right count at every step, so a happy-path test would have shipped this.2. Fixing that by resolving names and ids together was worse. Curators copy the whole
taxon_termblock, so a participant entry normally carriespreferred_termandterm.id. Unioning both meant the id credited every member sharing it: in the worked example, naming one strain credited all 28 and the slot did nothing at all. It is precedence, not union — a name that matches wins, and the id is only a fallback.Neither path was wrong alone. Only an entry carrying both was, which is the shape every real entry will have.
3. A CURIE is still ambiguous where members share an id —
GLBRC_Populus_Variovorax_SynCom28has 28 taxa under oneNCBITaxon:34072. Crediting all of them is the only sound reading of an ambiguous reference, but it means the slot silently does nothing in exactly the strain-level SynComs whose coarse credit motivated #312. Guidance is on the slot ("name bypreferred_term, not CURIE alone"), the behaviour is pinned, and the open question of whether the auditor should warn on an id-only entry resolving to many members is #524.Also
test_the_schema_still_cannot_name_participantsintest_community_level_connectivity_credit.pyasserted the slot's absence and said the credit should become precise in the same change. Flipped totest_the_schema_can_now_name_participants, and it records that the connectivity numbers there are unaffected — and that when records do start using the slot, the bound should be re-measured downward rather than widened.Checks
uv run pytest tests/— 2384 passed, 16 skippedjust validate-all,just validate-strict,just lint,just check-docs-current— exit 0Closes #312. Found #524.
🤖 Generated with Claude Code