use of org.nextprot.api.solr.QueryRequest in project nextprot-api by calipho-sib.
the class SearchServiceTest method shouldExportEntries.
@Test
public void shouldExportEntries() throws Exception {
QueryRequest request = new QueryRequest();
request.setQuality("gold");
request.setQuery("insulin");
Set<String> accs = service.getAccessions(request);
assertTrue(accs.contains("NX_P01308"));
}
use of org.nextprot.api.solr.QueryRequest in project nextprot-api by calipho-sib.
the class SearchServiceTest method shouldNotContainThatManyEntries.
@Test
public void shouldNotContainThatManyEntries() throws Exception {
QueryRequest request = new QueryRequest();
request.setQuery("daniel teixeiracarvalho ");
request.setQuality("quality=gold-and-silver");
Set<String> accs = service.getAccessions(request);
assertTrue(accs.size() < 10);
}
use of org.nextprot.api.solr.QueryRequest in project nextprot-api by calipho-sib.
the class SolrServiceTest method shouldReturnResultsFromSparqlQuery.
@Test
public void shouldReturnResultsFromSparqlQuery() throws Exception {
QueryRequest qr = new QueryRequest();
qr.setMode("advanced");
qr.setQuality("gold");
qr.setSparqlEngine("Jena");
qr.setSparql("#Proteins phosphorylated and located in the cytoplasm\nselect distinct ?entry where {\n ?entry :isoform ?iso.\n ?iso :keyword / :term cv:KW-0597.\n ?iso :cellularComponent /:term /:childOf cv:SL-0086.\n}");
Query q = queryBuilderService.buildQueryForSearch(qr, "entry");
SearchResult result = service.executeQuery(q);
assertTrue(result.getFound() >= 5636);
}
use of org.nextprot.api.solr.QueryRequest in project nextprot-api by calipho-sib.
the class SolrServiceTest method shouldReturnResultsFromSharedProteinList.
@Test
public void shouldReturnResultsFromSharedProteinList() throws Exception {
QueryRequest qr = new QueryRequest();
qr.setQuality("gold");
qr.setListId("Y7JPIEVH");
qr.setListOwner("Guest");
Query q = queryBuilderService.buildQueryForSearch(qr, "entry");
SearchResult result = service.executeQuery(q);
assertEquals(1, result.getFound());
}
use of org.nextprot.api.solr.QueryRequest in project nextprot-api by calipho-sib.
the class SolrServiceTest method shouldReturnResultsFromSharedQueryList.
@Test
public void shouldReturnResultsFromSharedQueryList() throws Exception {
QueryRequest qr = new QueryRequest();
qr.setQuality("gold");
qr.setMode("advanced");
qr.setQueryId("3K8W9PJT");
Query q = queryBuilderService.buildQueryForSearch(qr, "entry");
SearchResult result = service.executeQuery(q);
assertTrue(result.getFound() >= 5636);
}
Aggregations