Skip to content

Support OBO edit files: catalog-based imports + generic term_id - #8

Merged
ubyndr merged 1 commit into
mainfrom
support-obo-edit-files
Sep 30, 2026
Merged

ubyndr merged 1 commit into
mainfrom
support-obo-edit-files

Conversation

@ubyndr

@ubyndr ubyndr commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

Found while integrating this package into uberon (obophenotype/uberon#3778, obophenotype/uberon#3779).

  • robot diff/robot convert now accept an optional ODK-style catalog-v001.xml (passed by the caller), so imports resolve from locally-committed files instead of the network. Fixes two real problems: robot diff 404ing on one of uberon's import PURLs, and definition_refs() returning nothing for OBO edit files (it needs functional-syntax input, so the right file is now converted first, using the same catalog). Verified byte-identical output on a real CL PR when a catalog is supplied, and correct behavior against uberon's actual broken import.
  • agent_instructions.md: dropped the separate cell_id concept; everything now uses the single CURIE-form term_id already used elsewhere, including output paths (runs/{term_id}/...). Breaking for consumers: verdicts.json no longer has a cell_id field. Already updated in uberon's own workflow (Add CLARA review workflow (issue #3778) obophenotype/uberon#3779); cell-ontology's clara-review.yml would need the same one-line change before bumping to this commit.

No changes to parse.py; existing 39 tests pass unmodified.

Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com

Found while integrating this package into uberon (obophenotype/uberon
issue #3778, PR #3779).

- extract()/robot diff/robot convert now take an optional `catalog`
  (ODK-style catalog-v001.xml), passed through as --left-catalog/
  --right-catalog/--catalog. This is what makes both real fixes work:

  1. `robot diff` failed outright against a real uberon-edit.obo
     because one of its owl:imports PURLs currently 404s -- ROBOT
     resolves every import over the network by default. With the
     repo's own catalog (checked into git, mapping each import IRI to
     a locally-committed file), resolution is fully offline and immune
     to a moved PURL.
  2. definition_refs() silently returned nothing for OBO edit files
     (it only parses OWL functional-syntax AnnotationAssertion(...)
     lines; extract() fed it raw OBO text unconverted). Fixed by
     converting the right file to functional syntax first
     (robot convert -f ofn, with the obo:/oboInOwl: prefixes
     definition_refs() expects), using the same catalog.

  The caller (the GitHub Action) is expected to pass its own
  catalog-v001.xml; omitting it falls back to ROBOT's normal
  (network) import resolution, unchanged from before.

  Verified against real cell-ontology PR 3717: output is byte-
  identical to pre-change behavior (labels, axiom text, ref sets all
  match) when a catalog is supplied, since CL has its own
  catalog-v001.xml too. Also verified against uberon-edit.obo's actual
  broken import, both unmodified and with a real definition edit.

- agent_instructions.md dropped the separate underscore-form `cell_id`
  concept; everything downstream of the routing payload (including
  output paths, `runs/{term_id}/...`) now uses the single CURIE-form
  `term_id` already used elsewhere in the same payload. A colon is a
  valid POSIX filename character, so this needs no extra encoding.

  This changes verdicts.json's schema (drops the `cell_id` field).
  Consumers reading it need updating to match -- done for uberon's own
  clara-review.yml in PR #3779; cell-ontology's clara-review.yml still
  reads `cell_id` and would need the same change before bumping to
  this commit.

No changes to parse.py; existing 39 tests pass unmodified.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@ubyndr
ubyndr requested a review from dosumis September 29, 2026 22:04
ubyndr added a commit to obophenotype/uberon that referenced this pull request Sep 29, 2026
Cellular-Semantics/clara_workflow#8 drops the separate underscore-form
cell_id field from verdicts.json in favor of the single CURIE-form
term_id already used elsewhere in the routing payload. Updates the
summary-comment step here to match, so it doesn't KeyError once the
CLARA_WORKFLOW_REF pin is bumped to that commit (not done yet).

Signed-off-by: @ai4c-agent

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@ubyndr
ubyndr merged commit 232e9b4 into main Sep 30, 2026
@ubyndr
ubyndr deleted the support-obo-edit-files branch September 30, 2026 08:35
ubyndr added a commit to obophenotype/uberon that referenced this pull request Sep 30, 2026
Cellular-Semantics/clara_workflow#8 merged (232e9b4): adds catalog
support to the stage-1 extractor and drops the cell_id field (already
matched in the previous commit here).

- CLARA_WORKFLOW_REF bumped to the merge commit.
- Added --catalog src/ontology/catalog-v001.xml to the stage-1
  extractor invocation. This is the part that actually matters: without
  it, the extractor falls back to ROBOT's default network import
  resolution and hits the same 404 (one of uberon's import PURLs is
  currently broken) that motivated the catalog fix in the first place.
  The catalog lets ROBOT resolve every owl:imports from the files it
  already maps to locally-committed content, with no network call.
- Updated the header comment, which described the pre-fix limitations.

Signed-off-by: @ai4c-agent

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant