Search in sources :

Example 16 with ApiMethod

use of org.jsondoc.core.annotation.ApiMethod in project nextprot-api by calipho-sib.

the class TermController method getDescendantGraph.

@ApiMethod(path = "/term/{term}/descendant-graph", verb = ApiVerb.GET, description = "Get the descendant graph of the given term", produces = MediaType.APPLICATION_JSON_VALUE)
@RequestMapping(value = "/term/{term}/descendant-graph", method = { RequestMethod.GET }, produces = MediaType.APPLICATION_JSON_VALUE)
public Map<String, CvTermGraph.View> getDescendantGraph(@ApiPathParam(name = "term", description = "The accession of the cv term", allowedvalues = { "TS-0079" }) @PathVariable("term") String term) {
    CvTerm cvTerm = terminologyService.findCvTermByAccession(term);
    CvTermGraph graph = cvTermGraphService.findCvTermGraph(TerminologyCv.getTerminologyOf(cvTerm.getOntology()));
    return Collections.singletonMap("descendant-graph", graph.calcDescendantSubgraph(cvTerm.getId().intValue()).toView());
}
Also used : CvTerm(org.nextprot.api.core.domain.CvTerm) CvTermGraph(org.nextprot.api.core.domain.CvTermGraph) ApiMethod(org.jsondoc.core.annotation.ApiMethod) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

ApiMethod (org.jsondoc.core.annotation.ApiMethod)16 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)10 NextProtException (org.nextprot.api.commons.exception.NextProtException)8 IOException (java.io.IOException)7 OutputStream (java.io.OutputStream)6 NextprotMediaType (org.nextprot.api.core.service.export.format.NextprotMediaType)4 CvTerm (org.nextprot.api.core.domain.CvTerm)2 CvTermGraph (org.nextprot.api.core.domain.CvTermGraph)2 UserProteinList (org.nextprot.api.user.domain.UserProteinList)2 UserQuery (org.nextprot.api.user.domain.UserQuery)2 SearchQueryException (org.nextprot.api.commons.exception.SearchQueryException)1 DbXref (org.nextprot.api.core.domain.DbXref)1 Publication (org.nextprot.api.core.domain.Publication)1 SlimIsoformTSVWriter (org.nextprot.api.core.service.export.io.SlimIsoformTSVWriter)1 Query (org.nextprot.api.solr.Query)1 QueryRequest (org.nextprot.api.solr.QueryRequest)1 SearchResult (org.nextprot.api.solr.SearchResult)1 JSONObjectsWriter (org.nextprot.api.web.service.impl.writer.JSONObjectsWriter)1 View (org.springframework.web.servlet.View)1