ols4 icon indicating copy to clipboard operation
ols4 copied to clipboard

Implement preferred roots in ols3 jstree endpoint

Open jamesamcl opened this issue 2 years ago • 2 comments

jamesamcl avatar Jan 29 '23 19:01 jamesamcl

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),"#", "_"));
            }
        }

jamesamcl avatar Mar 08 '23 00:03 jamesamcl

(update: I guess because it includes the ancestors up to the preferred root)

jamesamcl avatar May 19 '23 23:05 jamesamcl