Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating mappings between ontology classes fails #282

Open
jvendetti opened this issue Sep 11, 2023 · 2 comments
Open

Creating mappings between ontology classes fails #282

jvendetti opened this issue Sep 11, 2023 · 2 comments

Comments

@jvendetti
Copy link
Member

Steps to reproduce:

  1. Navigate to the Classes tab for any ontology
  2. Select any class in the class tree
  3. Select the Class Mappings tab on the right-hand side
  4. Click the Create mapping button
  5. Fill in the resulting dialog form and click the Create Mapping button

Dialog displays an error message:

Screen Shot 2023-09-11 at 4 16 43 PM

REST logs

Show an HTTP 400 response:

vendetti [11/Sep/2023:22:46:26 +0000] "POST /mappings HTTP/1.1" 400 101 0.3748

Rails console

Shows the following error in a local dev environment:

Started POST "/mappings" for 127.0.0.1 at 2023-09-11 16:02:34 -0700
Processing by MappingsController#create as */*
  Parameters: {"map_from_bioportal_ontology_id"=>"JVTESTONT1", "map_to_bioportal_ontology_id"=>"JVTESTONT3", "map_from_bioportal_full_id"=>"http://www.co-ode.org/ontologies/pizza/pizza.owl#VegetarianPizza", "map_to_bioportal_full_id"=>"http://www.co-ode.org/ontologies/pizza/pizza.owl#VegetarianPizza", "mapping_comment"=>"Testing create new mapping dialog", "mapping_relation"=>"http://www.w3.org/2004/02/skos/core#exactMatch", "mapping_bidirectional"=>"false"}
Completed 500 Internal Server Error in 455582ms (Allocations: 678862)


  
Exception (["Ontology with ID `https://data.bioontology.org/ontologies/JVTESTONT3` not found"]):
  
app/controllers/mappings_controller.rb:137:in `create'
@syphax-bouazzouni
Copy link
Contributor

syphax-bouazzouni commented Sep 12, 2023

Hi, I think this is an issue in the API, This line https://github.com/ncbo/ontologies_api/blob/master/controllers/mappings_controller.rb#L110

The id does not start with http://, so it calls the function ontology_uri_from_acronym which does not work in this case because the input is not an acronym but a URI id.

I think this PR ncbo/ontologies_api#102 addresses this issue, but it includes a lot of changes not related to this.

Hope it helps, bye

@jvendetti
Copy link
Member Author

Thanks @syphax-bouazzouni for the additional debugging

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

No branches or pull requests

2 participants