Home Manual Reference Source Test
import {TaxonNameWrapper} from '@phyloref/phyx/src/wrappers/TaxonNameWrapper.js'
public class | source

TaxonNameWrapper

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.

Static Member Summary

Static Public Members
public static get
public static get
public static get
public static get
public static get
public static get

The type associated with these taxonName objects.

public static get

The IRI for an unknown nomenclatural code (i.e.

Static Method Summary

Static Public Methods
public static

fromVerbatimName(verbatimName: *, nomenCode: *): *

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

public static

getNomenCodeDetails(nomenCode: *): *

Returns the nomenclatural code entry for a code.

public static

Return a list of all supported nomenclatural code.

Constructor Summary

Public Constructor
public

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

Member Summary

Public Members
public get

Return this taxon name in an JSON-LD representation.

public get

asOWLEquivClass: {"@type": string, "intersectionOf": *}

Return this taxon name as an OWL equivalentClass expression.

public get

Return the binomial name if available.

public set

Set the binomial name.

public
public get

Return the genus part of this scientific name if available.

public set

Set the genus part of this name.

public get

Return the infraspecific epithet of this scientific name if available.

public set

Set the infraspecificEpithet part of this name.

public get

label: *

Return the label of this scientific name.

public set

Set the label of this scientific name.

public get
public set

Set the complete name.

public get

Returns the nomenclatural code of this taxon name.

public set

Set the nomenclatural code of this taxon name.

public get

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

public get

Return the specific epithet of this scientific name if available.

public set

Set the specificEpithet part of this name.

public get

Return the trinomial name if available.

public set

Set the trinomial name.

public

txname: *

public get

Return the uninomial name if there is one.

public set

Set the uninomial name.

public get

Return the verbatim name of this taxon name.

Static Public Members

public static get ICNCP_CODE: * source

public static get ICNP_CODE: * source

public static get ICN_CODE: * source

public static get ICTV_CODE: * source

public static get ICZN_CODE: * source

public static get TYPE_TAXON_NAME: * source

The type associated with these taxonName objects.

public static get UNKNOWN_CODE: * source

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

Static Public Methods

public static fromVerbatimName(verbatimName: *, nomenCode: *): * source

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

Params:

NameTypeAttributeDescription
verbatimName *
nomenCode *
  • optional

Return:

*

public static getNomenCodeDetails(nomenCode: *): * source

Returns the nomenclatural code entry for a code.

Params:

NameTypeAttributeDescription
nomenCode *

Return:

*

public static getNomenclaturalCodes(): undefined[] source

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.

Return:

undefined[]

Public Constructors

public constructor() source

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

Public Members

public get asJSONLD: * source

Return this taxon name in an JSON-LD representation.

public get asOWLEquivClass: {"@type": string, "intersectionOf": *} source

Return this taxon name as an OWL equivalentClass expression.

public get binomialName: string source

Return the binomial name if available.

public set binomialName source

Set the binomial name.

public defaultNomenCode: * source

public get genusPart: * source

Return the genus part of this scientific name if available.

public set genusPart source

Set the genus part of this name.

public get infraspecificEpithet: * source

Return the infraspecific epithet of this scientific name if available.

public set infraspecificEpithet source

Set the infraspecificEpithet part of this name.

public get label: * source

Return the label of this scientific name.

public set label source

Set the label of this scientific name.

public get nameComplete: * source

public set nameComplete source

Set the complete name. To do this, we re-parse the provided name.

public get nomenclaturalCode: * source

Returns the nomenclatural code of this taxon name.

public set nomenclaturalCode source

Set the nomenclatural code of this taxon name.

public get nomenclaturalCodeDetails: * source

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

public get specificEpithet: * source

Return the specific epithet of this scientific name if available.

public set specificEpithet source

Set the specificEpithet part of this name.

public get trinomialName: string source

Return the trinomial name if available.

public set trinomialName source

Set the trinomial name.

public txname: * source

public get uninomial: * source

Return the uninomial name if there is one.

public set uninomial source

Set the uninomial name.

public get verbatimName: * source

Return the verbatim name of this taxon name.