Skip to content

mapping_file_utils.load_metpo_mappings reads non-existent 'biolink equivalent' column from METPO sheet #568

Description

@turbomam

kg_microbe/utils/mapping_file_utils.py:load_metpo_mappings (around L270, L315) reads:

biolink_equivalent = row.get("biolink equivalent", "").strip()

and uses tree-traversal logic to find the closest ancestor that has a biolink_equivalent value, then maps that to a Biolink predicate via range_to_predicate.

The METPO classes-tab template (Google Sheet 1_Lr-9_5QHi8QLvRyTZFSciUhzGKD4DbUObyTpJ16_RU, exported to berkeleybop/metpo:src/templates/metpo_sheet.tsv) does not have a column called biolink equivalent. The Biolink-mapping columns that exist are:

  • biolink close match (col 9, ROBOT directive AI skos:closeMatch)
  • biolink broad match (col 24, added today; ROBOT directive AI skos:broadMatch)

Result: biolink_equivalent is the empty string for every row, the tree-traversal never finds a non-empty parent value, and downstream predicate selection silently falls back to the default ("has phenotype") and to the subject_label/notes heuristics in _resolve_biolink_predicate. The METPO sheet's SKOS mappings are not consumed at all.

Suggested fix: read from biolink close match (and optionally biolink broad match) instead of biolink equivalent. METPO maintainers use SKOS predicates deliberately; this is the canonical signal, not a missing parallel column.

Discovered while investigating berkeleybop/metpo#423.

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions