import {TaxonNameWrapper} from '@phyloref/phyx/src/wrappers/TaxonNameWrapper.js'
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 |
ICNCP_CODE: * |
|
public static get |
ICNP_CODE: * |
|
public static get |
ICN_CODE: * |
|
public static get |
ICTV_CODE: * |
|
public static get |
ICZN_CODE: * |
|
public static get |
The type associated with these taxonName objects. |
|
public static get |
UNKNOWN_CODE: * 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 |
asJSONLD: * 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 |
genusPart: * 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 |
nameComplete: * |
|
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 |
uninomial: * Return the uninomial name if there is one. |
|
public set |
Set the uninomial name. |
|
public get |
verbatimName: * 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 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:
Name | Type | Attribute | Description |
verbatimName | * | ||
nomenCode | * |
|
Return:
* |
public static getNomenCodeDetails(nomenCode: *): * source
Returns the nomenclatural code entry for a code.
Params:
Name | Type | Attribute | Description |
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.
Public Constructors
public constructor() source
Create a new taxon name wrapper around the JSON representation of a taxon name.
Public Members
public get asOWLEquivClass: {"@type": string, "intersectionOf": *} source
Return this taxon name as an OWL equivalentClass expression.
public defaultNomenCode: * source
public get infraspecificEpithet: * source
Return the infraspecific epithet of this scientific name if available.
public get nameComplete: * source
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.