Web services to access the data

Ontogene v2.0 provides a web service to search all terms, all genes, all term associations based on PubMed, annotations of term, annotations of gene, and associated terms of a specified term based on PubMed.The following is the example to access our web services:
					
package query;

import javax.ws.rs.core.MediaType;
import com.sun.jersey.api.client.Client;
import com.sun.jersey.api.client.WebResource;
import com.sun.jersey.api.client.config.ClientConfig;
import com.sun.jersey.api.client.config.DefaultClientConfig;


public class TestQuery {

	/**
	 * @param args
	 */
	public static final String BASE_URI = "http://123.59.132.21:8080/Ontogene";
	public static final String PATH_NAME_Query_Gene = "/query/getAllGenes";
	public static final String PATH_NAME_Query_Term = "/query/getAllTerms";
	public static final String PATH_NAME_Query_Term_Annotation = "/query/getTermAnnnotations/";
	public static final String PATH_NAME_Query_Gene_Annotation = "/query/getGeneAnnnotations/";
	public static final String PATH_NAME_Query_Associations = "/query/getAllAssociations/";
	public static final String PATH_NAME_Query_Term_Associations = "/query/getTermAssociations/";
	
	 
	public static void main(String[] args) {
	  
		ClientConfig config = new DefaultClientConfig();
		Client client = Client.create(config);
		WebResource resource = client.resource(BASE_URI);	
		
		WebResource nameResource = resource.path("rest").path(PATH_NAME_Query_Gene);		
		 
		
		//Response all genes, For examle: A1BGmRNAHGNC:5
		System.out.println(getResponse(nameResource));	
		
		
		//Response all terms, For examle: GO:0005488binding
		nameResource = resource.path("rest").path(PATH_NAME_Query_Term);		
		System.out.println(getResponse(nameResource));	
		
		
		//Response all Associations, For examle: 
		nameResource = resource.path("rest").path(PATH_NAME_Query_Associations);		
		System.out.println(getResponse(nameResource));	
		
		
		//Response all the annotations of the term. The following is one of the annotation results of DOID:0050671: DOID:0050671female breast cancerBRCA1mRNAHGNC:1100The four most frequent BRCA1 mutations found in female breast cancer cases in Guangxi are all located in exon 10. BRCA1-associated breast cancer cases have earlier onset age, higher nuclear grade and 25337278
		nameResource = resource.path("rest").path(PATH_NAME_Query_Term_Annotation + "DOID:0050671");		
		System.out.println(getResponse(nameResource));	
		
		
		//Response all the annotations of the gene. The following is one of the annotation results of HGNC:11998: GO:0016310phosphorylationTP53mRNAHGNC:11998phosphorylation of p53 was rapidly induced in human fibroblasts upon exposure of cells to hydrogen peroxide (H(2)O(2))11447225GO:0002039p53 bindingTP53mRNAHGNC:11998Binding to the p53 binding sites of the Mdm2 promoter alleviates the requirement for p53 C-terminal activation.11328884
		nameResource = resource.path("rest").path(PATH_NAME_Query_Gene_Annotation + "HGNC:11998");		
		System.out.println(getResponse(nameResource));	
				
		//Response all the associated terms of a specified term. The following is one of the annotation results of HP:0010554: HP:0010554Cutaneous finger syndactylyHP:0010561Undulate ribs0.03333333333333330.00688434362344392
		nameResource = resource.path("rest").path(PATH_NAME_Query_Term_Associations + "HP:0010554");		
		System.out.println(getResponse(nameResource));	
	}
	 
	 
	/**
	* Response all results.
	* 
	* 
	* @param service
	* @return
	*/
	private static String getResponse(WebResource resource) {
		
		return resource.accept(new String [] {MediaType.TEXT_PLAIN}).get(String.class).toString();
		
	}	

}					
					
Insert title here

Copyright © Colledge of Bioinformatics Science and Technology, Harbin Medical University.