: uniportRestRequest.getResponseSize();
int offSet = uniportRestRequest.getOffSet();
+ String query;
+ if (isAdvancedQuery(uniportRestRequest.getSearchTerm()))
+ {
+ query = uniportRestRequest.getSearchTerm();
+ }
+ else
+ {
+ query = uniportRestRequest.getFieldToSearchBy().equalsIgnoreCase(
+ "Search All") ? uniportRestRequest.getSearchTerm()
+ + " or mnemonic:" + uniportRestRequest.getSearchTerm()
+ : uniportRestRequest.getFieldToSearchBy() + ":"
+ + uniportRestRequest.getSearchTerm();
+ }
- String query = uniportRestRequest.getFieldToSearchBy()
- .equalsIgnoreCase("Search All") ? uniportRestRequest
- .getSearchTerm()
- + " or mnemonic:"
- + uniportRestRequest
- .getSearchTerm() : uniportRestRequest.getFieldToSearchBy()
- + ":" + uniportRestRequest.getSearchTerm();
-
- // + (uniportRestRequest.isAllowUnpublishedEntries() ? ""
- // : " AND status:REL");
- // System.out.println(">>>>> Query : " + query);
- // System.out.println(">>>>> Columns : " + wantedFields);
- // System.out.println(">>>>> Response size: " + responseSize
- // + " offset : "
- // + offSet);
WebResource webResource = null;
webResource = client.resource(UNIPROT_SEARCH_ENDPOINT)
.queryParam("format", "tab")
}
}
+ public boolean isAdvancedQuery(String query)
+ {
+ if (query.contains(" AND ") || query.contains(" OR ")
+ || query.contains(" NOT ") || query.contains(" ! ")
+ || query.contains(" || ") || query.contains(" && ")
+ || query.contains(":") || query.contains("-"))
+ {
+ return true;
+ }
+ return false;
+ }
public FTSRestResponse parseUniprotResponse(
String uniProtTabDelimittedResponseString,