Skip to content

Split the BacDive transform into tested responsibility-focused modules #859

Description

@realmarcin

Priority: P3 — staged maintainability work after current correctness blockers.

Problem

kg_microbe/transform_utils/bacdive/bacdive.py is approximately 3,448 lines and combines API/input parsing, normalization, ontology resolution, domain-specific edge construction, writing, and orchestration. The size and mixed responsibilities make BacDive correctness fixes hard to isolate.

Proposed change

Split the implementation around stable responsibilities such as record parsing, strain/taxon normalization, ontology and mapping resolution, assay/trait modeling, KG emission, and orchestration.

Acceptance criteria

  • A short design note defines module boundaries and allowed dependencies before the mechanical split.
  • Parsing and normalization can be tested without network access or a full BacDive download.
  • Domain-specific emitters have focused fixture-based tests.
  • The existing public transform interface remains compatible or has a documented migration.
  • Golden/snapshot comparison shows no unintended node or edge changes.
  • The original module becomes a small orchestration/compatibility layer rather than a second implementation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    backloggedNot important as of now but will be revisited.enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions