coldp

package
v0.5.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 2, 2026 License: MIT Imports: 23 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DataTypeToString = func() map[DataType]string {
	res := make(map[DataType]string)
	for k, v := range StringToDataType {
		res[v] = k
	}
	res[UnkownDT] = "Unknown"
	return res
}()

DataTypeToString maps DataType to string.

View Source
var LowCaseToDataType = func() map[string]DataType {
	res := make(map[string]DataType)
	for k, v := range StringToDataType {
		res[strings.ToLower(k)] = v
	}
	return res
}()

LowCaseToDataType provides map of low-case strings to DataType.

View Source
var StringToDataType = map[string]DataType{
	"Author":               AuthorDT,
	"NameRelation":         NameRelationDT,
	"Taxon":                TaxonDT,
	"Synonym":              SynonymDT,
	"NameUsage":            NameUsageDT,
	"Name":                 NameDT,
	"TaxonProperty":        TaxonPropertyDT,
	"TaxonConceptRelation": TaxonConceptRelationDT,
	"SpeciesInteraction":   SpeciesInteractionDT,
	"SpeciesEstimate":      SpeciesEstimateDT,
	"Reference":            ReferenceDT,
	"ReferenceJson":        ReferenceJsonDT,
	"ReferenceBibTex":      ReferenceBibtexDT,
	"TypeMaterial":         TypeMaterialDT,
	"Distribution":         DistributionDT,
	"Media":                MediaDT,
	"VernacularName":       VernacularNameDT,
	"Treatment":            TreatmentDT,
}

StringToDataType maps strings to DataTypes.

Functions

func NormalizeHeaders

func NormalizeHeaders(headers []string) map[string]int

NormalizeHeaders attempts to normalize DarwinCore and ColDP terms to headers that correspond to ColDP. The headers are lowcase.

func Read

func Read[T DataLoader](
	cfg config.Config,
	path string,
	chOut chan T) error

func ReadJSON

func ReadJSON[T DataLoader](
	path string,
	chIn chan T) error

func ReadJSONL

func ReadJSONL[T DataLoader](
	path string,
	chIn chan T) error

func RowToMap

func RowToMap(headers, row []string) (map[string]string, error)

func ToBool

func ToBool[T string | bool | int](val T) sql.NullBool

ToBool attempts to convert a value to a sql.NullBool, handling both string and bool input types.

func ToFloat

func ToFloat[T string | float64 | int](val T) sql.NullFloat64

ToFloat attempts to convert a value to a sql.NullFloat64, handling string, float64, and int input types.

func ToInt

func ToInt[T string | int](val T) sql.NullInt64

ToInt attempts to convert a value to a sql.NullInt64, handling both string and int input types.

func ToStr

func ToStr(s string) string

ToStr normalizes enumerated string IDs to 'normal' strings. For example 'PROVISIONALLY_ACCEPTED' becomes 'provisionally accepted'.

func ToTitleCase

func ToTitleCase(s string) string

func Write

func Write[T DataWriter](
	ctx context.Context,
	ch <-chan T,
	path string,
) error

Types

type Actor

type Actor struct {
	Orcid        string `yaml:"orcid,omitempty"        json:"orcid,omitempty"`
	Given        string `yaml:"given,omitempty"        json:"given,omitempty"`
	Family       string `yaml:"family,omitempty"       json:"family,omitempty"`
	Email        string `yaml:"email,omitempty"        json:"email,omitempty"`
	City         string `yaml:"city,omitempty"         json:"city,omitempty"`
	State        string `yaml:"state,omitempty"        json:"state,omitempty"`
	Country      string `yaml:"country,omitempty"      json:"country,omitempty"`
	RorID        string `yaml:"rorid,omitempty"        json:"rorid,omitempty"`
	Department   string `yaml:"department,omitempty"   json:"department,omitempty"`
	Organization string `yaml:"organisation,omitempty" json:"organisation,omitempty"`
	URL          string `yaml:"url,omitempty"          json:"url,omitempty"`
	Note         string `yaml:"note,omitempty"         json:"note,omitempty"`
}

Actor represents an individual or organization.

type Affiliation

type Affiliation struct {
}

type Archive

type Archive interface {
	arch.Packager

	// DirInfo finds where data and metadata files are located.
	// It also determines if metadata is provided in JSON or YAML
	// format.
	DirInfo() error

	// DataPaths returns a map where a low-case name of a data type is a key and
	// the path to the corresponding file is the value.
	DataPaths() map[DataType]string

	// Config returns configuration settings of archive.
	Config() config.Config

	// Meta returns coldp.Meta struct. If the struct is empty it populates
	// it with data from meta file first.
	Meta() (*Meta, error)

	// WriteMeta writes Meta data to the given path as JSON.
	WriteMeta(meta *Meta, path string) error
}

type ArchiveType

type ArchiveType int

ArchiveType provides type of CoLDP. Can be 'flat' or NameUsage, and 'original' or Name.

const (
	UnknownAT   ArchiveType = iota
	NameAT                  // Represents an archive with Name data.
	NameUsageAT             // Represents an archive with NameUsage data.
)

Constants for different archive types.

type Author

type Author struct {
	// ID is the unique identifier for this author.
	ID string
	// SourceID is the identifier of the source database for this author.
	SourceID string
	// AlternativeID is an alternative identifier for this author.
	AlternativeID string
	// Given is the author's given name(s).
	Given string
	// Family is the author's family name.
	Family string
	// Suffix is any suffix associated with the author's name (e.g., Jr., III).
	Suffix string
	// AbbreviationBotany is the standard botanical abbreviation for this author.
	AbbreviationBotany string
	// AlternativeNames lists any alternative names or spellings for this author.
	AlternativeNames string
	// Sex is the author's sex.
	Sex Sex
	// Country is the author's country of origin or residence.
	Country string
	// Birth is the author's date of birth.
	Birth string
	// BirthPlace is the author's place of birth.
	BirthPlace string
	// Death is the author's date of death.
	Death string
	// Affiliation is the author's institutional affiliation.
	Affiliation string
	// Interest describes the author's research interests or areas of expertise.
	Interest string
	// ReferenceID is the identifier of a reference related to this author.
	ReferenceID string
	// Link is a link to more information about this author.
	Link string
	// Remarks are any remarks about this author.
	Remarks string
	// Modified is the date when this author's information was last modified.
	Modified string
	// ModifiedBy is the user who last modified this author's information.
	ModifiedBy string
}

Author represents an author of a scientific name or publication.

func (Author) Headers

func (a Author) Headers() []string

func (Author) Load

func (a Author) Load(headers, data []string) (DataLoader, error)

Load populates the Author data from a row of data.

func (Author) Row

func (a Author) Row() []string

Row returns the Author data as a slice of strings.

type AuthorCSL

type AuthorCSL struct {
	Given        string        `json:"given,omitempty"`
	Family       string        `json:"family,omitempty"`
	Sequence     string        `json:"sequence,omitempty"`
	Affiliations []Affiliation `json:"affiliation,omitempty"`
}

type CSL

type CSL struct {
	ID                  string        `json:"id"`
	Publisher           string        `json:"publisher,omitempty"`
	Issue               string        `json:"issue,omitempty"`
	PublishedPrint      *Date         `json:"published-print,omitempty"`
	DOI                 string        `json:"DOI,omitempty"`
	Type                string        `json:"type,omitempty"`
	Created             *Date         `json:"created,omitempty"`
	Page                string        `json:"page,omitempty"`
	Source              string        `json:"source,omitempty"`
	Title               string        `json:"title,omitempty"`
	Prefix              string        `json:"prefix,omitempty"`
	Volume              string        `json:"volume,omitempty"`
	Authors             []AuthorCSL   `json:"author,omitempty"`
	ContainerTitle      string        `json:"container-title,omitempty"`
	ContainerTitleShort any           `json:"container-title-short,omitempty"`
	OriginalTitle       any           `json:"original-title,omitempty"`
	Language            string        `json:"language,omitempty"`
	Links               []Link        `json:"link,omitempty"`
	Deposited           *Date         `json:"deposited,omitempty"`
	Subtitle            any           `json:"subtitle,omitempty"`
	ShortTitle          any           `json:"short-title,omitempty"`
	Issued              *Date         `json:"issued,omitempty"`
	JournalIssue        *JournalIssue `json:"journal-issue,omitempty"`
	URL                 string        `json:"URL,omitempty"`
	ISSN                any           `json:"ISSN,omitempty"`
	Subject             any           `json:"subject,omitempty"`
}

func (CSL) ToReference

func (c CSL) ToReference() DataLoader

type CSLRecords

type CSLRecords []CSL

type Data

type Data struct {
	NameUsages    []NameUsage
	Distributions []Distribution
	References    []Reference
	Vernaculars   []Vernacular
}

Data can be used when we conversion from one format to another does correspond to several structs in coldp. SQLite is not very good and concurrent writes, and this structure allows us to keep data writes sequential.

type DataLoader

type DataLoader interface {
	Load(header, row []string) (DataLoader, error)
}

type DataType

type DataType int

DataType provides types of data files in CoLDP archive. It is used to convert a file name to the type of information provided in that file.

const (
	UnkownDT DataType = iota
	AuthorDT
	DistributionDT
	MediaDT
	NameDT
	NameRelationDT
	NameUsageDT
	ReferenceDT
	ReferenceJsonDT
	ReferenceBibtexDT
	SpeciesEstimateDT
	SpeciesInteractionDT
	SynonymDT
	TaxonConceptRelationDT
	TaxonDT
	TaxonPropertyDT
	TreatmentDT
	TypeMaterialDT
	VernacularNameDT
)

Constants for different data types.

func NewDataType

func NewDataType(s, ext string) DataType

NewDataType creates a new DataType from a string representation.

func (DataType) FileFormats

func (dt DataType) FileFormats() []FileType

FileFormats returns a list of supported file formats for a given DataType.

func (DataType) ID

func (dt DataType) ID() string

ID returns the string ID of the DataType.

func (DataType) String

func (dt DataType) String() string

String returns the string representation of the DataType.

type DataWriter

type DataWriter interface {
	Headers() []string
	Row() []string
}

type Date

type Date struct {
	DateParts []DatePart `json:"date-parts,omitempty"`
	DateTime  string     `json:"date-time,omitempty"`
	Timestamp string     `json:"timestamp,omitempty"`
}

type DatePart

type DatePart struct {
	Date []string
}

type DistrStatus

type DistrStatus int
const (
	UnknownDistSt DistrStatus = iota
	Native
	Domesticated
	Alien
	Uncertain
)

func NewDistrStatus

func NewDistrStatus(s string) DistrStatus

func (DistrStatus) ID

func (ds DistrStatus) ID() string

ID return the string ID of DistrStatus.

func (DistrStatus) String

func (ds DistrStatus) String() string

String return the string representation of DistrStatus.

type Distribution

type Distribution struct {
	// TaxonID for the distribution.
	TaxonID string

	// Source (from metadata) for distrubution data.
	SourceID string

	// Area is the geographic area this distribution record is about. The value
	// provides a human label for the area specified by areaID. Free text values
	// can be provided here when the gazetteer is set to TEXT
	Area string

	// AreaID is the identifier/code for the geographic area this distribution
	// record is about. The value must be taken from the gazetteer this record
	// declares. E.g. country codes, TDWG codes or TEOW identifiers. If the TEXT
	// gazetteer is used only the free text area should be given with no areaID.
	AreaID string

	// Gezetteer is the geographic gazetteer the area is defined in. If none is
	// given defaults to free TEXT.
	Gazetteer GazetteerEnt

	// Status of the distribution.
	Status DistrStatus

	// ReferenceID to the corresponding reference.
	ReferenceID string

	// Remarks are notes to the data.
	Remarks string

	// Modified timestamp.
	Modified string

	// ModifiedBy contains name of a person who added/updated the record.
	ModifiedBy string
}

Distribution of a taxon in a given area.

func (Distribution) Headers

func (d Distribution) Headers() []string

func (Distribution) Load

func (d Distribution) Load(headers, data []string) (DataLoader, error)

func (Distribution) Row

func (d Distribution) Row() []string

type Environment

type Environment int

Environment represents the environment type of a taxon.

const (
	UnknownEnv  Environment = iota
	Brackish                // Living in brackish water (mix of fresh and salt water).
	Freshwater              // Living in freshwater.
	Marine                  // Living in saltwater.
	Terrestrial             // Living on land.
)

Constants for different environment types.

func GetEnvironments

func GetEnvironments(env string) []Environment

func NewEnvironment

func NewEnvironment(s string) Environment

NewEnvironment creates a new Environment from a string representation.

func (Environment) ID

func (e Environment) ID() string

ID returns string ID of the Environment.

func (Environment) String

func (e Environment) String() string

String returns the string representation of the Environment.

type ErrBadDir

type ErrBadDir struct {
	Dir string
}

ErrBadDir is returned when the directory is in an unknown state, or is not a directory.

func (*ErrBadDir) Error

func (e *ErrBadDir) Error() string

type ErrUnzip

type ErrUnzip struct {
	Path string
	Err  error
}

ErrUnzip is returned when the extraction of the ColDP file fails.

func (*ErrUnzip) Error

func (e *ErrUnzip) Error() string

type ErrorFileMissing

type ErrorFileMissing struct {
	Path string
}

func (*ErrorFileMissing) Error

func (e *ErrorFileMissing) Error() string

type EstimateType

type EstimateType int
const (
	UnknownET EstimateType = iota
	SpeciesExtinct
	SpeciesLiving
	EstimatedSpecies
)

func NewEstimateType

func NewEstimateType(s string) EstimateType

func (EstimateType) ID

func (et EstimateType) ID() string

ID returns the string ID of EstimatedType.

func (EstimateType) String

func (et EstimateType) String() string

String returns the string representation of EstimatedType.

type FieldNumberWarning

type FieldNumberWarning struct {
	FieldsNum, RowFieldsNum int
	Row                     []string
	Message                 string
}

func (*FieldNumberWarning) Error

func (w *FieldNumberWarning) Error() string

type FileType

type FileType int

FileType represents the type of file.

const (
	UnknownFileType FileType = iota
	JSON
	YAML
	CSV
	TSV
	// pipe-separated file
	PSV
	// json-based Citation Style Language
	JSONCSL
	BIBTEX
)

Constants for different file types.

type GazetteerEnt

type GazetteerEnt int
const (
	UnknownGz GazetteerEnt = iota
	TDWG
	ISO
	FAO
	LONGHURST
	TEOW
	IHO
	MRGID
	TextGz
)

func NewGazetteerEnt

func NewGazetteerEnt(s string) GazetteerEnt

func (GazetteerEnt) ID

func (g GazetteerEnt) ID() string

ID returns the string ID of GazetteerEnt.

func (GazetteerEnt) String

func (g GazetteerEnt) String() string

String returns the string representation of GazetteerEnt.

type Gender

type Gender int

Gender represents the grammatical gender of a scientific name.

const (
	UnknownG Gender = iota
	Masculine
	Feminine
	Neutral
)

Constants for different grammatical genders.

func NewGender

func NewGender(s string) Gender

NewGender creates a new Gender from a string representation.

func (Gender) ID

func (g Gender) ID() string

ID returns string ID for Gender.

func (Gender) String

func (g Gender) String() string

String returns the string representation of the gender.

type GeoTime

type GeoTime int
const (
	UnknownGT GeoTime = iota
	Hadean
	Precambrian
	Archean
	Eoarchean
	Paleoarchean
	Mesoarchean
	Neoarchean
	Proterozoic
	Paleoproterozoic
	Siderian
	Rhyacian
	Orosirian
	Statherian
	Mesoproterozoic
	Calymmian
	Ectasian
	Stenian
	Tonian
	Neoproterozoic
	Cryogenian
	Ediacaran
	Cambrian
	Fortunian
	Paleozoic
	Phanerozoic
	Terreneuvian
	CambrianStage1
	CambrianSeries
	CambrianStage2
	CambrianStage3
	Wuliuan
	Miaolingian
	Drumian
	Guzhangian
	Furongian
	Paibian
	Jiangshanian
	CambrianStage4
	Tremadocian
	LowerOrdovician
	Ordovician
	Floian
	Dapingian
	MiddleOrdovician
	Darriwilian
	Sandbian
	UpperOrdovician
	Katian
	Hirnantian
	Llandovery
	Rhuddanian
	Silurian
	Aeronian
	Telychian
	Sheinwoodian
	Wenlock
	Homerian
	Ludlow
	Gorstian
	Ludfordian
	Pridoli
	Devonian
	LowerDevonian
	Lochkovian
	Pragian
	Emsian
	Eifelian
	MiddleDevonian
	Givetian
	UpperDevonian
	Frasnian
	Famennian
	LowerMississippian
	Tournaisian
	Mississippian
	Carboniferous
	MiddleMississippian
	Visean
	Serpukhovian
	UpperMississippian
	Bashkirian
	Pennsylvanian
	LowerPennsylvanian
	MiddlePennsylvanian
	Moscovian
	Kasimovian
	UpperPennsylvanian
	Gzhelian
	Cisuralian
	Asselian
	Permian
	Sakmarian
	Artinskian
	Kungurian
	Roadian
	Guadalupian
	Wordian
	Capitanian
	Lopingian
	Wuchiapingian
	Changhsingian
	Induan
	LowerTriassic
	Mesozoic
	Triassic
	Olenekian
	Anisian
	MiddleTriassic
	Ladinian
	Carnian
	UpperTriassic
	Norian
	Rhaetian
	Jurassic
	Hettangian
	LowerJurassic
	Sinemurian
	Pliensbachian
	Toarcian
	MiddleJurassic
	Aalenian
	Bajocian
	Bathonian
	Callovian
	Oxfordian
	UpperJurassic
	Kimmeridgian
	Tithonian
	LowerCretaceous
	Cretaceous
	Berriasian
	Valanginian
	Hauterivian
	Barremian
	Aptian
	Albian
	Cenomanian
	UpperCretaceous
	Turonian
	Coniacian
	Santonian
	Campanian
	Maastrichtian
	Paleocene
	Paleogene
	Cenozoic
	Danian
	Selandian
	Thanetian
	Eocene
	Ypresian
	Lutetian
	Bartonian
	Priabonian
	Rupelian
	Oligocene
	Chattian
	Aquitanian
	Neogene
	Miocene
	Burdigalian
	Langhian
	Serravallian
	Tortonian
	Messinian
	Zanclean
	Pliocene
	Piacenzian
	Quaternary
	Gelasian
	Pleistocene
	Calabrian
	MiddlePleistocene
	UpperPleistocene
	Holocene
	Greenlandian
	Northgrippian
	Meghalayan
)

func NewGeoTime

func NewGeoTime(s string) GeoTime

func (GeoTime) ID

func (g GeoTime) ID() string

ID return the string ID of GeoTime.

func (GeoTime) String

func (g GeoTime) String() string

String return the string representation of GeoTime.

type JournalIssue

type JournalIssue struct {
	PublishedPrint *Date  `json:"published-print,omitempty"`
	Issue          string `json:"issue,omitempty"`
}
type Link struct {
	URL                 string `json:"URL,omitempty"`
	ContentType         string `json:"content-type,omitempty"`
	ContentVersion      string `json:"content-version,omitempty"`
	IntendedApplication string `json:"similarity-checking,omitempty"`
}

type Media

type Media struct {
	// TaxonID is a reference to a taxon.
	TaxonID string

	// SourceID is a reference to source from metadata.
	SourceID string

	// URL to the media source.
	URL string

	// Type is MIME type (eg image, image/jpeg, audio)
	Type string

	// Format of the media file (NOT IN DOCS).
	Format string

	// Title of the media item.
	Title string

	// Creation date
	Created string

	// Creator name
	Creator string

	// License of the media file.
	License string

	// URL to the page from which media item came from.
	Link string

	// Remarks about the media.
	Remarks string

	// Modified is a timestamp.
	Modified string

	// ModifiedBy is the person who created the data object.
	ModifiedBy string
}

Media attached to a taxon.

func (Media) Headers

func (m Media) Headers() []string

func (Media) Load

func (m Media) Load(headers, data []string) (DataLoader, error)

Load populates the Media object from a row of data.

func (Media) Row

func (m Media) Row() []string

type Meta

type Meta struct {
	Key             string   `yaml:"key,omitempty"               json:"key,omitempty"`
	Title           string   `yaml:"title"                       json:"title"`
	Alias           string   `yaml:"alias,omitempty"             json:"alias,omitempty"`
	Description     string   `yaml:"description,omitempty"       json:"description,omitempty"`
	DOI             string   `yaml:"doi,omitempty"               json:"doi,omitempty"`
	Issued          string   `yaml:"issued,omitempty"            json:"issued,omitempty"`
	Version         string   `yaml:"version,omitempty"           json:"version,omitempty"`
	GeographicScope string   `yaml:"geographicScope,omitempty"   json:"geographicScope,omitempty"`
	TaxonomicScope  string   `yaml:"taxonomicScope,omitempty"    json:"taxonomicScope,omitempty"`
	TemporalScope   string   `yaml:"temporalScope,omitempty"     json:"temporalScope,omitempty"`
	Keywords        []string `yaml:"keywords,omitempty"          json:"keywords,omitempty"`
	// TODO change yaml to omitzero, when it is supported
	Confidence int `yaml:"confidence,omitempty"        json:"confidence,omitzero"`
	// TODO change yaml to omitzero, when it is supported
	Completeness      int      `yaml:"completeness,omitempty"      json:"completeness,omitzero"`
	License           string   `yaml:"license,omitempty"           json:"license,omitempty"`
	URL               string   `yaml:"url,omitempty"               json:"url,omitempty"`
	Label             string   `yaml:"label,omitempty"             json:"label,omitempty"`
	Citation          string   `yaml:"citation,omitempty"          json:"citation,omitempty"`
	LastImportAttempt string   `yaml:"lastImportAttempt,omitempty" json:"lastImportAttempt,omitempty"`
	LastImportState   string   `yaml:"lastImportState,omitempty"   json:"lastImportState,omitempty"`
	Private           bool     `yaml:"private,omitempty"           json:"private,omitempty"`
	Contact           *Actor   `yaml:"contact,omitempty"           json:"contact,omitempty"`
	Publisher         *Actor   `yaml:"publisher,omitempty"         json:"publisher,omitempty"`
	Editors           []Actor  `yaml:"editor,omitempty"            json:"editor,omitempty"`
	Creators          []Actor  `yaml:"creator,omitempty"           json:"creator,omitempty"`
	Contributors      []Actor  `yaml:"contributor,omitempty"       json:"contributor,omitempty"`
	Sources           []Source `yaml:"source,omitempty"            json:"source,omitempty"`
	Notes             string   `yaml:"notes,omitempty"             json:"notes,omitempty"`
}

Meta represents metadata for a dataset.

type Name

type Name struct {
	// ID is the unique identifier for this name.
	ID string

	// AlternativeID can include several alternative identifiers for this name.
	// IDs can be with or without scope: col:123, gbif:uuid, plazi:int.
	AlternativeID string

	// SourceID is the identifier of the source for this name (taken from
	// metadata).
	SourceID string

	// BasionymID is the identifier of the basionym for this name.
	// Basionym meaning is broad, and can include any terminal name (name without
	// parentage).
	BasionymID string

	// ScientificName is a full canonical form (without authorship) of
	// the scientific name.
	ScientificName string

	// Authorship is the verbatim authorship of the scientific name.
	Authorship string

	// ScientificNameString (GN) contains the most complete version of scientific name
	// available (with authorship, subgenus, intermediate authors, hybrid
	// signs etc).
	// It is not part of CoLDP standard.
	ScientificNameString string

	// ParseQuality (GN) provides information how well-formed the name-string
	// is. 1 is the best quality, 4 is the worst, 0 means parsing failed.
	ParseQuality sql.NullInt64

	// CanonicalSimple (GN) is a simplified version of a name without authorship
	// where hybrid signs and ranks are removed.
	CanonicalSimple string

	// CanonicalFull (GN) is the most complete representation of a name
	// without authorship where details like hybrid signs or ranks are preserved.
	CanonicalFull string

	// CanonicalStemmed (GN) is a name where suffexes are removed from
	// specific and infraspecific epithets.
	CanonicalStemmed string

	// Cardinality (GN) is the number of elements in the name. For example
	// uninomial has cardinality of 1, binomial 2, trinomial 3. Cardinality is
	// determined by GNparser.
	Cardinality sql.NullInt64

	// Virus (GN) is true if the parsed name was determined to belong to a virus,
	// plasmid, vector etc.
	Virus sql.NullBool

	// Hybrid (GN) shows a hybrid name type. It is empty for non-hybrid names.
	Hybrid string

	// Surrogate (GN) shows a type of a surrogate. It is empty for non-surrogate
	// names.
	Surrogate string

	// Authors provide a pipe-delimited list of all authors mentioned in th
	// name-string and detected by GNparser.
	Authors string

	// GnID is the UUIDv5 generated by GlobalNames out of the name-string.
	GnID string

	// TwTaxonNameID (TW) is the original taxon_names.id from TaxonWorks.
	// It is not part of CoLDP standard.
	TwTaxonNameID string

	// Rank is the taxonomic rank of the name.
	Rank Rank

	// Uninomial is the uninomial for names at the rank of genus or higher.
	Uninomial string

	// Genus is the genus name.
	Genus string

	// InfragenericEpithet of the name.
	InfragenericEpithet string

	// SpecificEpithet of the name.
	SpecificEpithet string

	// InfraspecificEpithet of the name.
	InfraspecificEpithet string

	// CultivarEpithet is the cultivar epithet.
	CultivarEpithet string

	// Notho is the nothotaxon part of the name.
	Notho NamePart

	// OriginalSpelling indicates whether the name is spelled as originally
	// published.
	OriginalSpelling sql.NullBool

	// CombinationAuthorship is the authorship of the combination.
	// Authors are separated by '|'.
	CombinationAuthorship string

	// CombinationAuthorshipID is the identifier of the combination authorship.
	// Authors are separated by '|'.
	CombinationAuthorshipID string

	// CombinationExAuthorship is the ex authorship of the combination.
	// Authors are separated by '|'.
	CombinationExAuthorship string

	// CombinationExAuthorshipID is the identifier of the combination ex
	// authorship. Authors are separated by '|'.
	CombinationExAuthorshipID string

	// CombinationAuthorshipYear is the year of the combination authorship.
	// Authors are separated by '|'.
	CombinationAuthorshipYear string

	// BasionymAuthorship is the authorship of the basionym.
	// Authors are separated by '|'.
	BasionymAuthorship string

	// BasionymAuthorshipID is the identifier of the basionym authorship.
	// Authors are separated by '|'.
	BasionymAuthorshipID string

	// BasionymExAuthorship is the ex authorship of the basionym.
	// Authors are separated by '|'.
	BasionymExAuthorship string

	// BasionymExAuthorshipID is the identifier of the basionym ex authorship.
	// Authors are separated by '|'.
	BasionymExAuthorshipID string

	// BasionymAuthorshipYear is the year of the basionym authorship.
	// Authors are separated by '|'.
	BasionymAuthorshipYear string

	// Code is the nomenclatural code that applies to this name.
	Code nomcode.Code

	// Status is the nomenclatural status of the name.
	Status NomStatus

	// ReferenceID is the identifier of the reference in which the name was
	// published.
	ReferenceID string

	// PublishedInYear is the year in which the name was published.
	PublishedInYear string

	// PublishedInPage is the page in which the name was published.
	PublishedInPage string

	// PublishedInPageLink is the link to the page in which the name was
	// published.
	PublishedInPageLink string

	// Gender is the grammatical gender of the name.
	Gender Gender

	// GenderAgreement indicates whether the gender of the name agrees with the
	// gender of the genus.
	GenderAgreement sql.NullBool

	// Etymology is the etymology of the name.
	Etymology string

	// Link is a URL to more information about the name.
	Link string

	// Remarks are any remarks/notes about the name.
	Remarks string

	// Modified is the date when the name was last modified.
	Modified string

	// ModifiedBy is the user who last modified the name.
	ModifiedBy string
}

Name contains information about a scientific name.

func (*Name) Amend

func (n *Name) Amend(p gnparser.GNparser)

func (Name) Headers

func (n Name) Headers() []string

Headers are used during conversion of SFGA to CoLDP.

func (Name) Load

func (n Name) Load(headers, data []string) (DataLoader, error)

Load processes a slice of strings into Name object using field names from headers.

func (Name) Row

func (n Name) Row() []string

type NamePart

type NamePart int

NamePart represents the part of a scientific name.

const (
	UnknownNP       NamePart = iota
	GenericNP                // The genus part of the name.
	InfragenericNP           // The infrageneric epithet (e.g., subgenus, section) of the name.
	SpecificNP               // The specific epithet of the name.
	InfraspecificNP          // The infraspecific epithet (e.g., subspecies, variety) of the name.
)

Constants for different name parts.

func NewNamePart

func NewNamePart(s string) NamePart

NewNamePart creates a new NamePart from a string representation.

func (NamePart) ID

func (np NamePart) ID() string

func (NamePart) String

func (np NamePart) String() string

type NameRelation

type NameRelation struct {
	// NameID is the unique identifier of the first scientific name.
	NameID string

	// RelatedNameID is the unique identifier of the related scientific name.
	RelatedNameID string

	// SourceID is the optional identifier of the source of the relationship
	// information.
	SourceID string

	// Type specifies the nature of the relationship between the two names (e.g.,
	// Basyonym, Homotypic).
	Type NomRelType

	// TwNameRelationshipType (TW) is the original relationship type from TaxonWorks.
	// This preserves the full NOMEN ontology type for lossless round-tripping.
	// It is not part of CoLDP standard.
	TwNameRelationshipType string

	// ReferenceID is the identifier of the reference that describes this
	// relationship.
	ReferenceID string

	//The exact single page number where the nomenclatural relation was published
	//in the linked reference. If the value spans multiple pages, the first page
	//should be given.
	Page string

	// Remarks provides additional notes or details about the relationship.
	Remarks string

	// Modified is a timestamp.
	Modified string

	// ModifiedBy a person who last modified the record.
	ModifiedBy string
}

NameRelation describes the relationship between two scientific names.

func (NameRelation) Headers

func (n NameRelation) Headers() []string

func (NameRelation) Load

func (n NameRelation) Load(headers, data []string) (DataLoader, error)

Load populates a NameRelation object with data from a parsed row.

func (NameRelation) Row

func (n NameRelation) Row() []string

type NameUsage

type NameUsage struct {
	ID                        string          // t, s
	AlternativeID             string          // t
	NameAlternativeID         string          // n
	TwTaxonNameID             string          // n TW
	OtuID                     string          // t TW
	LocalID                   string          // t GN
	GlobalID                  string          // t GN
	SourceID                  string          // n,t,s
	ParentID                  string          // t, s
	BasionymID                string          // t
	TaxonomicStatus           TaxonomicStatus // s
	ScientificName            string          // n
	Authorship                string          // n
	ScientificNameString      string          // GN
	ParseQuality              sql.NullInt64   // GN
	CanonicalSimple           string          // GN
	CanonicalFull             string          // GN
	CanonicalStemmed          string          // GN
	Cardinality               sql.NullInt64   // GN
	Virus                     sql.NullBool    // GN
	Hybrid                    string          // GN
	Surrogate                 string          // GN
	Authors                   string          // GN
	GnID                      string          // GN
	Rank                      Rank            // n
	Notho                     NamePart        // n
	OriginalSpelling          sql.NullBool    // n
	Uninomial                 string          // n
	GenericName               string          // n
	InfragenericEpithet       string          // n
	SpecificEpithet           string          // n
	InfraspecificEpithet      string          // n
	CultivarEpithet           string          // n
	CombinationAuthorship     string          // n
	CombinationAuthorshipID   string          // n
	CombinationExAuthorship   string          // n
	CombinationExAuthorshipID string          // n
	CombinationAuthorshipYear string          // n
	BasionymAuthorship        string          // n
	BasionymAuthorshipID      string          // n
	BasionymExAuthorship      string          // n
	BasionymExAuthorshipID    string          // n
	BasionymAuthorshipYear    string          // n
	NamePhrase                string          // t
	NameReferenceID           string          // n
	PublishedInYear           string          // n
	PublishedInPage           string          // n
	PublishedInPageLink       string          // n
	Gender                    Gender          // n
	GenderAgreement           sql.NullBool    // n
	Etymology                 string          // n
	Code                      nomcode.Code    // n
	NameStatus                NomStatus       // n
	AccordingToID             string          // t
	AccordingToPage           string          // t
	AccordingToPageLink       string          // t
	ReferenceID               string          // t
	Scrutinizer               string          // t
	ScrutinizerID             string          // t
	ScrutinizerDate           string          // t
	Extinct                   sql.NullBool    // t
	TemporalRangeStart        GeoTime         // t
	TemporalRangeEnd          GeoTime         // t
	Environment               []Environment   // t
	Species                   string          // t
	SpeciesID                 string          // sf
	Section                   string          // t
	SectionID                 string          // sf
	Subgenus                  string          // t
	SubgenusID                string          // sf
	Genus                     string          // t
	GenusID                   string          // sf
	Subtribe                  string          // t
	SubtribeID                string          // sf
	Tribe                     string          // t
	TribeID                   string          // sf
	Subfamily                 string          // t
	SubfamilyID               string          // sf
	Family                    string          // t
	FamilyID                  string          // sf
	Superfamily               string          // t
	SuperfamilyID             string          // sf
	Suborder                  string          // t
	SuborderID                string          // sf
	Order                     string          // t
	OrderID                   string          // sf
	Subclass                  string          // t
	SubclassID                string          // sf
	Class                     string          // t
	ClassID                   string          // sf
	Subphylum                 string          // t
	SubphylumID               string          // sf
	Phylum                    string          // t
	PhylumID                  string          // sf
	Kingdom                   string          // t
	KingdomID                 string          // sf
	Realm                     string          // sf
	RealmID                   string          // sf
	Ordinal                   sql.NullInt64   // t
	BranchLength              sql.NullInt64   // t
	Link                      string          // n, t
	NameRemarks               string          // n
	Remarks                   string          // t
	Modified                  string          // n, t
	ModifiedBy                string          // n, t
}

NameUsage combines fields of Name, Taxon and Synonym.

func (*NameUsage) Amend

func (n *NameUsage) Amend(p gnparser.GNparser)

func (NameUsage) CoreHeaders

func (n NameUsage) CoreHeaders() []string

CoreHeaders are limited to the most used fields.

func (NameUsage) CoreRow

func (n NameUsage) CoreRow() []string

func (NameUsage) GenerateUUID

func (n NameUsage) GenerateUUID() uuid.UUID

GenerateUUID generates UUID v5 using information that should be unique for the NameUsage record.

func (NameUsage) Headers

func (n NameUsage) Headers() []string

Headers for all fields of NameUsage, including ones that exist only in SFGA file. It is used for creating CoLDP file.

func (NameUsage) InferTaxonomicStatus

func (n NameUsage) InferTaxonomicStatus() TaxonomicStatus

InferTaxonomicStatus tries to figure out if a record with limited data represents a taxon record or a bare name.

func (NameUsage) Load

func (n NameUsage) Load(headers, data []string) (DataLoader, error)

func (NameUsage) Row

func (n NameUsage) Row() []string

type NomRelType

type NomRelType int
const (
	UnknownNomRelType NomRelType = iota
	SpellingCorrection
	Basionym
	BasedOn
	ReplacementName
	ConservedNRT
	LaterHomonym
	Superfluous
	Homotypic
	Type
)

func NewNomRelType

func NewNomRelType(s string) NomRelType

func (NomRelType) ID

func (n NomRelType) ID() string

func (NomRelType) String

func (n NomRelType) String() string

type NomStatus

type NomStatus int

NomStatus represents the nomenclatural status of a scientific name.

const (
	UnknownNomStatus NomStatus = iota
	Established                // The name is validly published and available.
	NotEstablished             // The name is not validly published or unavailable.
	Acceptable                 // The name is potentially valid or acceptable for use.
	Unacceptable               // The name is illegitimate or unacceptable for use.
	Conserved                  // The name is conserved against a competing name.
	Rejected                   // The name is rejected in favor of a competing name.
	Doubtful                   // The application of the name is uncertain.
	Manuscript                 // The name is only published in a manuscript.
	Chresonym                  // The name is a chresonym.
)

Constants for different nomenclatural statuses.

func NewNomStatus

func NewNomStatus(s string) NomStatus

NewNomStatus creates a new NomStatus from a string representation. It handles various synonyms and normalizations to ensure consistent matching.

func (NomStatus) ID

func (n NomStatus) ID() string

func (NomStatus) String

func (n NomStatus) String() string

type Rank

type Rank int

Rank represents the taxonomic rank of a scientific name.

const (
	UnknownRank Rank = iota
	Superdomain
	Domain
	Subdomain
	Infradomain
	Empire
	Realm
	Subrealm
	Superkingdom
	Kingdom
	Subkingdom
	Infrakingdom
	Superphylum
	Phylum
	Subphylum
	Infraphylum
	Parvphylum
	Microphylum
	Nanophylum
	Claudius
	Gigaclass
	Megaclass
	Superclass
	Class

	Infraclass
	Subterclass
	Parvclass
	Superdivision
	Division
	Subdivision
	Infradivision
	Superlegion
	Legion
	Sublegion
	Infralegion
	Megacohort
	Supercohort
	Cohort
	Subcohort
	Infracohort
	Gigaorder
	Magnorder
	Grandorder
	Mirorder
	Superorder
	Order
	Nanorder
	Hypoorder
	Minorder
	Suborder
	Infraorder
	Parvorder
	SupersectionZoology
	SectionZoology
	SubsectionZoology
	Falanx
	Gigafamily
	Megafamily
	Grandfamily
	Superfamily
	Epifamily
	Family
	Subfamily
	Infrafamily
	Supertribe
	Tribe
	Subtribe
	Infratribe
	SupragenericName
	Supergenus
	Genus
	Subgenus
	Infragenus
	SupersectionBotany
	SectionBotany
	SubsectionBotany
	Superseries
	Series
	Subseries
	InfragenericName
	SpeciesAggregate
	Species
	InfraspecificName
	Grex
	Klepton
	Subspecies
	CultivarGroup
	Convariety
	InfrasubspecificName
	Proles
	Natio
	Aberration
	Morph
	Supervariety
	Variety
	Subvariety
	Superform
	Form
	Subform
	Pathovar
	Biovar
	Chemovar
	Morphovar
	Phagovar
	Serovar
	Chemoform
	FormaSpecialis
	Lusus
	Cultivar
	Mutatio
	Strain
	Other
	Unranked
	Subclass
	Section
	Supersection
	Subsection
)

Constants for different taxonomic ranks.

func NewRank

func NewRank(s string) Rank

NewRank creates a new Rank from a string representation. It handles trimming and normalization to ensure consistent matching.

func RankByOrder

func RankByOrder() []Rank

RankByOrder returns a slice of Ranks sorted by their order from higher to lower taxon.

func (Rank) AbbrString

func (r Rank) AbbrString() string

func (Rank) ID

func (r Rank) ID() string

ID returns the ID of the rank.

func (Rank) IsIfraspecific

func (r Rank) IsIfraspecific() bool

func (Rank) String

func (r Rank) String() string

String returns the string representation of the rank.

type Reference

type Reference struct {
	// ID of the reference.
	ID string

	// AlternativeID is a list of ids separated by comma (scope:id, id).
	AlternativeID string

	// SourceID to source from metadata.
	SourceID string

	// Citation unparsed string for reference's citation.
	Citation string

	// Type of the publication.
	Type ReferenceType

	// Author is the list of author/s.
	Author string

	// AuthorID is the comma-separated list of author ids.
	AuthorID string

	// Editor is the list of editor/s.
	Editor string

	// EditorID is the comma-separated list of editorIDs.
	EditorID string

	// Title of the reference.
	Title string

	// TitleShort of the reference.
	TitleShort string

	// ContainerAuthor is author(s) of the container holding the item, e.g. the
	// book author for a book chapter. See author for recommendations how to
	// supply person names.
	ContainerAuthor string

	// ContainerAuthorID is the comma-separated list of author/s of the
	// container.
	ContainerAuthorID string

	// ContainerTitle is the title of the container.
	ContainerTitle string

	// ContainerTitleShort of the container.
	ContainerTitleShort string

	// Issued is ISO8601 date Date the work was issued/published. Date
	// can be truncated if month or day are absent.
	Issued string

	// Accessed is ISO8601 date Date the work was visited. Date
	// can be truncated if month or day are absent.
	Accessed string

	// CollectionTitle is the  title of the collection holding the item, e.g. the
	// series title for a book.
	CollectionTitle string

	// CollectionEditor is the editor of the collection.
	CollectionEditor string

	// Volume of the reference.
	Volume string

	// Issue of the reference.
	Issue string

	// Edition of the reference.
	Edition string

	// Page of the reference.
	Page string

	// Publisher of the refernce.
	Publisher string

	// PublisherPlace is the geographic location of the publisher.
	PublisherPlace string

	// Version of the reference (if applicable).
	Version string

	// ISBN is the International Standard Book Number
	ISBN string

	// ISSN is the International Standard Serial Number
	ISSN string

	// DOI of the reference
	DOI string

	// Link is the URL to the reference.
	Link string

	// Remarks about the reference.
	Remarks string

	// Modified is a timestamp.
	Modified string

	// ModifiedBy a person who last modified the record.
	ModifiedBy string
}

func (Reference) Headers

func (r Reference) Headers() []string

func (Reference) Load

func (r Reference) Load(headers, data []string) (DataLoader, error)

func (Reference) Row

func (r Reference) Row() []string

type ReferenceType

type ReferenceType int
const (
	UnknownRT ReferenceType = iota
	Article
	ArticleJournal
	ArticleMagazine
	ArticleNewspaper
	Bill
	Book
	Broadcast
	Chapter
	Dataset
	Entry
	EntryDictionary
	EntryEncyclopedia
	Figure
	Graphic
	Interview
	LegalCase
	Legislation
	ManuscriptRT
	Map
	MotionPicture
	MusicalScore
	Pamphlet
	PaperConference
	Patent
	PersonalCommunication
	Post
	PostWeblog
	Report
	Review
	ReviewBook
	Song
	Speech
	Thesis
	Treaty
	Webpage
)

func NewReferenceType

func NewReferenceType(s string) ReferenceType

func (ReferenceType) ID

func (rg ReferenceType) ID() string

ID returns the string ID of ReferenceType.

func (ReferenceType) String

func (rg ReferenceType) String() string

String returns the string representation of ReferenceType.

type Sex

type Sex int

Sex represents biological sex of a person or organism.

const (
	UnknownSex Sex = iota
	Female
	Male
	Hermaphrodite
)

func NewSex

func NewSex(s string) Sex

NewSex creates a new Sex object from a string

func (Sex) ID

func (s Sex) ID() string

ID returns string ID for Sex.

func (Sex) String

func (s Sex) String() string

String returns string representation of Sex object.

type Source

type Source struct {
	ID      string `yaml:"id"               json:"id"`
	Type    string `yaml:"type,omitempty"   json:"type,omitempty"`
	Title   string `yaml:"title,omitempty"  json:"title,omitempty"`
	Authors []any  `yaml:"author,omitempty" json:"author,omitempty"`
	Issued  string `yaml:"issued,omitempty" json:"issued,omitempty"`
	ISBN    string `yaml:"isbn,omitempty"   json:"isbn,omitempty"`
}

Source represents a source of data.

type SpInteractionType

type SpInteractionType int
const (
	UnknownSpIntT SpInteractionType = iota
	MutualistOf
	CommensalistOf
	HasEpiphyte
	EpiphyteOf
	HasEggsLayedOnBy
	LaysEggsOn
	PollinatedBy
	Pollinates
	FlowersVisitedBy
	VisitsFlowersOf
	VisitedBy
	Visits
	HasHyperparasitoid
	HyperparasitoidOf
	HasParasitoid
	ParasitoidOf
	HasKleptoparasite
	KleptoparasiteOf
	HasHyperparasite
	HyperparasiteOf
	HasEctoparasite
	EctoparasiteOf
	HasEndoparasite
	EndoparasiteOf
	HasVector
	VectorOf
	HasPathogen
	PathogenOf
	HasParasite
	ParasiteOf
	HasHost
	HostOf
	PreyedUponBy
	PreysUpon
	KilledBy
	Kills
	EatenBy
	Eats
	SymbiontOf
	AdjacentTo
	InteractsWith
	CoOccursWith
	RelatedTo
)

func NewSpInteractionType

func NewSpInteractionType(s string) SpInteractionType

func (SpInteractionType) ID

func (si SpInteractionType) ID() string

func (SpInteractionType) String

func (si SpInteractionType) String() string

type SpeciesEstimate

type SpeciesEstimate struct {
	// TaxonID is a reference to a taxon.
	TaxonID string

	// SourceID is a reference to source from metadata.
	SourceID string

	// Estimate is the estimated number of species for the taxon.
	Estimate sql.NullInt64

	// Type of the estimation.
	Type EstimateType

	// ReferenceID indicating the publication of the type designation.
	ReferenceID string

	// Remarks about the specimen.
	Remarks string

	// Modified timestamp.
	Modified string

	// ModifiedBy contains name of a person who added/updated the record.
	ModifiedBy string
}

SpeciesEstimate provides estimation of how many species are children of the taxon.

func (SpeciesEstimate) Headers

func (s SpeciesEstimate) Headers() []string

func (SpeciesEstimate) Load

func (s SpeciesEstimate) Load(headers, data []string) (DataLoader, error)

func (SpeciesEstimate) Row

func (s SpeciesEstimate) Row() []string

type SpeciesInteraction

type SpeciesInteraction struct {
	// TaxonID is a reference to a taxon.
	TaxonID string

	// RelateTaxonID is a reference to the second taxon.
	RelatedTaxonID string

	// SourceID is a reference to source from metadata.
	SourceID string

	// RelatedTaxonScientificName is the name of the related taxon.
	// TODO: find if it is deprecated.
	RelatedTaxonScientificName string

	// Type of interaction.
	Type SpInteractionType

	// ReferenceID describing species interaction.
	ReferenceID string

	// Remarks about the specimen.
	Remarks string

	// Modified timestamp.
	Modified string

	// ModifiedBy contains name of a person who added/updated the record.
	ModifiedBy string
}

func (SpeciesInteraction) Headers

func (s SpeciesInteraction) Headers() []string

func (SpeciesInteraction) Load

func (s SpeciesInteraction) Load(headers, data []string) (DataLoader, error)

func (SpeciesInteraction) Row

func (s SpeciesInteraction) Row() []string

type Synonym

type Synonym struct {
	// ID is an optional unique identifier for the synonym.
	// If provided, it should not conflict with any taxon IDs.
	ID string

	// TaxonID is the unique identifier for the related taxon.
	TaxonID string

	// SourceID is the identifier of the source from metadata.
	SourceID string

	// NameID is the identifier of the name associated with this taxon.
	NameID string

	// NamePhrase is an optional annotation attached to the name in this
	// context (e.g., "sensu lato").
	NamePhrase string

	// AccordingToID is the ReferenceID of the source that this synonym is based on.
	AccordingToID string

	// Status represents the taxonomic status of the synonym.
	Status TaxonomicStatus

	// ReferenceID is the identifier of the reference for the synonym data.
	ReferenceID string

	// Link is a URL to further information about the synonym.
	Link string

	// Remarks contains any additional notes about the synonym.
	Remarks string

	// Modified is the timestamp of the last modification.
	Modified string

	// ModifiedBy is the name of the person who last modified the data.
	ModifiedBy string
}

Synonym represents a taxonomic synonym with associated metadata.

func (Synonym) Headers

func (s Synonym) Headers() []string

func (Synonym) Load

func (s Synonym) Load(headers, data []string) (DataLoader, error)

Load populates a Synonym object from a row of data.

func (Synonym) Row

func (s Synonym) Row() []string

type Taxon

type Taxon struct {
	// ID is the unique identifier for this taxon.
	ID string

	// AlternativeID has alternative identifiers for this taxon.
	// either URI/URN/URL, or scope:id, separated by ','
	AlternativeID string

	// LocalID corresponds to a local identifier, usually an integer. Some
	// sources use it in their URLs and then it might be used by GN to show
	// outlink URL.
	LocalID string

	// GlobalID corresponds to a globally unique identifier like UUID, LSID, DOI
	// etc. If it is used in the source URL GN might use it.
	GlobalID string

	// OtuID corresponds to Operational Taxonomic Unit (OTU) in TaxonWorks.
	// It is not part of CoLDP standard.
	OtuID string

	// SourceID is the identifier of the source from metadata.
	SourceID string

	// ParentID is the identifier of the parent taxon.
	ParentID string

	// Ordinal is the used to sort siblings of the same ParentID.
	Ordinal sql.NullInt64

	// BranchLength is the branch length of this taxon in a phylogenetic tree.
	BranchLength sql.NullInt64

	// NameID is the identifier of the name associated with this taxon.
	NameID string

	// NamePhrase is an optional annotation attached to the name in this
	// context (eg `sensu lato` etc).
	NamePhrase string

	// AccordingToID is ReferenceID of the source that this taxon is based on.
	AccordingToID string

	// AccordingToPage is the page number in the source where this taxon is
	// determined.
	AccordingToPage string

	// AccordingToPageLink is a link to the page where this taxon is determined.
	AccordingToPageLink string

	// Scrutinizer is the name of the person who scrutinized this taxon.
	Scrutinizer string

	// ScrutinizerID is the identifier of the scrutinizer ORCID if available.
	ScrutinizerID string

	// ScrutinizerDate is the date of the scrutiny.
	ScrutinizerDate string

	// Provisional indicates taxon is only provisionaly accepted.
	Provisional sql.NullBool

	// ReferenceID is the comma-separated list of references that support
	// this taxon concept.
	ReferenceID string

	// Extinct indicates whether this taxon is extinct.
	Extinct sql.NullBool

	// TemporalRangeStart is the start of the temporal range of this taxon.
	TemporalRangeStart GeoTime

	// TemporalRangeEnd is the end of the temporal range of this taxon.
	TemporalRangeEnd GeoTime

	// Environment is the environments where this taxon lives. Uses Environment
	// controlled vocabulary (comma-separated).
	Environment []Environment

	// Species is the species name within this taxon.
	Species string

	// SpeciesID is the ID of the taxon's species (SF namespace).
	SpeciesID string

	// Section is the section name within this taxon.
	Section string

	// SectionID is the ID of the taxon's section (SF namespace).
	SectionID string

	// Subgenus is the subgenus name within this taxon.
	Subgenus string

	// SubgenusID is the ID of the taxon's subgenus (SF namespace).
	SubgenusID string

	// Genus is the genus name within this taxon.
	Genus string

	// GenusID is the ID of the taxon's genus (SF namespace).
	GenusID string

	// Subtribe is the subtribe name within this taxon.
	Subtribe string

	// SubtribeID is the ID of the taxon's subtrive (SF namespace).
	SubtribeID string

	// Tribe is the tribe name within this taxon.
	Tribe string

	// TribeID is the ID of the taxon's tribe (SF namespace).
	TribeID string

	// Subfamily is the subfamily name within this taxon.
	Subfamily string

	// SubfamilyID is the ID of the taxon's subfamily (SF namespace).
	SubfamilyID string

	// Family is the family name within this taxon.
	Family string

	// FamilyID is the ID of the taxon's family (SF namespace).
	FamilyID string

	// Superfamily is the superfamily name within this taxon.
	Superfamily string

	// SuperfamilyID is the ID of the taxon's superfamily (SF namespace).
	SuperfamilyID string

	// Suborder is the suborder name within this taxon.
	Suborder string

	// SuborderID is the ID of the taxon's suborder (SF namespace).
	SuborderID string

	// Order is the order name within this taxon.
	Order string

	// OrderID is the ID of the taxon's order (SF namespace).
	OrderID string

	// Subclass is the subclass name within this taxon.
	Subclass string

	// SubclassID is the ID of the taxon's subclass (SF namespace).
	SubclassID string

	// Class is the class name within this taxon.
	Class string

	// ClassID is the ID of the taxon's class (SF namespace).
	ClassID string

	// Subphylum is the subphylum name within this taxon.
	Subphylum string

	// SubphylumID is the ID of the taxon's subphylum (SF namespace).
	SubphylumID string

	// Phylum is the phylum name within this taxon.
	Phylum string

	// PhylumID is the ID of the taxon's phylum (SF namespace).
	PhylumID string

	// Kingdom is the kingdom name within this taxon.
	Kingdom string

	// KingdomID is the id of the taxon's kindom (SF namespace).
	KingdomID string

	// Realm is the realm name within this taxon (SF namespace).
	Realm string

	// RealmID is the ID of the taxon's realm (SF namespace).
	RealmID string

	// Link is a link to more information about this taxon.
	Link string

	// Remarks are any remarks about this taxon.
	Remarks string

	// Modified is the date when this taxon was last modified.
	Modified string

	// ModifiedBy is the user who last modified this taxon.
	ModifiedBy string
}

Taxon represents a taxonomic data in the CoLDP.

func (Taxon) Headers

func (t Taxon) Headers() []string

func (Taxon) Load

func (t Taxon) Load(headers, data []string) (DataLoader, error)

Load populates the Taxon object from a row of data.

func (Taxon) Row

func (t Taxon) Row() []string

type TaxonConceptRelType

type TaxonConceptRelType int
const (
	UnknownTCT TaxonConceptRelType = iota
	Equals
	Includes
	IncludedIn
	Overlaps
	Excludes
)

func NewTaxonConceptRelType

func NewTaxonConceptRelType(s string) TaxonConceptRelType

func (TaxonConceptRelType) ID

func (t TaxonConceptRelType) ID() string

ID returns the string ID of TaxonConceptRelType.

func (TaxonConceptRelType) String

func (t TaxonConceptRelType) String() string

String returns the string representation of TaxonConceptRelType.

type TaxonConceptRelation

type TaxonConceptRelation struct {
	// TaxonID is a reference to a taxon.
	TaxonID string

	// RelateTaxonID is a reference to the second taxon.
	RelatedTaxonID string

	// SourceID is a reference to source from metadata.
	SourceID string

	Type TaxonConceptRelType

	// ReferenceID to description of TaxonConceptRelation.
	ReferenceID string

	// Remarks about the specimen.
	Remarks string

	// Modified timestamp.
	Modified string

	// ModifiedBy contains name of a person who added/updated the record.
	ModifiedBy string
}

func (TaxonConceptRelation) Headers

func (t TaxonConceptRelation) Headers() []string

func (TaxonConceptRelation) Load

func (t TaxonConceptRelation) Load(headers, data []string) (DataLoader, error)

func (TaxonConceptRelation) Row

func (t TaxonConceptRelation) Row() []string

type TaxonProperty

type TaxonProperty struct {
	// TaxonID is a reference to a taxon.
	TaxonID string

	// SourceID is a reference to source from metadata.
	SourceID string

	// Property type according to some controlled vocabulary.
	Property string

	// Value of the property.
	Value string

	// ReferenceID points to the publication about TaxonProperty.
	ReferenceID string

	// Page where this property is given.
	Page string

	// Ordinal for sorting.
	Ordinal sql.NullInt64

	// Remarks about the specimen.
	Remarks string

	// Modified timestamp.
	Modified string

	// ModifiedBy contains name of a person who added/updated the record.
	ModifiedBy string
}

TaxonProperty allows to add arbitrary properties that further describe a taxon.

func (TaxonProperty) Headers

func (t TaxonProperty) Headers() []string

func (TaxonProperty) Load

func (t TaxonProperty) Load(headers, data []string) (DataLoader, error)

func (TaxonProperty) Row

func (t TaxonProperty) Row() []string

type TaxonomicStatus

type TaxonomicStatus int
const (
	UnknownTaxSt TaxonomicStatus = iota
	AcceptedTS
	ProvisionallyAcceptedTS
	SynonymTS
	AmbiguousSynonymTS
	MisappliedTS
	BareNameTS
)

func NewTaxonomicStatus

func NewTaxonomicStatus(s string) TaxonomicStatus

func (TaxonomicStatus) ID

func (ts TaxonomicStatus) ID() string

func (TaxonomicStatus) String

func (ts TaxonomicStatus) String() string

type Treatment

type Treatment struct {
	// TaxonID is a reference to a taxon.
	TaxonID string

	// SourceID is a reference to source from metadata.
	SourceID string

	// Document (probably path in the file system).
	Document string

	// Format of the document (HTML, TXT, XML etc.).
	Format string

	// Modified timestamp.
	Modified string

	// ModifiedBy contains name of a person who added/updated the record.
	ModifiedBy string
}

func (Treatment) Headers

func (t Treatment) Headers() []string

func (Treatment) Load

func (t Treatment) Load(headers, data []string) (DataLoader, error)

Load populates the Treatment object from a row of data.

func (Treatment) Row

func (t Treatment) Row() []string

type TypeMaterial

type TypeMaterial struct {
	// ID is optional
	ID string

	// SourceID where type material is mentioned. It comes from metadata.
	SourceID string

	// NameID is the id of a name that attached to this type.
	NameID string

	// Citation is a reference where type specimen is attached to name.
	Citation string

	// Status of the type specimen.
	Status TypeStatus

	// InstitutionCode is the name or acronym in use by the institution having
	// custody of the material.
	InstitutionCode string

	// The identifier for the specimen in a collection.
	CatalogNumber string

	// ReferenceID indicating the publication of the type designation.
	ReferenceID string

	// Locality of the type. Ideally from largest area to smallest.
	Locality string

	// Country of the type locality. Preferably as ISO codes.
	Country string

	// Latitude is a decimal latitude of the type locality given in WGS84.
	Latitude sql.NullFloat64

	// Longitute is a decimal longitude of the type locality given in WGS84.
	Longitude sql.NullFloat64

	// Altitue is a decimal longitude of the type locality given in WGS84
	Altitude sql.NullInt64

	// Host is the host organism from which the type specimen was obtained
	// (symbiotype).
	Host string

	// Sex of the type specimen.
	Sex Sex

	// Date the type material was gathered. Recommended to be given as ISO 8601
	// dates.
	Date string

	// Collector of the type specimen.
	Collector string

	// AssociatedSequences to the specimen.
	AssociatedSequences string

	// Link to further information about the specimen, e.g. as provided by
	// the institute holding the collection.
	Link string

	// Remarks about the specimen.
	Remarks string

	// Modified is a timestamp.
	Modified string

	// ModifiedBy a person who last modified the record.
	ModifiedBy string
}

Type material designated to names. Type material should only be associated with the original name, not with a recombination.

func (TypeMaterial) Headers

func (t TypeMaterial) Headers() []string

func (TypeMaterial) Load

func (t TypeMaterial) Load(headers, data []string) (DataLoader, error)

Load populates the TypeMaterial object from a row of data.

func (TypeMaterial) Row

func (t TypeMaterial) Row() []string

type TypeStatus

type TypeStatus int
const (
	UnknownTS TypeStatus = iota
	OtherTS
	HomoeotypeTS
	PlesiotypeTS
	PlastotypeTS
	PlastosyntypeTS
	PlastoparatypeTS
	PlastoneotypeTS
	PlastolectotypeTS
	PlastoisotypeTS
	PlastoholotypeTS
	AllotypeTS
	AlloneotypeTS
	AllolectotypeTS
	ParaneotypeTS
	ParalectotypeTS
	IsosyntypeTS
	IsoparatypeTS
	IsoneotypeTS
	IsolectotypeTS
	IsoepitypeTS
	IsotypeTS
	TopotypeTS
	SyntypeTS
	PathotypeTS
	ParatypeTS
	OriginalTS
	NeotypeTS
	LectotypeTS
	IconotypeTS
	HolotypeTS
	HapantotypeTS
	ExTS
	ErgatotypeTS
	EpitypeTS
)

func NewTypeStatus

func NewTypeStatus(s string) TypeStatus

func (TypeStatus) ID

func (ts TypeStatus) ID() string

func (TypeStatus) String

func (ts TypeStatus) String() string

type Vernacular

type Vernacular struct {
	// TaxonID of the corresponding taxon.
	TaxonID string

	// SourceID to the source from metadata.
	SourceID string

	// Name (vernacular).
	Name string

	// Transliteration to latin alphabet.
	Transliteration string

	// Langugage of the name (three-letter ISO 639-3 code).
	Language string

	// Preferred is true when this vernacular names is considered the most
	// used for the language.
	Preferred sql.NullBool

	// Country name (two-letter ISO 3166-2  code)
	Country string

	// Area (optional) describing the geographic use of the vernacular name in
	// free text within the given country.
	Area string

	// Sex (optional) of the organism this vernacular name is restricted to.
	Sex Sex

	// ReferenceID where the name is supported.
	ReferenceID string

	// Remarks for the name.
	Remarks string

	// Modified is a timestamp.
	Modified string

	// ModifiedBy a person who last modified the record.
	ModifiedBy string
}

Vernacular name of a taxon.

func (Vernacular) Headers

func (v Vernacular) Headers() []string

func (Vernacular) Load

func (v Vernacular) Load(headers, data []string) (DataLoader, error)

Load populates a Vernacular object from a row of data.

func (Vernacular) Row

func (v Vernacular) Row() []string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL