ols4
ols4 copied to clipboard
Implement preferred roots in ols3 jstree endpoint
The ols3 jstree endpoint is for a term, not an ontology. So I'm a bit confused as to why it has preferredRoots as a parameter at all.
OLS3 https://github.com/EBISPOT/OLS/blob/4b54a687386c255ba6457f8db689e2f9d7c3a924/ols-neo4j/src/main/java/uk/ac/ebi/spot/ols/neo4j/service/AbstractJsTreeBuilder.java#L307-L316
if (isRootNode(nodeId, ontologyName, resultsMap, viewMode)) {
switch (viewMode) {
case ALL:
return Collections.singleton(new JsTreeObject("#", "#", ontologyName, "", rootName,
false, "#"));
case PREFERRED_ROOTS:
return Collections.singleton(createJsTreeNode(lang, nodeId, ontologyName, jsTreeObjectMap, parentIdCollector, 1,
resultsMap.get(nodeId).get(0),"#", "_"));
}
}
(update: I guess because it includes the ancestors up to the preferred root)