| td_validate | R Documentation |
Check a taxadb table against the taxadb Darwin Core rules
td_validate(
provider = getOption("taxadb_default_provider", "itis"),
schema = c("dwc", "common"),
version = latest_version(),
db = td_connect()
)
provider |
from which provider should the hierarchy be returned?
Default is 'itis', which can also be configured using |
schema |
One of "dwc" (for Darwin Core data) or "common" (for the Common names table.) |
version |
Which version of the taxadb provider database should we use?
defaults to latest. See |
db |
a connection to the taxadb database. See details. |
The rules checked are:
columns – the required Darwin Core terms are present, spelled in Darwin Core camelCase.
types – identifier and name columns are character. A column that
is entirely NA will often be typed as integer or logical by mistake,
which this catches.
scientificName – never NA. Every row names something, at every
rank: Animalia is a scientificName just as Homo sapiens is.
taxonRank, taxonomicStatus – never NA.
acceptedNameUsageID – never NA, on synonyms and on accepted
names. This is where taxadb is stricter than Darwin Core.
accepted_has_id – a row labelled accepted is its own accepted
name: taxonID is present and equals acceptedNameUsageID.
(taxonID may be NA on a synonym, where the provider mints no
identifier for it – OTT and NCBI, for instance, do not.)
accepted_resolves – every acceptedNameUsageID matches the
taxonID of a self-referencing row. No dangling references.
synonym_not_self – a row labelled a synonym points somewhere else, never at itself.
taxonID_one_name – a taxonID always names the same
scientificName. An identifier may appear on more than one row: ITIS
records 255 synonyms that are ambiguous between two accepted taxa, and
a row for each is the honest representation. What must not happen is
one identifier naming two different names, which is what results
from a provider numbering its accepted names and its synonyms in
separate sequences and both being given the same prefix.
accepted_unique – no duplicate taxonID among accepted names.
id_prefix – identifiers are the provider's identifier prefixed by
the provider abbreviation in capitals, e.g. ITIS:180092.
taxonomicStatus is deliberately not checked against a controlled
vocabulary: providers draw real distinctions (homotypic synonym,
provisionally accepted, doubtful, misapplied) that are worth
preserving. The rules are therefore phrased structurally. A name the
provider does not redirect to another name is its own accepted name
whatever confidence it expresses about it, so doubtful and
provisionally accepted rows self-reference exactly as accepted ones
do; only the two terms whose meaning taxadb actually relies on,
accepted and synonym, are given a required shape.
a data.frame with one row per rule, giving whether the table
passes, how many rows violations were found, and a note.
td_validate("itis_test")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.