TaxonomicUnitWrapper

Source: TaxonomicUnitWrapper.js:39

The TaxonomicUnitWrapper wraps taxonomic units, whether on a node or being used as a specifier on a phyloreference. Every taxonomic unit can additionally be wrapped by more specific classes, such as TaxonConceptWrapper or SpecimenWrapper. We can determine which type it is based on its '@type' and whether it includes:

  • TaxonomicUnitWrapper.TYPE_TAXON_CONCEPT => TaxonConceptWrapper
  • TaxonomicUnitWrapper.TYPE_SPECIMEN => SpecimenWrapper
  • TaxonomicUnitWrapper.TYPE_APOMORPHY => reserved for future use
  • TaxonomicUnitWrapper.TYPE_PHYLOREF => reserved for future use

It also contains static methods for extracting taxonomic units from arbitrary strings, such as phylogeny labels.

Every taxonomic unit SHOULD have an rdfs:label and MAY include a dcterm:description to describe it in human-readable terms. It MUST include a '@type' that specifies what type of taxonomic unit it is.

Taxonomic units may be specified with only an '@id' or a set of '@id's, which indicate external references.


Constructor

new TaxonomicUnitWrapper( tunit, defaultNomenCode, ): TaxonomicUnitWrapper

Wrap a taxonomic unit.


Static Methods

normalize(tunit)

Normalize the specified taxonomic unit.

Parameters

  • tunit — A taxonomic unit to be normalized.

fromLabel()

Given a label, attempt to parse it into a taxonomic unit, whether a scientific name or a specimen identifier. The provided nomenclatural code is used.

Returns

  • A taxonomic unit that this label could be parsed as.

Instance Fields

types

What type of specifier is this? This is an array that could contain multiple classes, but should contain one of:

  • TYPE_TAXON_CONCEPT
  • TYPE_SPECIMEN

taxonConcept

Return this taxonomic unit if it is a taxon concept.

specimen

Return this taxonomic unit if it is a specimen.

externalReferences

Return the list of external references for this taxonomic unit. This is just all the '@ids' of this object.

label

Return the label of this taxonomic unit.

asJSON

Return the JSON representation of this taxonomic unit, i.e. the object we're wrapping.

asJSONLD

Return this taxonomic unit as an OWL/JSON-LD object.

asOWLEquivClass

Return the equivalent class expression for this taxonomic unit.

Static Fields

TYPE_TAXON_CONCEPT

A taxon or taxon concept.

TYPE_SPECIMEN

A specimen.