Revision 13498
Added by Aaron Marcuse-Kubitza over 10 years ago
vegbien.sql | ||
---|---|---|
17029 | 17029 |
-- |
17030 | 17030 |
|
17031 | 17031 |
CREATE VIEW "MatchedTaxon" AS |
17032 |
SELECT tnrs.batch AS "*Name_matched.batch", |
|
17033 |
tnrs."Name_submitted" AS "concatenatedScientificName", |
|
17034 |
tnrs."Name_matched" AS "matchedTaxonName", |
|
17035 |
tnrs."Name_matched_rank" AS "matchedTaxonRank", |
|
17036 |
tnrs."Name_score" AS "*Name_matched.Name_score", |
|
17037 |
tnrs."Name_matched_author" AS "matchedScientificNameAuthorship", |
|
17038 |
tnrs."Name_matched_url" AS "matchedScientificNameID", |
|
17039 |
tnrs."Author_score" AS "*Name_matched.Author_score", |
|
17040 |
tnrs."Family_score" AS "matchedFamilyConfidence_fraction", |
|
17041 |
COALESCE(tnrs."Name_matched_accepted_family", tnrs."Accepted_name_family") AS "matchedFamily", |
|
17042 |
tnrs."Genus_matched" AS "matchedGenus", |
|
17043 |
tnrs."Genus_score" AS "matchedGenusConfidence_fraction", |
|
17044 |
tnrs."Specific_epithet_matched" AS "matchedSpecificEpithet", |
|
17045 |
tnrs."Specific_epithet_score" AS "matchedSpeciesConfidence_fraction", |
|
17046 |
tnrs."Infraspecific_epithet_matched" AS "matchedInfraspecificEpithet", |
|
17047 |
tnrs."Infraspecific_epithet_score" AS "*Name_matched.Infraspecific_epithet_score", |
|
17048 |
tnrs."Annotations" AS "identificationQualifier", |
|
17049 |
tnrs."Unmatched_terms" AS "morphospeciesSuffix", |
|
17050 |
tnrs."Taxonomic_status" AS "taxonomicStatus", |
|
17051 |
tnrs."Accepted_name" AS accepted_taxon_name_no_author, |
|
17052 |
tnrs."Accepted_name_author" AS accepted_author, |
|
17053 |
tnrs."Accepted_name_rank" AS accepted_taxon_rank, |
|
17054 |
tnrs."Accepted_name_url" AS "acceptedScientificNameID", |
|
17055 |
tnrs."Accepted_name_species" AS accepted_species_binomial, |
|
17056 |
tnrs."Accepted_name_family" AS accepted_family, |
|
17057 |
tnrs."Selected" AS "*Name_matched.Selected", |
|
17058 |
tnrs."Source" AS "*Name_matched.Source", |
|
17059 |
tnrs."Warnings" AS "*Name_matched.Warnings", |
|
17060 |
tnrs."Accepted_name_lsid" AS "*Name_matched.Accepted_name_lsid", |
|
17061 |
tnrs.is_valid_match AS taxon_scrub__is_valid_match, |
|
17062 |
tnrs.scrubbed_unique_taxon_name |
|
17063 |
FROM tnrs; |
|
17032 |
SELECT s."*Name_matched.batch", |
|
17033 |
s."concatenatedScientificName", |
|
17034 |
s."matchedTaxonName", |
|
17035 |
s."matchedTaxonRank", |
|
17036 |
s."*Name_matched.Name_score", |
|
17037 |
s."matchedScientificNameAuthorship", |
|
17038 |
s."matchedScientificNameID", |
|
17039 |
s."*Name_matched.Author_score", |
|
17040 |
s."matchedFamilyConfidence_fraction", |
|
17041 |
s."matchedFamily", |
|
17042 |
s."matchedGenus", |
|
17043 |
s."matchedGenusConfidence_fraction", |
|
17044 |
s."matchedSpecificEpithet", |
|
17045 |
s."matchedSpeciesConfidence_fraction", |
|
17046 |
s."matchedInfraspecificEpithet", |
|
17047 |
s."*Name_matched.Infraspecific_epithet_score", |
|
17048 |
s."identificationQualifier", |
|
17049 |
s."morphospeciesSuffix", |
|
17050 |
s."taxonomicStatus", |
|
17051 |
s.accepted_taxon_name_no_author, |
|
17052 |
s.accepted_author, |
|
17053 |
s.accepted_taxon_rank, |
|
17054 |
s."acceptedScientificNameID", |
|
17055 |
s.accepted_species_binomial, |
|
17056 |
s.accepted_family, |
|
17057 |
s."*Name_matched.Selected", |
|
17058 |
s."*Name_matched.Source", |
|
17059 |
s."*Name_matched.Warnings", |
|
17060 |
s."*Name_matched.Accepted_name_lsid", |
|
17061 |
s.taxon_scrub__is_valid_match, |
|
17062 |
s.scrubbed_unique_taxon_name, |
|
17063 |
CASE |
|
17064 |
WHEN (s.accepted_taxon_rank = 'family'::text) THEN concat_ws(' '::text, s.accepted_family, s."morphospeciesSuffix") |
|
17065 |
WHEN (s.accepted_taxon_rank = 'genus'::text) THEN concat_ws(' '::text, s.accepted_taxon_name_no_author, s."morphospeciesSuffix") |
|
17066 |
ELSE s.accepted_species_binomial |
|
17067 |
END AS accepted_morphospecies_binomial |
|
17068 |
FROM ( SELECT tnrs.batch AS "*Name_matched.batch", |
|
17069 |
tnrs."Name_submitted" AS "concatenatedScientificName", |
|
17070 |
tnrs."Name_matched" AS "matchedTaxonName", |
|
17071 |
tnrs."Name_matched_rank" AS "matchedTaxonRank", |
|
17072 |
tnrs."Name_score" AS "*Name_matched.Name_score", |
|
17073 |
tnrs."Name_matched_author" AS "matchedScientificNameAuthorship", |
|
17074 |
tnrs."Name_matched_url" AS "matchedScientificNameID", |
|
17075 |
tnrs."Author_score" AS "*Name_matched.Author_score", |
|
17076 |
tnrs."Family_score" AS "matchedFamilyConfidence_fraction", |
|
17077 |
COALESCE(tnrs."Name_matched_accepted_family", tnrs."Accepted_name_family") AS "matchedFamily", |
|
17078 |
tnrs."Genus_matched" AS "matchedGenus", |
|
17079 |
tnrs."Genus_score" AS "matchedGenusConfidence_fraction", |
|
17080 |
tnrs."Specific_epithet_matched" AS "matchedSpecificEpithet", |
|
17081 |
tnrs."Specific_epithet_score" AS "matchedSpeciesConfidence_fraction", |
|
17082 |
tnrs."Infraspecific_epithet_matched" AS "matchedInfraspecificEpithet", |
|
17083 |
tnrs."Infraspecific_epithet_score" AS "*Name_matched.Infraspecific_epithet_score", |
|
17084 |
tnrs."Annotations" AS "identificationQualifier", |
|
17085 |
tnrs."Unmatched_terms" AS "morphospeciesSuffix", |
|
17086 |
tnrs."Taxonomic_status" AS "taxonomicStatus", |
|
17087 |
tnrs."Accepted_name" AS accepted_taxon_name_no_author, |
|
17088 |
tnrs."Accepted_name_author" AS accepted_author, |
|
17089 |
tnrs."Accepted_name_rank" AS accepted_taxon_rank, |
|
17090 |
tnrs."Accepted_name_url" AS "acceptedScientificNameID", |
|
17091 |
tnrs."Accepted_name_species" AS accepted_species_binomial, |
|
17092 |
tnrs."Accepted_name_family" AS accepted_family, |
|
17093 |
tnrs."Selected" AS "*Name_matched.Selected", |
|
17094 |
tnrs."Source" AS "*Name_matched.Source", |
|
17095 |
tnrs."Warnings" AS "*Name_matched.Warnings", |
|
17096 |
tnrs."Accepted_name_lsid" AS "*Name_matched.Accepted_name_lsid", |
|
17097 |
tnrs.is_valid_match AS taxon_scrub__is_valid_match, |
|
17098 |
tnrs.scrubbed_unique_taxon_name |
|
17099 |
FROM tnrs) s; |
|
17064 | 17100 |
|
17065 | 17101 |
|
17066 | 17102 |
-- |
17103 |
-- Name: VIEW "MatchedTaxon"; Type: COMMENT; Schema: TNRS; Owner: - |
|
17104 |
-- |
|
17105 |
|
|
17106 |
COMMENT ON VIEW "MatchedTaxon" IS ' |
|
17107 |
to update, use `*, ... AS accepted_morphospecies_binomial` as the column list |
|
17108 |
'; |
|
17109 |
|
|
17110 |
|
|
17111 |
-- |
|
17067 | 17112 |
-- Name: ValidMatchedTaxon; Type: VIEW; Schema: TNRS; Owner: - |
17068 | 17113 |
-- |
17069 | 17114 |
|
... | ... | |
17098 | 17143 |
"MatchedTaxon"."*Name_matched.Warnings", |
17099 | 17144 |
"MatchedTaxon"."*Name_matched.Accepted_name_lsid", |
17100 | 17145 |
"MatchedTaxon".taxon_scrub__is_valid_match, |
17101 |
"MatchedTaxon".scrubbed_unique_taxon_name |
|
17146 |
"MatchedTaxon".scrubbed_unique_taxon_name, |
|
17147 |
"MatchedTaxon".accepted_morphospecies_binomial |
|
17102 | 17148 |
FROM "MatchedTaxon" |
17103 | 17149 |
WHERE "MatchedTaxon".taxon_scrub__is_valid_match; |
17104 | 17150 |
|
... | ... | |
17253 | 17299 |
"ValidMatchedTaxon"."*Name_matched.Warnings", |
17254 | 17300 |
"ValidMatchedTaxon"."*Name_matched.Accepted_name_lsid", |
17255 | 17301 |
"ValidMatchedTaxon".taxon_scrub__is_valid_match, |
17302 |
"ValidMatchedTaxon".accepted_morphospecies_binomial, |
|
17256 | 17303 |
"taxon_scrub.scrubbed_unique_taxon_name.*".scrubbed_taxon_rank, |
17257 | 17304 |
"taxon_scrub.scrubbed_unique_taxon_name.*".scrubbed_family, |
17258 | 17305 |
"taxon_scrub.scrubbed_unique_taxon_name.*".scrubbed_genus, |
Also available in: Unified diff
inputs/.TNRS/schema.sql: MatchedTaxon, etc.: added accepted_morphospecies_binomial derived field