Open graybeal opened 3 years ago
This seems much faster now, virtually instantaneous.
@jvendetti Do you think this can be closed?
I think this should remain open and we should consider refactoring this code if time allows.
If an end user navigates to the class tree for an ontology and selects a class that has a lot of mappings (e.g., the "Event" class in SNOMEDCT), the Rails application issues hundreds of Ajax calls in order to build the display for the Class Mappings tab.
Just to flesh this out w/more detail - the following REST API call retrieves all the mappings for the Event class in SNOMEDCT:
Snippet of the resulting JSON showing a single mapping:
{
"id": null,
"source": "LOOM",
"classes": [
{
"@id": "http://purl.bioontology.org/ontology/SNOMEDCT/272379006",
"@type": "http://www.w3.org/2002/07/owl#Class"
},
{
"@id": "http://presence-ontology.org/ontology/Event",
"@type": "http://www.w3.org/2002/07/owl#Class"
}
]
For each mapping, the Rails application issues two Ajax calls to retrieve additional information about the destination class, i.e., one call to determine the human readable ontology acronym, and one call to determine the human readable class label. The Class Mappings table structure appears as follows:
The Event class in SNOMEDCT has 245 mappings, which results in 490 Ajax calls.
The number of Ajax calls for mappings is very high, because these are generated when an ontology summary page is visited (for whole ontology), or when a class is visited (for that class).
Reduce the number of calls for mapping, e.g, by delaying the start of mapping calls until the mapping tab is clicked; or by deleting the mappings tabs altogether (as a temporary measure for diagnosis).
Related to https://github.com/ncbo/bioportal-project/issues/184