import uk.ac.ebi.sbo.sbows.SBOProvider; import uk.ac.ebi.sbo.sbows.SBOProviderServiceLocator; import java.io.PrintWriter; /** * Copyright (C) Melanie Courtot 2006 * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or (at * your option) any later version. * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more * details. http://www.gnu.org/licenses/gpl.txt * Melanie Courtot * Computational Neurobiology, EMBL-EBI, Wellcome-Trust Genome Campus. Hinxton CB10 1SD, UK. courtot@ebi.ac.uk */ public class TermStringClient { public static void main(String [] args) { try { SBOProviderServiceLocator service = new SBOProviderServiceLocator(); //set endpoint adress service.setSBOQueryEndpointAddress("http://www.ebi.ac.uk/compneur-srv/sbo-main/services/SBOQuery"); SBOProvider port = service.getSBOQuery(); PrintWriter out = new PrintWriter(System.out); /** * say hi! */ System.out.println(port.sayHi("hi")); /** * get term by its accession number * SBO:0000144 => client sends 144 */ String term1 = port.getStringTermById(144); System.out.println(term1); /** * get terms which names complete the string parameter * eg "hill" gets back Hill coefficient, Hill constant, Hill equation, Hill equation microscopic form * and Hill equation reduced form * the search is case insensitive but ONLY on the beginning of the name */ String[] terms1 = port.searchStringPossibleCompletions("hill"); for (int i=0;itrue */ boolean isDirectChildOf1 = port.isDirectChildOf(43,41); System.out.println("is SBO:0000043 direct child of SBO:0000041 "+isDirectChildOf1); /** * is SBO:0000047 direct child of SBO:0000041 =>false */ boolean isDirectChildOf2 = port.isDirectChildOf(47,41); System.out.println("is SBO:0000047 direct child of SBO:0000041 "+isDirectChildOf2); /** * is SBO:0000043 child of SBO:0000041 =>true */ boolean isChildOf1 = port.isChildOf(43,41); System.out.println("is SBO:0000043 child of SBO:0000041 "+isChildOf1); /** * is SBO:0000047 direct child of SBO:0000041 =>true */ boolean isChildOf2 = port.isChildOf(47,41); System.out.println("is SBO:0000047 child of SBO:0000041 "+isChildOf2); /** * We give an array of SBOIds and we want to get the corresponding terms back */ int[] sboIdsInput = {144, 55, 2, 9, 43}; String[] terms3 = port.getStringTermsByIds(sboIdsInput); for (int i=0;i