Search in sources :

Example 1 with InputOutput

use of org.edamontology.edammap.core.input.json.InputOutput in project edammap by edamontology.

the class QueryLoader method getBiotools.

private static Query getBiotools(ToolInput tool, Map<EdamUri, Concept> concepts) {
    List<Link> webpageUrls = new ArrayList<>();
    addLink(tool.getHomepage(), "Homepage", false, webpageUrls);
    webpageUrls.addAll(linksJson(tool.getLink().stream(), Arrays.asList("mirror", "repository", "browser"), false));
    List<Link> docUrls = linksJson(tool.getDocumentation().stream(), Arrays.asList("general", "manual", "api documentation", "training material"), false);
    List<PublicationIdsQuery> publicationIds = new ArrayList<>();
    for (Publication publication : tool.getPublication()) {
        addPublicationId(publication.getPmid(), publication.getPmcid(), publication.getDoi(), BIOTOOLS, publication.getType(), false, publicationIds);
    }
    Set<EdamUri> annotations = new LinkedHashSet<>();
    annotations.addAll(edamUrisJson(tool.getTopic().stream(), concepts));
    for (Function function : tool.getFunction()) {
        annotations.addAll(edamUrisJson(function.getOperation().stream(), concepts));
        for (InputOutput input : function.getInput()) {
            annotations.addAll(edamUrisJson(Collections.singletonList(input.getData()).stream(), concepts));
            if (input.getFormat() != null) {
                annotations.addAll(edamUrisJson(input.getFormat().stream(), concepts));
            }
        }
        for (InputOutput output : function.getOutput()) {
            annotations.addAll(edamUrisJson(Collections.singletonList(output.getData()).stream(), concepts));
            if (output.getFormat() != null) {
                annotations.addAll(edamUrisJson(output.getFormat().stream(), concepts));
            }
        }
    }
    return new Query(tool.getId().trim(), tool.getName().trim(), null, tool.getDescription().trim(), webpageUrls, docUrls, publicationIds, annotations);
}
Also used : LinkedHashSet(java.util.LinkedHashSet) Function(org.edamontology.edammap.core.input.json.Function) InputOutput(org.edamontology.edammap.core.input.json.InputOutput) ArrayList(java.util.ArrayList) Publication(org.edamontology.edammap.core.input.json.Publication) EdamUri(org.edamontology.edammap.core.edam.EdamUri)

Aggregations

ArrayList (java.util.ArrayList)1 LinkedHashSet (java.util.LinkedHashSet)1 EdamUri (org.edamontology.edammap.core.edam.EdamUri)1 Function (org.edamontology.edammap.core.input.json.Function)1 InputOutput (org.edamontology.edammap.core.input.json.InputOutput)1 Publication (org.edamontology.edammap.core.input.json.Publication)1