@Test public void prefixSelectorForName() { assertThat(CypherQueryBuilder.selectorPrefixForName("EOL:123", true), is("externalId:")); assertThat(CypherQueryBuilder.selectorPrefixForName("bla:123", true), is("name:")); assertThat(CypherQueryBuilder.selectorPrefixForName("bla:123", false), is("path:")); assertThat(CypherQueryBuilder.selectorPrefixForName("bla name", false), is("path:")); assertThat(CypherQueryBuilder.selectorPrefixForName("bla name", true), is("name:")); }
public static String selectorPrefixForName(String name, boolean isExactMatch) { String prefix = "path:"; if (isExactMatch) { if (isExternalId(name)) { prefix = "externalId:"; } else { prefix = "name:"; } } return prefix; }
CypherQueryBuilder { public static String selectorPrefixForName(String name, boolean isExactMatch) { String prefix = "path:"; if (isExactMatch) { if (isExternalId(name)) { prefix = "externalId:"; } else { prefix = "name:"; } } return prefix; } }
CypherQueryBuilder { public static String selectorPrefixForName(String name, boolean isExactMatch) { String prefix = "path:"; if (isExactMatch) { if (isExternalId(name)) { prefix = "externalId:"; } else { prefix = "name:"; } } return prefix; }  }
CypherQueryBuilder { public static String selectorPrefixForName(String name, boolean isExactMatch) { String prefix = "path:"; if (isExactMatch) { if (isExternalId(name)) { prefix = "externalId:"; } else { prefix = "name:"; } } return prefix; }  static CypherQuery createDistinctTaxaInLocationQuery(Map<String, String[]> params); static String selectorPrefixForName(String name, boolean isExactMatch); static void addLocationClausesIfNecessary(StringBuilder query, Map parameterMap, QueryType queryType); static String lucenePathQuery(List<String> taxonNames, boolean isExactMatch); static String regexWildcard(List<String> terms); static CypherQuery shortestPathQuery(final String startTaxon, final String endTaxon); static CypherQuery externalIdForStudy(final String studyTitle); static CypherQuery externalIdForTaxon(final String taxonName); static CypherQuery locations(); static CypherQuery locations(Map parameterMap); static CypherQuery buildInteractionQuery(final String sourceTaxonName, final String interactionType, final String targetTaxonName, final Map parameterMap, QueryType queryType); static CypherQuery buildInteractionQuery(List<String> sourceTaxonName, final String interactionType, List<String> targetTaxonName, Map parameterMap, QueryType queryType); static CypherQuery buildInteractionTypeQuery(Map parameterMap); static CypherQuery buildInteractionQuery(Map parameterMap, QueryType queryType); static CypherQuery createPagedQuery(HttpServletRequest request, CypherQuery query); static CypherQuery createPagedQuery(HttpServletRequest request, CypherQuery query, long defaultLimit); static CypherQuery createPagedQuery(CypherQuery query, long offset, long limit); static CypherQuery spatialInfo(Map<String, String[]> parameterMap); static void appendSpatialStartWhereWith(Map<String, String[]> parameterMap, StringBuilder query); }
CypherQueryBuilder { public static String selectorPrefixForName(String name, boolean isExactMatch) { String prefix = "path:"; if (isExactMatch) { if (isExternalId(name)) { prefix = "externalId:"; } else { prefix = "name:"; } } return prefix; }  static CypherQuery createDistinctTaxaInLocationQuery(Map<String, String[]> params); static String selectorPrefixForName(String name, boolean isExactMatch); static void addLocationClausesIfNecessary(StringBuilder query, Map parameterMap, QueryType queryType); static String lucenePathQuery(List<String> taxonNames, boolean isExactMatch); static String regexWildcard(List<String> terms); static CypherQuery shortestPathQuery(final String startTaxon, final String endTaxon); static CypherQuery externalIdForStudy(final String studyTitle); static CypherQuery externalIdForTaxon(final String taxonName); static CypherQuery locations(); static CypherQuery locations(Map parameterMap); static CypherQuery buildInteractionQuery(final String sourceTaxonName, final String interactionType, final String targetTaxonName, final Map parameterMap, QueryType queryType); static CypherQuery buildInteractionQuery(List<String> sourceTaxonName, final String interactionType, List<String> targetTaxonName, Map parameterMap, QueryType queryType); static CypherQuery buildInteractionTypeQuery(Map parameterMap); static CypherQuery buildInteractionQuery(Map parameterMap, QueryType queryType); static CypherQuery createPagedQuery(HttpServletRequest request, CypherQuery query); static CypherQuery createPagedQuery(HttpServletRequest request, CypherQuery query, long defaultLimit); static CypherQuery createPagedQuery(CypherQuery query, long offset, long limit); static CypherQuery spatialInfo(Map<String, String[]> parameterMap); static void appendSpatialStartWhereWith(Map<String, String[]> parameterMap, StringBuilder query); static final String INTERACTION_PREYS_ON; static final String INTERACTION_PREYED_UPON_BY; static final String INTERACTION_EATS; static final String INTERACTION_EATEN_BY; static final String INTERACTION_PARASITE_OF; static final String INTERACTION_HAS_PARASITE; static final String INTERACTION_ENDOPARASITE_OF; static final String INTERACTION_HAS_ENDOPARASITE; static final String INTERACTION_ECTOPARASITE_OF; static final String INTERACTION_HAS_ECTOPARASITE; static final String INTERACTION_PARASITOID_OF; static final String INTERACTION_HAS_PARASITOID; static final String INTERACTION_POLLINATES; static final String INTERACTION_POLLINATED_BY; static final String INTERACTION_PATHOGEN_OF; static final String INTERACTION_HAS_PATHOGEN; static final String INTERACTION_VECTOR_OF; static final String INTERACTION_HAS_VECTOR; static final String INTERACTION_DISPERSAL_VECTOR_OF; static final String INTERACTION_HAS_DISPERSAL_VECTOR; static final String INTERACTION_HOST_OF; static final String INTERACTION_HAS_HOST; static final String INTERACTION_VISITS_FLOWERS_OF; static final String INTERACTION_FLOWERS_VISITED_BY; static final String INTERACTION_SYMBIONT_OF; static final String INTERACTION_MUTUALIST_OF; static final String INTERACTION_COMMENSALIST_OF; static final String INTERACTION_INTERACTS_WITH; static final String INTERACTION_RELATED_TO; static final String INTERACTION_CO_OCCURS_WITH; static final String INTERACTION_KILLS; static final String INTERACTION_KILLED_BY; static final Map<String, InteractionTypeExternal> INTERACTION_TYPE_INTERNAL_EXTERNAL_MAP; static final List<ResultField> TAXON_FIELDS; static final Map<ResultField, String> FIELD_MAP; static final long DEFAULT_LIMIT; static final String ALL_LOCATIONS_INDEX_SELECTOR; }