Search in sources :

Example 1 with InputType

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);
}
Also used : LinkedHashSet(java.util.LinkedHashSet) Bioconductor(org.edamontology.edammap.core.input.csv.Bioconductor) Generic(org.edamontology.edammap.core.input.csv.Generic) ArrayList(java.util.ArrayList) Msutils(org.edamontology.edammap.core.input.csv.Msutils) InputType(org.edamontology.edammap.core.input.InputType) Biotools14(org.edamontology.edammap.core.input.xml.Biotools14) ToolInput(org.edamontology.edammap.core.input.json.ToolInput) SEQwiki(org.edamontology.edammap.core.input.csv.SEQwiki)

Aggregations

ArrayList (java.util.ArrayList)1 LinkedHashSet (java.util.LinkedHashSet)1 InputType (org.edamontology.edammap.core.input.InputType)1 Bioconductor (org.edamontology.edammap.core.input.csv.Bioconductor)1 Generic (org.edamontology.edammap.core.input.csv.Generic)1 Msutils (org.edamontology.edammap.core.input.csv.Msutils)1 SEQwiki (org.edamontology.edammap.core.input.csv.SEQwiki)1 ToolInput (org.edamontology.edammap.core.input.json.ToolInput)1 Biotools14 (org.edamontology.edammap.core.input.xml.Biotools14)1