ncbo / ontologies_api

Hypermedia API for NCBO's ontology-related projects
http://data.bioontology.org
Other
25 stars 10 forks source link

Add paging for the /ontologies/:ontology/classes/:cls/mappings endpoint #84

Open jvendetti opened 2 years ago

jvendetti commented 2 years ago

There are a lot of ontologies in BioPortal that have a set of classes at or near the root with identical preferred labels, e.g., "entity", "continuant", "occurant", etc. One example is the HTN ontology where the root class of "entity" has 676 class-level mappings to "entity" classes in other ontologies:

https://data.bioontology.org/ontologies/HTN/classes/http%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FBFO_0000001/mappings?display_links=false&display_context=false

Selecting these classes in the class trees in the Rails applications is becoming a performance bottleneck:

https://bioportal.bioontology.org/ontologies/HTN/?p=classes&conceptid=http%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FBFO_0000001

We should consider adding paging to this endpoint.

jonquet commented 2 years ago

This issue is inherently linked to the fact that our mapping creation strategy (LOOM and sameURI) has never really considered "re-uses". Which means that every-time a new ontology is built using e.g. BFO we end up generating a tons of mappings (typically for "continuant") to every other ontologies relaying on BFO too. Those objects are not really "mappings" (an equivalent term/concept/class in another ontology) as they are exactly the same term (same URI).

We have discussed differences between term reuses, term overlap and mappings here : https://dx.doi.org/10.1007/978-3-030-61244-3_5

A solution is to implement a way in BioPortal to distinguish :