Contents of this Page
Connection to the LexEVS Grid Service
Java Code
try{ LexBIGServiceGridAdapter lbsg = new LexBIGServiceGridAdapter ("http://localhost:8080/wsrf/services/cagrid/LexEVSGridService"); } catch(java.net.ConnectException e){ //Error Connecting e.printStackTrace(); } catch(org.apache.axis.types.URI.MalformedURIException e){ //URL Syntax Error e.printStackTrace(); }
Searching for concepts in NCI Thesaurus containing the string "Gene"
Java Code Snippet
//Create a Connection to the Grid Service LexBIGServiceGrid lbs = new LexBIGServiceGridAdapter(gridServiceURL); //Set up the CodingSchemeIdentification object to define the Coding Scheme</font> CodingSchemeIdentification csid = new CodingSchemeIdentification(); csid.setName("NCI Thesaurus"); //Get the CodedNodeSet for that CodingScheme (This returns a CodedNodeSet Service Context) CodedNodeSetGrid cnsg = lbs.getCodingSchemeConcepts(csid, null); //getCodingSchemeConcepts is a Grid Service Call //Set the text to match MatchCriteria matchText = new MatchCriteria(); matchText.setText("Gene"); //Define a SearchDesignationOption, if any SearchDesignationOption searchOption = new SearchDesignationOption(); //Choose an algorithm to do the matching ExtensionIdentification matchAlgorithm = new ExtensionIdentification(); matchAlgorithm.setLexBIGExtensionName("contains"); //Chose a language LanguageIdentification language = new LanguageIdentification(); language.setIdentifier("en"); //Restrict the CodedNodeSet cnsg.restrictToMatchingDesignations(matchText, searchOption, matchAlgorithm, language); //restrictToMatchingDesignations is a Grid Service Call //Create a SetResolutionPolicy to handle the details of Resolving the CodedNodeSet //Here, we will set the Maximum number of Concepts returned to 10. SetResolutionPolicy resolvePolicy = new SetResolutionPolicy(); resolvePolicy.setMaximumToReturn(10); //Do the resolve ResolvedConceptReferenceList rcrlist = cnsg.resolveToList(resolvePolicy); //resolveToList is a Grid Service Call //Use the returned ResolvedConceptReferenceList to print some details about the concepts found ResolvedConceptReference[] rcref = rcrlist.getResolvedConceptReference(); for (int i = 0; i < rcref.length; i++) { System.out.println(rcref[i].getConceptCode()); System.out.println(rcref[i].getReferencedEntry(). getPresentation()[0].getText().getContent()); }
Request History Service
Java Code Snippet
HistoryServiceGrid history = lbs.getHistoryService(org.LexGrid.LexBIG.DataModel.cagrid.CodingSchemeIdentification);
Request LexBIGService Metadata
Java Code Snippet
LexBIGServiceMetadataGrid metadata = lbs.getServiceMetadata();
Request LexBIGService Convenience Methods
Java Code Snippet
LexBIGServiceConvenienceMethodsGrid lbscm = lbs.getGenericExtensions(org.LexGrid.LexBIG.DataModel.cagrid.ExtensionIdentification);
LexBIGService Adapter
Java Code Snippet
LexBIGService lbs = new LexBIGServiceAdapter("http://lexevsapi-analytical50.nci.nih.gov/wsrf/services/cagrid/LexEVSGridService");
LexBIGService Grid Adapter
Java Code Snippet
LexBIGServiceGrid lbs = new LexBIGServiceGridAdapter("http://lexevsapi-analytical50.nci.nih.gov/wsrf/services/cagrid/LexEVSGridService");