RetrieveGolrAnnotations extends AbstractRetrieveGolr { public List<GolrAnnotationDocument> getGolrAnnotationsForGene(String id) throws IOException { List<String[]> tagvalues = new ArrayList<String[]>(); String [] tagvalue = new String[2]; tagvalue[0] = "bioentity"; tagvalue[1] = id; tagvalues.add(tagvalue); final List<GolrAnnotationDocument> documents = getGolrAnnotations(tagvalues); return documents; } RetrieveGolrAnnotations(String server);  RetrieveGolrAnnotations(String server, int retryCount, boolean ignoreC16ParseErrors); GafDocument convert(List<GolrAnnotationDocument> golrAnnotationDocuments); void convert(List<GolrAnnotationDocument> golrAnnotationDocuments, Map<String, Bioentity> entities, GafDocument document); List<GolrAnnotationDocument> getGolrAnnotationsForGenes(List<String> ids); List<GolrAnnotationDocument> getGolrAnnotationsForGenes(List<String> ids, boolean noIEAs); List<GolrAnnotationDocument> getGolrAnnotationsForGene(String id); List<GolrAnnotationDocument> getGolrAnnotationsForSynonym(String source, String synonym); List<GolrAnnotationDocument> getGolrAnnotationsForSynonym(String source, List<String> synonyms); List<GolrAnnotationDocument> getGolrAnnotationsForSynonym(String source, List<String> synonyms, boolean noIEAs); List<GolrAnnotationDocument> getGolrAnnotations(List<String []> tagvalues);  }
@Test public void testGetGolrAnnotationsForGene() throws Exception { RetrieveGolrAnnotations retriever = new RetrieveGolrAnnotations("http: @Override protected void logRequest(URI uri) { System.out.println(uri); } }; List<GolrAnnotationDocument> annotations = retriever.getGolrAnnotationsForGenes( Arrays.asList("MGI:MGI:97290"), true); assertNotNull(annotations); for (GolrAnnotationDocument document : annotations) { System.out.println(document.bioentity+" "+document.annotation_class+" "+document.evidence_type); } System.out.println(annotations.size()); assertTrue(annotations.size() > 10); }
@Test public void testGetGolrAnnotationsForGeneProduction() throws Exception { RetrieveGolrAnnotations retriever = new RetrieveGolrAnnotations("http: List<GolrAnnotationDocument> annotations = retriever.getGolrAnnotationsForGene("MGI:MGI:97290"); assertNotNull(annotations); for (GolrAnnotationDocument document : annotations) { System.out.println(document.bioentity+" "+document.annotation_class); } System.out.println(annotations.size()); assertTrue(annotations.size() > 10); }
@Test public void testGetGolrAnnotationsForGeneWithQualifierProduction() throws Exception { RetrieveGolrAnnotations retriever = new RetrieveGolrAnnotations("http: List<GolrAnnotationDocument> annotations = retriever.getGolrAnnotationsForGene("SGD:S000003676"); assertNotNull(annotations); int qualifierCounter = 0; for (GolrAnnotationDocument document : annotations) { System.out.println(document.bioentity+" "+document.annotation_class); if (document.qualifier != null) { System.out.println(document.qualifier); qualifierCounter += 1; } } System.out.println(annotations.size()); assertTrue(annotations.size() > 10); assertTrue(qualifierCounter > 0); }