Interface TaxonomyDatabase

All Known Implementing Classes:
CachingInMemoryTaxonomyDatabase, InMemoryTaxonomyDatabase

public interface TaxonomyDatabase
Defines searches possible against a database of taxonomic data.
  • Method Details

    • containsGenus

      boolean containsGenus(String genus)
      Does the database contain at least one record that exactly matches specified genus?.
      Parameters:
      genus - the genus
      Returns:
      true if there is at least one record
    • findSimilarGenus

      List<String> findSimilarGenus(String genus, int maxSize)
      Return a list of genera close to the specified genus.
      Parameters:
      genus - genus
      maxSize - maximum rows to return
      Returns:
      list of suggestions, ordered by preference (best first), never null.
    • containsSpecies

      boolean containsSpecies(String genus, String species)
      Does the database contain at least one record that exactly matches specified genus and species?.
      Parameters:
      genus - the genus
      species - the species
      Returns:
      true if there is at least one record
    • containsSpecies

      boolean containsSpecies(String genus, String species, String spAuthor)
      Does the database contain at least one record that exactly matches specified genus and species?.
      Parameters:
      genus - the genus
      species - the species
      spAuthor - species authority
      Returns:
      true if there is at least one record
    • findSimilarSpecies

      List<String> findSimilarSpecies(String genus, String species, String spAuthor, int maxSize)
      Return a list of species close to the specified genus and species.
      Parameters:
      genus - valid genus
      species - species
      spAuthor - species authority
      maxSize - maximum number of suggestions to return
      Returns:
      list of suggestions, ordered by preference (best first), never null.
    • getSpeciesAuthority

      List<String> getSpeciesAuthority(String genus, String species)
      Return the species authority for the specified species within genus.
      Parameters:
      genus - the genus
      species - the species
      Returns:
      the authority or null
    • getSpeciesAuthority

      List<String> getSpeciesAuthority(String genus, String species, String spAuthor)
      Return the species authority for the specified species within genus.
      Parameters:
      genus - the genus
      species - the species
      spAuthor - species authority
      Returns:
      the authority or null
    • containsSubtaxa

      boolean containsSubtaxa(String genus, String species, String subtaxa)
      Does the database contain at least one record that exactly matches specified genus, species and subtaxa?.
      Parameters:
      genus - valid genus
      species - valid species
      subtaxa - subtaxa to check
      Returns:
      true if there is at least one record
    • containsSubtaxa

      boolean containsSubtaxa(String genus, String species, String spAuthor, String subtaxa, String subtAuthor)
      Does the database contain at least one record that exactly matches specified genus, species and subtaxa?.
      Parameters:
      genus - valid genus
      species - valid species
      spAuthor - species authority
      subtaxa - subtaxa to check
      subtAuthor - species authority at the lowest classification level
      Returns:
      true if there is at least one record
    • findSimilarSubtaxa

      List<String> findSimilarSubtaxa(String genus, String species, String subtaxa, int maxSize)
      Suggest a list of subtaxa
      Parameters:
      genus - valid genus
      species - valid species
      subtaxa - subtaxa to check
      maxSize - maximum number of suggestions to return
      Returns:
      list of suggestions, ordered by preference, never null
    • findSimilarSubtaxa

      List<String> findSimilarSubtaxa(String genus, String species, String spAuthor, String subtaxa, String subtAuthor, int maxSize)
      Suggest a list of subtaxa
      Parameters:
      genus - valid genus
      species - valid species
      spAuthor - species authority
      subtaxa - subtaxa to check
      subtAuthor - species authority at the lowest classification level
      maxSize - maximum number of suggestions to return
      Returns:
      list of suggestions, ordered by preference, never null
    • findSimilar

      @Nonnull List<TaxonomyChecker.Taxon> findSimilar(String genus, String species, String spAuthor, String subtaxa, String subtAuthor, int maxSize)
      Suggest a list of matches.
      Parameters:
      genus - valid genus
      species - valid species
      spAuthor - species authority
      subtaxa - subtaxa to check
      subtAuthor - species authority at the lowest classification level
      maxSize - maximum number of suggestions to return
      Returns:
      list of suggestions, ordered by preference, never null
    • getSubtaxaAuthority

      List<String> getSubtaxaAuthority(String genus, String species, String subtaxa)
      Return the authority for the specified subtaxa
      Parameters:
      genus - the genus
      species - the species
      subtaxa - subtaxa to check
      Returns:
      the authority or null
    • getSubtaxaAuthority

      List<String> getSubtaxaAuthority(String genus, String species, String spAuthor, String subtaxa, String subtAuthor)
      Return the authority for the specified subtaxa
      Parameters:
      genus - the genus
      species - the species
      spAuthor - species authority
      subtaxa - subtaxa to check
      subtAuthor - species authority at the lowest classification level
      Returns:
      the authority or null
    • listSpecies

      List<org.genesys.taxonomy.gringlobal.model.IGrinSpecies> listSpecies(String genus, String species, int maxSize)
      Return all subtaxa for genus and species
      Parameters:
      genus - valid genus
      species - valid species
      maxSize - maximum number of rows to return
      Returns:
      list of species matching genus and species name
    • findSpeciesRow

      List<org.genesys.taxonomy.gringlobal.model.IGrinSpecies> findSpeciesRow(String genus, String species, String subtaxa)
      Find SpeciesRows matching the definition
      Parameters:
      genus - the genus
      species - the species
      subtaxa - the MCPD subtaxa
      Returns:
      list of matching SpeciesRows
    • findSpeciesRows

      List<org.genesys.taxonomy.gringlobal.model.IGrinSpecies> findSpeciesRows(String genus, String species, String spAuthor, String subtaxa, String subtAuthor)
      Find SpeciesRows matching the definition
      Parameters:
      genus - the genus
      species - the species
      spAuthor - species authority
      subtaxa - the MCPD subtaxa
      subtAuthor - species authority at the lowest classification level
      Returns:
      list of matching SpeciesRows
    • getTaxon

      TaxonomyChecker.Taxon getTaxon(String genus, String species, String spAuthor, String subtaxa, String subtAuthor)
      Get exact match.
      Parameters:
      genus - valid genus
      species - valid species
      spAuthor - species authority
      subtaxa - subtaxa to check
      subtAuthor - species authority at the lowest classification level
      Returns:
      One exactly matching record
    • findTaxa

      @Nonnull List<TaxonomyChecker.Taxon> findTaxa(String genus, String species, String spAuthor, String subtaxa, String subtAuthor, int maxSize)
      Parameters:
      genus - the genus
      species - the species
      spAuthor - species authority
      subtaxa - the MCPD subtaxa
      subtAuthor - species authority at the lowest classification level
      maxSize - maximum rows to return
      Returns:
      list of taxa
    • getSpeciesRow

      org.genesys.taxonomy.gringlobal.model.IGrinSpecies getSpeciesRow(long speciesId)
      Get species by speciesId
      Parameters:
      speciesId - duh
      Returns:
      SpeciesRow or null if not found
    • getGenus

      String getGenus(long genusId)
      Get genus by genusId
      Parameters:
      genusId - duh
      Returns:
      genus name or null
    • similarityScore

      double similarityScore(String string1, String string2)
      Get string similarity score.
      Parameters:
      string1 - the string 1
      string2 - the string 2
      Returns:
      the double