Revision 13498
Added by Aaron Marcuse-Kubitza over 10 years ago
schema.sql | ||
---|---|---|
224 | 224 |
-- |
225 | 225 |
|
226 | 226 |
CREATE VIEW "MatchedTaxon" AS |
227 |
SELECT tnrs.batch AS "*Name_matched.batch", |
|
228 |
tnrs."Name_submitted" AS "concatenatedScientificName", |
|
229 |
tnrs."Name_matched" AS "matchedTaxonName", |
|
230 |
tnrs."Name_matched_rank" AS "matchedTaxonRank", |
|
231 |
tnrs."Name_score" AS "*Name_matched.Name_score", |
|
232 |
tnrs."Name_matched_author" AS "matchedScientificNameAuthorship", |
|
233 |
tnrs."Name_matched_url" AS "matchedScientificNameID", |
|
234 |
tnrs."Author_score" AS "*Name_matched.Author_score", |
|
235 |
tnrs."Family_score" AS "matchedFamilyConfidence_fraction", |
|
236 |
COALESCE(tnrs."Name_matched_accepted_family", tnrs."Accepted_name_family") AS "matchedFamily", |
|
237 |
tnrs."Genus_matched" AS "matchedGenus", |
|
238 |
tnrs."Genus_score" AS "matchedGenusConfidence_fraction", |
|
239 |
tnrs."Specific_epithet_matched" AS "matchedSpecificEpithet", |
|
240 |
tnrs."Specific_epithet_score" AS "matchedSpeciesConfidence_fraction", |
|
241 |
tnrs."Infraspecific_epithet_matched" AS "matchedInfraspecificEpithet", |
|
242 |
tnrs."Infraspecific_epithet_score" AS "*Name_matched.Infraspecific_epithet_score", |
|
243 |
tnrs."Annotations" AS "identificationQualifier", |
|
244 |
tnrs."Unmatched_terms" AS "morphospeciesSuffix", |
|
245 |
tnrs."Taxonomic_status" AS "taxonomicStatus", |
|
246 |
tnrs."Accepted_name" AS accepted_taxon_name_no_author, |
|
247 |
tnrs."Accepted_name_author" AS accepted_author, |
|
248 |
tnrs."Accepted_name_rank" AS accepted_taxon_rank, |
|
249 |
tnrs."Accepted_name_url" AS "acceptedScientificNameID", |
|
250 |
tnrs."Accepted_name_species" AS accepted_species_binomial, |
|
251 |
tnrs."Accepted_name_family" AS accepted_family, |
|
252 |
tnrs."Selected" AS "*Name_matched.Selected", |
|
253 |
tnrs."Source" AS "*Name_matched.Source", |
|
254 |
tnrs."Warnings" AS "*Name_matched.Warnings", |
|
255 |
tnrs."Accepted_name_lsid" AS "*Name_matched.Accepted_name_lsid", |
|
256 |
tnrs.is_valid_match AS taxon_scrub__is_valid_match, |
|
257 |
tnrs.scrubbed_unique_taxon_name |
|
258 |
FROM tnrs; |
|
227 |
SELECT s."*Name_matched.batch", |
|
228 |
s."concatenatedScientificName", |
|
229 |
s."matchedTaxonName", |
|
230 |
s."matchedTaxonRank", |
|
231 |
s."*Name_matched.Name_score", |
|
232 |
s."matchedScientificNameAuthorship", |
|
233 |
s."matchedScientificNameID", |
|
234 |
s."*Name_matched.Author_score", |
|
235 |
s."matchedFamilyConfidence_fraction", |
|
236 |
s."matchedFamily", |
|
237 |
s."matchedGenus", |
|
238 |
s."matchedGenusConfidence_fraction", |
|
239 |
s."matchedSpecificEpithet", |
|
240 |
s."matchedSpeciesConfidence_fraction", |
|
241 |
s."matchedInfraspecificEpithet", |
|
242 |
s."*Name_matched.Infraspecific_epithet_score", |
|
243 |
s."identificationQualifier", |
|
244 |
s."morphospeciesSuffix", |
|
245 |
s."taxonomicStatus", |
|
246 |
s.accepted_taxon_name_no_author, |
|
247 |
s.accepted_author, |
|
248 |
s.accepted_taxon_rank, |
|
249 |
s."acceptedScientificNameID", |
|
250 |
s.accepted_species_binomial, |
|
251 |
s.accepted_family, |
|
252 |
s."*Name_matched.Selected", |
|
253 |
s."*Name_matched.Source", |
|
254 |
s."*Name_matched.Warnings", |
|
255 |
s."*Name_matched.Accepted_name_lsid", |
|
256 |
s.taxon_scrub__is_valid_match, |
|
257 |
s.scrubbed_unique_taxon_name, |
|
258 |
CASE |
|
259 |
WHEN (s.accepted_taxon_rank = 'family'::text) THEN concat_ws(' '::text, s.accepted_family, s."morphospeciesSuffix") |
|
260 |
WHEN (s.accepted_taxon_rank = 'genus'::text) THEN concat_ws(' '::text, s.accepted_taxon_name_no_author, s."morphospeciesSuffix") |
|
261 |
ELSE s.accepted_species_binomial |
|
262 |
END AS accepted_morphospecies_binomial |
|
263 |
FROM ( SELECT tnrs.batch AS "*Name_matched.batch", |
|
264 |
tnrs."Name_submitted" AS "concatenatedScientificName", |
|
265 |
tnrs."Name_matched" AS "matchedTaxonName", |
|
266 |
tnrs."Name_matched_rank" AS "matchedTaxonRank", |
|
267 |
tnrs."Name_score" AS "*Name_matched.Name_score", |
|
268 |
tnrs."Name_matched_author" AS "matchedScientificNameAuthorship", |
|
269 |
tnrs."Name_matched_url" AS "matchedScientificNameID", |
|
270 |
tnrs."Author_score" AS "*Name_matched.Author_score", |
|
271 |
tnrs."Family_score" AS "matchedFamilyConfidence_fraction", |
|
272 |
COALESCE(tnrs."Name_matched_accepted_family", tnrs."Accepted_name_family") AS "matchedFamily", |
|
273 |
tnrs."Genus_matched" AS "matchedGenus", |
|
274 |
tnrs."Genus_score" AS "matchedGenusConfidence_fraction", |
|
275 |
tnrs."Specific_epithet_matched" AS "matchedSpecificEpithet", |
|
276 |
tnrs."Specific_epithet_score" AS "matchedSpeciesConfidence_fraction", |
|
277 |
tnrs."Infraspecific_epithet_matched" AS "matchedInfraspecificEpithet", |
|
278 |
tnrs."Infraspecific_epithet_score" AS "*Name_matched.Infraspecific_epithet_score", |
|
279 |
tnrs."Annotations" AS "identificationQualifier", |
|
280 |
tnrs."Unmatched_terms" AS "morphospeciesSuffix", |
|
281 |
tnrs."Taxonomic_status" AS "taxonomicStatus", |
|
282 |
tnrs."Accepted_name" AS accepted_taxon_name_no_author, |
|
283 |
tnrs."Accepted_name_author" AS accepted_author, |
|
284 |
tnrs."Accepted_name_rank" AS accepted_taxon_rank, |
|
285 |
tnrs."Accepted_name_url" AS "acceptedScientificNameID", |
|
286 |
tnrs."Accepted_name_species" AS accepted_species_binomial, |
|
287 |
tnrs."Accepted_name_family" AS accepted_family, |
|
288 |
tnrs."Selected" AS "*Name_matched.Selected", |
|
289 |
tnrs."Source" AS "*Name_matched.Source", |
|
290 |
tnrs."Warnings" AS "*Name_matched.Warnings", |
|
291 |
tnrs."Accepted_name_lsid" AS "*Name_matched.Accepted_name_lsid", |
|
292 |
tnrs.is_valid_match AS taxon_scrub__is_valid_match, |
|
293 |
tnrs.scrubbed_unique_taxon_name |
|
294 |
FROM tnrs) s; |
|
259 | 295 |
|
260 | 296 |
|
261 | 297 |
-- |
298 |
-- Name: VIEW "MatchedTaxon"; Type: COMMENT; Schema: TNRS; Owner: - |
|
299 |
-- |
|
300 |
|
|
301 |
COMMENT ON VIEW "MatchedTaxon" IS ' |
|
302 |
to update, use `*, ... AS accepted_morphospecies_binomial` as the column list |
|
303 |
'; |
|
304 |
|
|
305 |
|
|
306 |
-- |
|
262 | 307 |
-- Name: ValidMatchedTaxon; Type: VIEW; Schema: TNRS; Owner: - |
263 | 308 |
-- |
264 | 309 |
|
... | ... | |
293 | 338 |
"MatchedTaxon"."*Name_matched.Warnings", |
294 | 339 |
"MatchedTaxon"."*Name_matched.Accepted_name_lsid", |
295 | 340 |
"MatchedTaxon".taxon_scrub__is_valid_match, |
296 |
"MatchedTaxon".scrubbed_unique_taxon_name |
|
341 |
"MatchedTaxon".scrubbed_unique_taxon_name, |
|
342 |
"MatchedTaxon".accepted_morphospecies_binomial |
|
297 | 343 |
FROM "MatchedTaxon" |
298 | 344 |
WHERE "MatchedTaxon".taxon_scrub__is_valid_match; |
299 | 345 |
|
... | ... | |
448 | 494 |
"ValidMatchedTaxon"."*Name_matched.Warnings", |
449 | 495 |
"ValidMatchedTaxon"."*Name_matched.Accepted_name_lsid", |
450 | 496 |
"ValidMatchedTaxon".taxon_scrub__is_valid_match, |
497 |
"ValidMatchedTaxon".accepted_morphospecies_binomial, |
|
451 | 498 |
"taxon_scrub.scrubbed_unique_taxon_name.*".scrubbed_taxon_rank, |
452 | 499 |
"taxon_scrub.scrubbed_unique_taxon_name.*".scrubbed_family, |
453 | 500 |
"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