use of org.edamontology.edammap.core.input.InputType in project edammap by edamontology.
the class QueryLoader method get.
public static List<Query> get(String queryPath, QueryType type, Map<EdamUri, Concept> concepts, int timeout, String userAgent) throws IOException, ParseException {
if (type == QueryType.server) {
throw new IllegalArgumentException("Query of type \"" + QueryType.server.name() + "\" is not loadable from path, but has to be provided");
}
List<? extends InputType> inputs;
if (type == QueryType.biotools) {
inputs = Json.load(queryPath, type, timeout, userAgent);
} else if (type == QueryType.biotools14) {
inputs = Xml.load(queryPath, type, timeout, userAgent);
} else {
inputs = Csv.load(queryPath, type, timeout, userAgent);
}
Set<Query> queries = new LinkedHashSet<>();
for (InputType input : inputs) {
switch(type) {
case generic:
queries.add(getGeneric((Generic) input, concepts));
break;
case SEQwiki:
queries.add(getSEQwiki((SEQwiki) input, concepts));
break;
case msutils:
queries.add(getMsutils((Msutils) input, concepts));
break;
case Bioconductor:
queries.add(getBioconductor((Bioconductor) input, concepts));
break;
case biotools14:
queries.add(getBiotools14((Biotools14) input, concepts));
break;
case biotools:
queries.add(getBiotools((ToolInput) input, concepts));
break;
case server:
break;
}
}
return new ArrayList<>(queries);
}
Aggregations