Summary
The paths_to_root endpoint returns 500 Internal Server Error for SKOS concepts that have at least one parent (skos:broader). Every other class-hierarchy endpoint (/tree, /parents, /ancestors, /descendants) works for the same concept, and /paths_to_root works for OWL/OBO classes. A concept with no parents (a top concept) returns 200 [], so the crash is in the code path that walks parents.
Observed on stagedata.bioontology.org.
Steps to reproduce
Any SKOS concept that has a parent. Example — INJURYTYPES / "Sprain":
curl -H "Authorization: apikey token=$APIKEY" \
"https://stagedata.bioontology.org/ontologies/INJURYTYPES/classes/http%3A%2F%2Fwww.fairdatacollective.com%2Ftemplate-vocabulary%2FSprain/paths_to_root?include=prefLabel,hasChildren"
Returns:
HTTP/1.1 500 Internal Server Error
Content-Type: text/html;charset=utf-8
<h1>Internal Server Error</h1>
Scope
include=prefLabel,hasChildren, valid apikey, raw HTTP:
| Ontology |
Type |
Concept |
/paths_to_root |
| INJURYTYPES |
SKOS |
Sprain |
500 |
| PLOSTHES |
SKOS |
Atmosphere / Separation processes |
500 |
| I2SV |
SKOS |
Axiology |
500 |
| ISO639-1 |
SKOS |
iu (a top concept, no parents) |
200 [] |
| UBERON |
OWL |
(any deep class) |
200 |
| GO |
OBO |
general transcription… |
200 |
Endpoint matrix for one failing SKOS concept (INJURYTYPES / Sprain):
| Endpoint |
Result |
/tree |
200 (22 KB) |
/parents |
200 |
/ancestors |
200 |
/descendants |
200 |
/paths_to_root |
500 |
So the failure is specific to /paths_to_root on SKOS concepts that have parents.
?display=all on the same endpoint returns a clean 422 {"errors":["all not allowed in include parameter for this endpoint"]}, so the route and parameter handling are reached; the 500 happens when the endpoint computes the paths.
Relevant source: ontologies_linked_data lib/ontologies_linked_data/concerns/concepts/concept_tree.rb (paths_to_root) and models/class.rb (traverse_path_to_root).
Suggested next step
The server log / backtrace for one of these 500s would pin the exact line.
Summary
The
paths_to_rootendpoint returns500 Internal Server Errorfor SKOS concepts that have at least one parent (skos:broader). Every other class-hierarchy endpoint (/tree,/parents,/ancestors,/descendants) works for the same concept, and/paths_to_rootworks for OWL/OBO classes. A concept with no parents (a top concept) returns200 [], so the crash is in the code path that walks parents.Observed on
stagedata.bioontology.org.Steps to reproduce
Any SKOS concept that has a parent. Example — INJURYTYPES / "Sprain":
Returns:
Scope
include=prefLabel,hasChildren, valid apikey, raw HTTP:/paths_to_root[]Endpoint matrix for one failing SKOS concept (INJURYTYPES / Sprain):
/tree/parents/ancestors/descendants/paths_to_rootSo the failure is specific to
/paths_to_rooton SKOS concepts that have parents.?display=allon the same endpoint returns a clean422 {"errors":["all not allowed in include parameter for this endpoint"]}, so the route and parameter handling are reached; the 500 happens when the endpoint computes the paths.Relevant source:
ontologies_linked_datalib/ontologies_linked_data/concerns/concepts/concept_tree.rb(paths_to_root) andmodels/class.rb(traverse_path_to_root).Suggested next step
The server log / backtrace for one of these 500s would pin the exact line.