ITADN

GOLD: folding an organism with two in_taxon edges would mint a taxon→taxon subclass_of GOLD never asserted

#833Openrealmarcin 创建于 10 天前
bug
R
realmarcincommented
Found reviewing #832. `_organism_collapse` builds `{organism: taxon}` by iterating `in_taxon` rows, last-write-wins. `_write_edges` then re-points every edge of a folded organism at that taxon. If an organism ever carried **two** `in_taxon` edges, the first would set the fold target and the second would be rewritten from ``` gold:O in_taxon NCBITaxon:T2 ``` to ``` NCBITaxon:T1 subclass_of NCBITaxon:T2 ``` — a **taxonomic assertion GOLD never made, injected straight into the graph's taxonomy backbone**, where it is indistinguishable from the 925,219 real hierarchy edges. ## Current exposure: zero Measured on `data/raw/gold/GOLD_edges.tsv`: 0 organisms have more than one `in_taxon` edge. So this cannot fire today. ## Why file it anyway The trigger is a change in someone else's export, and the symptom is silent. Nothing downstream would flag `NCBITaxon:X subclass_of NCBITaxon:Y` as suspicious — that is exactly the shape the taxonomy is made of. The blast radius is the backbone every other source hangs off. ## Fix Only fold an organism with exactly one `in_taxon` edge, and report the count skipped for that reason. That converts a latent corruption into a no-op plus a log line: the multi-taxon organism keeps its node, which is the honest outcome anyway, since an organism claimed by two taxa is precisely the case where the organism layer carries information the taxon does not.
0 条评论