Download User manual - Tethys Metadata
Transcript
English, French, Galibi, German, Greek, Hausa, Hawaiian, Hindi, Icelandic, Japanese, Portuguese, and
Spanish. However, not all entries are supported equally, and English is by far the most complete with
some languages having only a few entries. When a vernacular name does not exist, the Latin name is
returned. In rare instances, ITIS contains multiple vernacular names for the same species. In such cases,
the first name is returned. As an example, Orcinus orca has both Killer Whale and orca as English
vernacular names, but the functions described here will always return Killer Whale for the English
vernacular name.
In order to use these functions, an XQuery must include the following line of code prior to FLWR query:
import module namespace lib="http://tethys.sdsu.edu/XQueryFns" at "Tethys.xq";
The namespace indicates a prefix that will be used before each function. In the example above, to
invoke function tsn2completename, one would write lib:tsn2completename. The namespace could
have been any valid label, for instance as most of the routines in this module deal with ITIS taxonomic
serial number (TSN) translation, we might have used:
import module namespace tsn="http://tethys.sdsu.edu/XQueryFns" at "Tethys.xq";
Subroutines names are presented without a namespace, but some namespace is required. Note that we
do not describe all functions in Tethys.xq, but rather the ones that Tethys users are most likely to find
helpful. Many of the client queries wrap the results of queries in one of these functions to change TSNs
into strings.
AbrrevationMapExists(abbrevmap) – Does a specified abbreviation map exist?
e.g. lib:AbbreviationMapExists("NOAA.NMFS.v1") → true
abbrev2completename(abbrev, abbrevmap) – Convert an abbreviation to a Latin name
The function accepts two strings, abbreviation and the abbreviation map that is to be used.
e.g. lib: abbrev2completename("Oo", "NOAA.NMFS.v1") → Orcinus orca
abbrev2group(abbrev, abbrevmap) – Find the group associated with a specific abbreviation.
Group is an attribute that is sometimes used with species to denote additional information. As an
example, there are currently a number of echolocation clicks that we believe are produced by
beaked whales, but it is unclear which species of beaked whale produced them. We set up an
abbreviation map for each type, e.g. BWC for beaked whales observed at Cross SeaMount, and set
the species to family Hyperoodontidae.
abbrev2tsn(abbrev, abbrevmap) – Conver an abbreviation to a TSN.
The function accepts two strings, and abbreviation and the abbreviation map name.
e.g. lib:abbrev2tsn("Oo", "NOAA.NMFS.v1") → 180469.
completename2tsn(name) – Translate a Latin name to a TSN
e.g. completename2tsn("Orcinus orca") → 180469.
tsn2completename(tsnnodes) – Convert a TSN to a “complete” (Latin) name.
tsnnodes must a list of tsn nodes that each have an integer value, e.g. a SpeciesID from a detection
document.
tsn2vernacular(tsnnodes, language) – Convert a TSN to a vernacular name
tsnnodes must a list of tsn nodes that each have an integer value, e.g. a SpeciesID from a detection
document. The argument language must be a string for a language that is supported by ITIS.
Tethys Metadata
Page 98