ols4 icon indicating copy to clipboard operation
ols4 copied to clipboard

Querying an ontology by entity type and IRI returns status 500 when provided IRI does not match provided entity type

Open SArndt-TIB opened this issue 1 year ago • 1 comments
trafficstars

Hi everyone,

one of our users reported unexpected behaviour for our ols3-based system. The same behaviour is visible on ols4-based systems, though. I will provide their original bug description in your template with exmples from our service and from the running OLS-instance from EBI. Thanks for looking into this and letting me know if anything can be done about it. Thanks, and all the best, Susanne

Describe the bug Querying an ontology by entities type (term, individual, property) and IRI returns status 500 when the provided IRI does not match the provided entity type.

To Reproduce The bug triggers in the following OLS3 scenarios:

  • Query the /ontologies/{ontology}/terms endpoint with the IRI parameter set to an IRI of a property or individual.
  • Query the /ontologies/{ontology}/individuals endpoint with the IRI parameter set to an IRI of a property or term.
  • Query the /ontologies/{ontology}/properties endpoint with the IRI parameter set to an IRI of a term or individual.

Example of querying a term using the /ontologies/{ontology}/properties endpoint (at TIB):
https://service.tib.eu/ts4tib/api/ontologies/abcd/properties?iri=http%3A%2F%2Frs.tdwg.org%2Fabcd%2Fterms%2FBotanicalGardenUnit

  • vs. correct entity type method (retrieves data): https://service.tib.eu/ts4tib/api/ontologies/abcd/terms?iri=http%3A%2F%2Frs.tdwg.org%2Fabcd%2Fterms%2FBotanicalGardenUnit
  • vs. incomplete term iri (404) https://service.tib.eu/ts4tib/api/ontologies/abcd/terms?iri=http%3A%2F%2Frs.tdwg.org%2Fabcd%2Fterms%2FBotanicalGardenUn

Example from EBI OLS4 endpoint: https://www.ebi.ac.uk/ols4/api/ontologies/bco/properties/http%253A%252F%252Fpurl.obolibrary.org%252Fobo%252FBCO_0000031

  • vs. correct entity type method (retrieves data): https://www.ebi.ac.uk/ols4/api/ontologies/bco/terms/http%253A%252F%252Fpurl.obolibrary.org%252Fobo%252FBCO_0000031
  • vs. incomplete term iri (500, differs from OLS3): https://www.ebi.ac.uk/ols4/api/ontologies/bco/properties/http%253A%252F%252Fpurl.obolibrary.org%252Fobo%252FBCO_0000

Expected behavior The server should respond with an empty page or status 404.

Additional context Used browser: Windows 10, Firefox 131.0.3

SArndt-TIB avatar Oct 23 '24 14:10 SArndt-TIB