EBISPOT / ols4

Version 4 of the EMBL-EBI Ontology Lookup Service (OLS)
http://www.ebi.ac.uk/ols4/
Apache License 2.0
42 stars 18 forks source link

Implement preferred roots in ols3 jstree endpoint #193

Open jamesamcl opened 1 year ago

jamesamcl commented 1 year ago

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 commented 1 year ago

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