Skip to content

SIMSBIOHUB-1059: Store Taxonomic Hierarchy#505

Open
dylanrogowsky-oxd wants to merge 8 commits into
devfrom
SIMSBIOHUB-1059
Open

SIMSBIOHUB-1059: Store Taxonomic Hierarchy#505
dylanrogowsky-oxd wants to merge 8 commits into
devfrom
SIMSBIOHUB-1059

Conversation

@dylanrogowsky-oxd

@dylanrogowsky-oxd dylanrogowsky-oxd commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Links to Jira Tickets

Description of Changes

  • Adds parent_itis_tsn and parent_taxon_id (self-referencing FK) to taxon, with an index on each.
  • Migration backfills existing rows: parent_itis_tsn from the stored ITIS payload, parent_taxon_id by matching the parent's itis_tsn.
  • Derives parent-child links from the ITIS Solr hierarchyTSN lineage instead of the flat parentTSN (a TSN's parent is the previous TSN in the ordered lineage).
  • Uncached TSNs now fetch their full ITIS hierarchy and insert-or-reuse every taxon in the lineage, storing parent links for each.
  • Submission ingestion ensures missing taxa and their hierarchy exist before resolving taxon properties, so a valid-but-uncached TSN no longer fails ingestion with UNRESOLVED_TAXON.
  • Taxon search filters (ChildOf/ParentOf/AscendsFrom/DescendsFrom) now walk the indexed parent_taxon_id column instead of parsing parentTSN out of itis_data.

Testing Notes

  • Run the migration and confirm taxon has parent_itis_tsn/parent_taxon_id plus the two indexes, and that existing rows are backfilled.
  • Call GET /api/taxonomy/taxon?tsn=<tsn> for a taxon whose ancestors aren't cached; the full lineage should be stored with parent links set.
  • Import a submission referencing a TSN that isn't cached locally — it should resolve and store the taxon property instead of failing ingestion.
  • Check taxon child/parent/ancestor/descendant filtering in search still returns the expected results.

@dylanrogowsky-oxd dylanrogowsky-oxd added the Not Ready For Review Addressing feedback and/or refactoring label Jul 7, 2026
@dylanrogowsky-oxd dylanrogowsky-oxd added Ready For Review PR is ready for review and removed Not Ready For Review Addressing feedback and/or refactoring labels Jul 9, 2026

@mauberti-bc mauberti-bc left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice using submission_upload_staging_taxon_candidate!

@mauberti-bc mauberti-bc marked this pull request as ready for review July 9, 2026 23:47
@dylanrogowsky-oxd dylanrogowsky-oxd added Not Ready For Review Addressing feedback and/or refactoring and removed Ready For Review PR is ready for review labels Jul 9, 2026
@dylanrogowsky-oxd dylanrogowsky-oxd removed the Not Ready For Review Addressing feedback and/or refactoring label Jul 10, 2026
@dylanrogowsky-oxd dylanrogowsky-oxd added the Ready For Review PR is ready for review label Jul 10, 2026
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ready For Review PR is ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants