Package org.gbif.api.model.checklistbank
Class NameUsage
java.lang.Object
org.gbif.api.model.checklistbank.NameUsage
- All Implemented Interfaces:
LinneanClassification
,LinneanClassificationKeys
- Direct Known Subclasses:
NameUsageContainer
A usage of a scientific name according to one particular Checklist including the GBIF Taxonomic Backbone,
the NUB. It is shown as species in the portal and API.
Backbone (NUB) usages have key==nubKey. Backbone usages can also be detected by either the NameUsage.isNub() method or by manually comparing the datasetKey with the fixed backbone datasetKey, see Constants.NUB_DATASET_KEY.
Name usages from other checklists with names that also exist in the backbone will have a nubKey that points to the related usage in the NUB.
To store not eagerly loaded subresources such as vernacular names or synonyms with a usage please use the
Backbone (NUB) usages have key==nubKey. Backbone usages can also be detected by either the NameUsage.isNub() method or by manually comparing the datasetKey with the fixed backbone datasetKey, see Constants.NUB_DATASET_KEY.
Name usages from other checklists with names that also exist in the backbone will have a nubKey that points to the related usage in the NUB.
To store not eagerly loaded subresources such as vernacular names or synonyms with a usage please use the
NameUsageContainer
class.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addIssue
(NameUsageIssue issue) boolean
The taxon concept reference is usually a reference to some publication or author and year.Returns the authorship information for the scientific name.Returns the earlier name (basionym) for this scientific name.Return the class key for this usage.getClazz()
Return the class for this usage.Return the optional sub dataset key for this usage.@NotNull UUID
Returns the key of the checklist that "hosts" this name usage.The date this record was deleted.Return the family for this usage.Return the family key for this usage.getGenus()
Return the genus for this usage.Return the genus key for this usage.@NotNull LinkedHashMap<Integer,
String> An ordered map with entries for all higher Linnean ranks down to the actual direct parent of this usage.getHigherRank
(Rank rank) Gets a higher taxon property by passing the rank of it.getHigherRankKey
(Rank rank) Gets a higher taxon key by passing the rank of it.@NotNull Set<NameUsageIssue>
@NotNull Integer
getKey()
Return the key that uniquely identifies this name usage.Return the kingdom for this usage.Return the kingdom key for this usage.The date this record was last crawled during clb indexing.The date this record was last interpreted during indexing.The interpreted dc:modified from the verbatim source data.The status related to the conformance to the relevant rules of nomenclature.int
The number of all accepted taxonomic elements under this usage.getOrder()
Return the order for this usage.Return the order key for this usage.@NotNull Origin
The origin of this name usage record, i.e.The scientific name of the parent.Returns the immediate parent.Return the phylum for this usage.Return the phylum key for this usage.Pro parte synonyms, i.e.Original publication for this name usage.getRank()
Returns the rank for this usage.A URI link or reference to the source of this record, the record's "homepage".@NotNull String
The scientific name (with date and authorship information if applicable).For backbone taxa the source taxon key refers to the original name usage that was used during backbone building and is the primary reason that this taxon exists in the backbone.Return the species for this usage.Return the species key for this usage.Return the canonical subgenus name for this usage.Return the subgenus key for this usage.The original taxonID of the name usage as found in the source.The taxonomic status of the name usage.A common or vernacular name for this usage.int
hashCode()
boolean
isNub()
boolean
True for pro parte synonyms with multiple accepted usages.boolean
Convenience method using the taxonomicStatus field.void
setAccepted
(String accepted) Sets the scientific name of the basionym, i.e.void
setAcceptedKey
(Integer acceptedKey) Sets the usage key for the accepted name.void
setAccordingTo
(String accordingTo) void
setAuthorship
(String authorship) void
setBasionym
(String basionym) sets the basionym name.void
setBasionymKey
(Integer basionymKey) void
setCanonicalName
(String canonicalName) void
setClassKey
(Integer classKey) void
void
setConstituentKey
(UUID constituentKey) void
setDatasetKey
(UUID datasetKey) void
setDeleted
(Date deleted) void
void
setFamilyKey
(Integer familyKey) void
void
setGenusKey
(Integer genusKey) void
setIssues
(Set<NameUsageIssue> issues) void
void
setKingdom
(String kingdom) void
setKingdomKey
(Integer kingdomKey) void
setLastCrawled
(Date lastCrawled) void
setLastInterpreted
(Date lastInterpreted) void
setModified
(Date modified) void
setNameKey
(Integer nameKey) void
setNameType
(NameType nameType) void
setNomenclaturalStatus
(Set<NomenclaturalStatus> nomenclaturalStatus) void
void
setNumDescendants
(int numDescendants) void
void
setOrderKey
(Integer orderKey) void
void
void
setParentKey
(Integer parentKey) void
void
setPhylumKey
(Integer phylumKey) void
setProParteKey
(Integer proParteKey) Sets the pro parte usage key.void
setPublishedIn
(String publishedIn) void
void
setReferences
(URI references) void
setRemarks
(String remarks) void
setScientificName
(String scientificName) void
setSourceTaxonKey
(Integer sourceTaxonKey) void
setSpecies
(String species) void
setSpeciesKey
(Integer speciesKey) void
setSubgenus
(String subgenus) void
setSubgenusKey
(Integer subgenusKey) void
setTaxonID
(String taxonID) void
setTaxonomicStatus
(TaxonomicStatus taxonomicStatus) void
setVernacularName
(String vernacularName) toString()
-
Constructor Details
-
NameUsage
public NameUsage() -
NameUsage
-
-
Method Details
-
getNameKey
- Returns:
- the name key for retrieving a parsed name object
-
setNameKey
-
getSourceTaxonKey
For backbone taxa the source taxon key refers to the original name usage that was used during backbone building and is the primary reason that this taxon exists in the backbone.
All backbone name usages are built from several underlying checklist usages, but these are sorted by priority and the usage key for the highest priority one becomes the sourceTaxonKey for a backbone usage.
Some backbone usages do not have any source record altogether. For example if there is a subspecies found, but no matching parent species, the missing species will be created nevertheless and has no primary source.- Returns:
- The key of the name usage this backbone taxon is derived from.
-
setSourceTaxonKey
-
getAccepted
- Returns:
- the scientific name of the accepted name
-
setAccepted
Sets the scientific name of the basionym, i.e. original name usage. -
getAcceptedKey
- Returns:
- the name usage key of the accepted name
-
setAcceptedKey
Sets the usage key for the accepted name. -
getAccordingTo
The taxon concept reference is usually a reference to some publication or author and year.
The dwc:taxonAccordingTo reference is usually appended to the scientific name to further qualify the concept with "sensu" or "sec." being used for concatenation. E.g. "Acer nigrum sec. Gleason Cronquist 1991".
In the case of backbone taxa this refers to the primary checklist the name was found in.- Returns:
- the taxon concept reference
-
setAccordingTo
- Parameters:
accordingTo
- the accordingTo to set
-
getAuthorship
Returns the authorship information for the scientific name.- Returns:
- the authorship
-
setAuthorship
- Parameters:
authorship
- the authorship to set
-
getBasionym
- Returns:
- the scientific name of the basionym
-
setBasionym
sets the basionym name. -
getBasionymKey
Returns the earlier name (basionym) for this scientific name. Return null if the basionym does not exist.- Returns:
- the basionymKey
-
setBasionymKey
- Parameters:
basionymKey
- the basionymKey to set
-
getCanonicalName
- Returns:
- the canonicalName
-
setCanonicalName
- Parameters:
canonicalName
- the canonicalName to set
-
getDatasetKey
Returns the key of the checklist that "hosts" this name usage.- Returns:
- the datasetKey
-
setDatasetKey
- Parameters:
datasetKey
- the datasetKey to set
-
getKey
Return the key that uniquely identifies this name usage.- Returns:
- the key
-
setKey
- Parameters:
key
- the key to set
-
getNameType
- Returns:
- the type of name string classified by CLB.
-
setNameType
- Parameters:
nameType
- the type of name string
-
getNomenclaturalStatus
The status related to the conformance to the relevant rules of nomenclature.Example: "invalid", "misapplied", "homotypic synonym", "accepted"
- Returns:
- the set of known nomenclaturalStatus values
- See Also:
-
setNomenclaturalStatus
- Parameters:
nomenclaturalStatus
- the nomenclaturalStatus to set
-
getNubKey
- Returns:
- the taxon key of the matching backbone name usage
-
setNubKey
- Parameters:
nubKey
- the nubKey to set
-
getNumDescendants
The number of all accepted taxonomic elements under this usage.- Returns:
- the number of descendants
-
setNumDescendants
- Parameters:
numDescendants
- the n umber of descendants to set
-
getOrigin
The origin of this name usage record, i.e. the reason why it exists. In most cases this is because the record existed explicitly in the checklist sources, but some usages are created de novo because they exist implicitly in the data.- Returns:
- the name usage origin
- See Also:
-
setOrigin
- Parameters:
origin
- the origin to set
-
getParent
The scientific name of the parent.- Returns:
- the parent name
-
setParent
- Parameters:
parent
- the parent name to set
-
getParentKey
Returns the immediate parent. If this usage if for the highest taxonomic level, return null.- Returns:
- the parentKey
-
setParentKey
- Parameters:
parentKey
- the parentKey to set
-
getProParteKey
Pro parte synonyms, i.e. a synonym with multiple accepted names, are grouped by a single, primary name usage key.- Returns:
- the primary name usage key for a pro parte synonym or null
-
setProParteKey
Sets the pro parte usage key. -
getPublishedIn
Original publication for this name usage.- Returns:
- the publishedIn
-
setPublishedIn
- Parameters:
publishedIn
- the publishedIn to set
-
getRank
Returns the rank for this usage.Example: "Kingdom", "Genus"
- Returns:
- the rank
-
setRank
- Parameters:
rank
- the rank to set
-
getScientificName
The scientific name (with date and authorship information if applicable).Example: "Coleoptera" (order), "Vespertilionidae" (family), "Manis" (genus), "Ctenomys sociabilis" (genus + specific name), "Ambystoma tigrinum diaboli" (genus + specific name + infraspecific name), "Quercus agrifolia var. oxyadenia (Torr.)"
- Returns:
- the scientificName
-
setScientificName
- Parameters:
scientificName
- the scientificName to set
-
getConstituentKey
Return the optional sub dataset key for this usage.- Returns:
- the subDatasetKey or null
-
setConstituentKey
- Parameters:
constituentKey
- to set
-
getVernacularName
A common or vernacular name for this usage.Example: Andean Condor", "Condor Andino", "American Eagle", "Gänsegeier".
- Returns:
- the vernacularName
-
setVernacularName
- Parameters:
vernacularName
- the vernacularName to set
-
getKingdom
Description copied from interface:LinneanClassification
Return the kingdom for this usage. If the usage is for something above the "kingdom" taxonomic level, return null.- Specified by:
getKingdom
in interfaceLinneanClassification
- Returns:
- the kingdom
-
setKingdom
- Specified by:
setKingdom
in interfaceLinneanClassification
- Parameters:
kingdom
- the kingdom to set
-
getPhylum
Description copied from interface:LinneanClassification
Return the phylum for this usage. If the usage is for something above the "phylum" taxonomic level, return null.- Specified by:
getPhylum
in interfaceLinneanClassification
- Returns:
- the phylum
-
setPhylum
- Specified by:
setPhylum
in interfaceLinneanClassification
- Parameters:
phylum
- the phylum to set
-
getClazz
Description copied from interface:LinneanClassification
Return the class for this usage. If the usage is for something above the "class" taxonomic level, return null.- Specified by:
getClazz
in interfaceLinneanClassification
- Returns:
- the class
-
setClazz
- Specified by:
setClazz
in interfaceLinneanClassification
- Parameters:
clazz
- the clazz to set
-
getOrder
Description copied from interface:LinneanClassification
Return the order for this usage. If the usage is for something above the "order" taxonomic level, return null.- Specified by:
getOrder
in interfaceLinneanClassification
- Returns:
- the order
-
setOrder
- Specified by:
setOrder
in interfaceLinneanClassification
- Parameters:
order
- the order to set
-
getFamily
Description copied from interface:LinneanClassification
Return the family for this usage. If the usage is for something above the "family" taxonomic level, return null.- Specified by:
getFamily
in interfaceLinneanClassification
- Returns:
- the family
-
setFamily
- Specified by:
setFamily
in interfaceLinneanClassification
- Parameters:
family
- the family to set
-
getGenus
Description copied from interface:LinneanClassification
Return the genus for this usage. If the usage is for something above the "genus" taxonomic level, return null.- Specified by:
getGenus
in interfaceLinneanClassification
- Returns:
- the genus
-
setGenus
- Specified by:
setGenus
in interfaceLinneanClassification
- Parameters:
genus
- the genus to set
-
getSubgenus
Description copied from interface:LinneanClassification
Return the canonical subgenus name for this usage. If the usage is for something above the "subgenus" taxonomic level, return null.- Specified by:
getSubgenus
in interfaceLinneanClassification
- Returns:
- the subgenus name
-
setSubgenus
- Specified by:
setSubgenus
in interfaceLinneanClassification
- Parameters:
subgenus
- the subgenus canonical name
-
getSpecies
Description copied from interface:LinneanClassification
Return the species for this usage. If the usage is for something above the "species" taxonomic level, return null.- Specified by:
getSpecies
in interfaceLinneanClassification
- Returns:
- the species
-
setSpecies
- Specified by:
setSpecies
in interfaceLinneanClassification
- Parameters:
species
- the species to set
-
getKingdomKey
Description copied from interface:LinneanClassificationKeys
Return the kingdom key for this usage. If the usage is for something above the "kingdom" taxonomic level, return null.- Specified by:
getKingdomKey
in interfaceLinneanClassificationKeys
- Returns:
- the kingdomKey
-
setKingdomKey
- Specified by:
setKingdomKey
in interfaceLinneanClassificationKeys
- Parameters:
kingdomKey
- the kingdomKey to set
-
getPhylumKey
Description copied from interface:LinneanClassificationKeys
Return the phylum key for this usage. If the usage is for something above the "phylum" taxonomic level, return null.- Specified by:
getPhylumKey
in interfaceLinneanClassificationKeys
- Returns:
- the phylumKey
-
setPhylumKey
- Specified by:
setPhylumKey
in interfaceLinneanClassificationKeys
- Parameters:
phylumKey
- the phylumKey to set
-
getClassKey
Description copied from interface:LinneanClassificationKeys
Return the class key for this usage. If the usage is for something above the "class" taxonomic level, return null.- Specified by:
getClassKey
in interfaceLinneanClassificationKeys
- Returns:
- the classKey
-
setClassKey
- Specified by:
setClassKey
in interfaceLinneanClassificationKeys
- Parameters:
classKey
- the classKey to set
-
getOrderKey
Description copied from interface:LinneanClassificationKeys
Return the order key for this usage. If the usage is for something above the "order" taxonomic level, return null.- Specified by:
getOrderKey
in interfaceLinneanClassificationKeys
- Returns:
- the orderKey
-
setOrderKey
- Specified by:
setOrderKey
in interfaceLinneanClassificationKeys
- Parameters:
orderKey
- the orderKey to set
-
getFamilyKey
Description copied from interface:LinneanClassificationKeys
Return the family key for this usage. If the usage is for something above the "family" taxonomic level, return null.- Specified by:
getFamilyKey
in interfaceLinneanClassificationKeys
- Returns:
- the familyKey
-
setFamilyKey
- Specified by:
setFamilyKey
in interfaceLinneanClassificationKeys
- Parameters:
familyKey
- the familyKey to set
-
getGenusKey
Description copied from interface:LinneanClassificationKeys
Return the genus key for this usage. If the usage is for something above the "genus" taxonomic level, return null.- Specified by:
getGenusKey
in interfaceLinneanClassificationKeys
- Returns:
- the genusKey
-
setGenusKey
- Specified by:
setGenusKey
in interfaceLinneanClassificationKeys
- Parameters:
genusKey
- the genusKey to set
-
getSubgenusKey
Description copied from interface:LinneanClassificationKeys
Return the subgenus key for this usage. If the usage is for something above the "subgenus" taxonomic level, return null.- Specified by:
getSubgenusKey
in interfaceLinneanClassificationKeys
- Returns:
- subgenusKey
-
setSubgenusKey
- Specified by:
setSubgenusKey
in interfaceLinneanClassificationKeys
- Parameters:
subgenusKey
- the subgenus usage key
-
getSpeciesKey
Description copied from interface:LinneanClassificationKeys
Return the species key for this usage. If the usage is for something above the "species" taxonomic level, return null.- Specified by:
getSpeciesKey
in interfaceLinneanClassificationKeys
- Returns:
- the speciesKey
-
setSpeciesKey
- Specified by:
setSpeciesKey
in interfaceLinneanClassificationKeys
- Parameters:
speciesKey
- the speciesKey to set
-
getRemarks
-
setRemarks
-
getCanonicalOrScientificName
- Returns:
- the canonicalName or scientific name in case its null
-
getReferences
A URI link or reference to the source of this record, the record's "homepage".Example: https://www.catalogueoflife.org/data/taxon/4R5YN
- Returns:
- the link
-
setReferences
-
getHigherRank
Description copied from interface:LinneanClassification
Gets a higher taxon property by passing the rank of it. Only Linnean ranks are supported.- Specified by:
getHigherRank
in interfaceLinneanClassification
- Parameters:
rank
- the higher linnean rank to retrieve- Returns:
- the name of the higher taxon or null if rank doesnt exist
-
getHigherRankKey
Description copied from interface:LinneanClassificationKeys
Gets a higher taxon key by passing the rank of it. Only Linnean ranks are supported.- Specified by:
getHigherRankKey
in interfaceLinneanClassificationKeys
- Parameters:
rank
- the higher linnean rank to retrieve- Returns:
- the key of the higher taxon or null if rank doesnt exist
-
getHigherClassificationMap
An ordered map with entries for all higher Linnean ranks down to the actual direct parent of this usage. The map starts with the highest rank, e.g. the kingdom and maps the name usage key to its canonical name. The name usage itself is never included, even though a higher rank might point to the usage itself.- Returns:
- map of higher ranks
-
getTaxonID
The original taxonID of the name usage as found in the source. For backbone taxa and name usages with an origin different to SOURCE this is null. -
getTaxonomicStatus
The taxonomic status of the name usage. Can be null, but for all synonyms with an accepted name usage it is guaranteed to exist.- Returns:
- the taxonomicStatus, can be null
-
setTaxonomicStatus
- Parameters:
taxonomicStatus
- the taxonomicStatus to set
-
getModified
The interpreted dc:modified from the verbatim source data. Ideally indicating when a record was last modified in the source. -
setModified
-
getDeleted
The date this record was deleted. Logical deletions only occur for backbone usages! -
setDeleted
-
getLastCrawled
The date this record was last crawled during clb indexing. -
setLastCrawled
-
getLastInterpreted
The date this record was last interpreted during indexing. This includes matching to the backbone. -
setLastInterpreted
-
getIssues
-
setIssues
-
addIssue
-
isNub
-
isProParte
True for pro parte synonyms with multiple accepted usages.- Returns:
- true if proParte, false otherwise
-
isSynonym
Convenience method using the taxonomicStatus field.- Returns:
- true if it's a synonym
-
setTaxonID
-
equals
-
hashCode
-
toString
-