Skip to content

Fix incorrect data.bioontology.org URL in 'ontology already exists' 409 error - #185

Merged
maboukerfa merged 4 commits into
masterfrom
fix/ontology-exists-error-url
Aug 27, 2026
Merged

maboukerfa merged 4 commits into
masterfrom
fix/ontology-exists-error-url

Conversation

@maboukerfa

@maboukerfa maboukerfa commented Jun 10, 2026 •

Copy link
Copy Markdown
Collaborator

Related issue: ontoportal-astro/project-management#45

Problem

Creating an ontology with an acronym that already exists returns a 409 whose message exposes the internal id prefix (http://data.bioontology.org/) instead of the portal's public URL:

{
  "errors": [
    "Ontology already exists, see http://data.bioontology.org/ontologies/AGROVOC\n        To add a new submission, POST to: /ontologies/AGROVOC/submission.\n        To modify the resource, use PATCH.\n"
  ],
  "status": 409
}

The http://data.bioontology.org/... URL is wrong for any non-BioPortal deployment (e.g. AgroPortal).

Fix

Run the id through LinkedData::Models::Base.replace_url_id_to_prefix(ont.id), which converts id_url_prefix → rest_url_prefix

maboukerfa added 3 commits May 7, 2026 14:50
The 409 error returned when creating an ontology with an existing acronym
interpolated ont.id directly, exposing the internal id_url_prefix
(http://data.bioontology.org/) instead of the portal's public URL.

Run the id through Base.replace_url_id_to_prefix so the message reports
the configured rest_url_prefix, matching normal serialized output.
Base automatically changed from development to master June 24, 2026 22:45
@maboukerfa
maboukerfa merged commit b488bea into master Aug 27, 2026
4 checks passed
@maboukerfa
maboukerfa deleted the fix/ontology-exists-error-url branch August 27, 2026 07:32
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