TaxonNameWrapper

Source: TaxonNameWrapper.js:39

Wraps a taxon name to provide access to components of the taxon name. This is based on the TDWG TaxonName standard, as at https://github.com/tdwg/ontology/blob/master/ontology/voc/TaxonName.rdf.

Every instance of this class is expected to have some combination of the following fields:

  • rdfs:label -- the verbatim taxon name
  • nameComplete -- the complete uninomial, binomial or trinomial name.
  • nomenclaturalCode -- the nomenclatural code under which the complete name should be interpreted.

We will also read the following fields if they are present:

  • uninomial: The uninomial name of this taxon, if one is present.
  • genusPart: The genus name.
  • specificEpithet: The specific epithet.
  • infraspecificEpithet: The infraspecific epithet.

We wrap whatever we're given, so we won't assume that these fields are actually consistent with each other. However, when one of these fields are set, we overwrite the nameComplete to ensure that they are consistent. Similarly, changing the nameComplete will overwrite the genusPart, specificEpithet and infraspecificEpithet.

Note that the TaxonName ontology recommends dc:title instead of rdfs:label; however, I like the idea of using dc:title for documents and rdfs:label for vocabulary terms, so I'm okay with using rdfs:label for the verbatim name.


Constructor

new TaxonNameWrapper(txname, defaultNomenCode): TaxonNameWrapper

Create a new taxon name wrapper around the JSON representation of a taxon name.


Static Methods

getNomenclaturalCodes()

Return a list of all supported nomenclatural code. Each entry will have the following keys:

  • code: A list of short names that can be used to represent this nomenclatural code.
  • label: An informal name of this nomenclatural code in English.
  • title: The formal name of this nomenclatural code in English.
  • iri: The IRI of this nomenclatural code.

This will be used in drawing user interfaces, so this should be in order of likelihood of use.

getNomenCodeDetails()

Returns the nomenclatural code entry for a code.

normalize(txname)

Normalize the specified taxon name.

Parameters

  • txname — A taxon name to be normalized.

fromVerbatimName()

Parses a verbatim taxon name into an (unwrapped) TaxonName.

Instance Fields

nomenclaturalCode

Returns the nomenclatural code of this taxon name.

nomenclaturalCodeDetails

Returns the nomenclatural code of this taxon name as a IRI.

label

Return the label of this scientific name.

verbatimName

Return the verbatim name of this taxon name.

nameComplete

Return the complete name (i.e. the uninomial, binomial or trinomial name without authority information). Setting this re-parses the provided name.

uninomial

Return the uninomial name if there is one.

binomialName

Return the binomial name if available.

trinomialName

Return the trinomial name if available.

genusPart

Return the genus part of this scientific name if available.

specificEpithet

Return the specific epithet of this scientific name if available.

infraspecificEpithet

Return the infraspecific epithet of this scientific name if available.

asJSONLD

Return this taxon name in an JSON-LD representation.

asOWLEquivClass

Return this taxon name as an OWL equivalentClass expression.

Static Fields

TYPE_TAXON_NAME

The type associated with these taxonName objects.

UNKNOWN_CODE

The IRI for an unknown nomenclatural code (i.e. all we know is that it's a scientific name).