use of org.edamontology.edammap.core.input.json.Publication 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);
}
Aggregations