Revision 14375
Added by Aaron Marcuse-Kubitza over 10 years ago
vegbien.sql | ||
---|---|---|
19876 | 19876 |
ELSE NULL::text |
19877 | 19877 |
END) FROM (SELECT new.*) new); |
19878 | 19878 |
new."Accepted_species[_binomial]__@TNRS__@vegpath.org" = (SELECT rtrim("*Accepted_name_species", ' '::text) FROM (SELECT new.*) new); |
19879 |
new."__accepted_{genus,specific_epithet}" = (SELECT regexp_split_to_array("Accepted_species[_binomial]__@TNRS__@vegpath.org", ' '::text) FROM (SELECT new.*) new);
|
|
19879 |
new."__accepted_{genus,specific_epithet}" = (SELECT regexp_split_to_array("*Accepted_name", ' '::text) FROM (SELECT new.*) new);
|
|
19880 | 19880 |
new."[accepted_]genus__@DwC__@vegpath.org" = (SELECT COALESCE("__accepted_{genus,specific_epithet}"[1], |
19881 | 19881 |
CASE |
19882 | 19882 |
WHEN ("*Accepted_name_rank" = 'genus'::text) THEN "*Accepted_name" |
... | ... | |
20223 | 20223 |
CONSTRAINT "[scrubbed_]taxonomicStatus__@DwC__@vegpath.org" CHECK ((NOT ("[scrubbed_]taxonomicStatus__@DwC__@vegpath.org" IS DISTINCT FROM map_taxonomic_status("*Taxonomic_status", "*Accepted_name")))), |
20224 | 20224 |
CONSTRAINT __accepted_infraspecific_label CHECK ((NOT (__accepted_infraspecific_label IS DISTINCT FROM ltrim(NULLIF(remove_prefix("Accepted_species[_binomial]__@TNRS__@vegpath.org", "*Accepted_name", require := true, case_sensitive := false), ''::text), ' '::text)))), |
20225 | 20225 |
CONSTRAINT "__accepted_infraspecific_{rank,epithet}" CHECK ((NOT ("__accepted_infraspecific_{rank,epithet}" IS DISTINCT FROM regexp_split_to_array(__accepted_infraspecific_label, ' '::text)))), |
20226 |
CONSTRAINT "__accepted_{genus,specific_epithet}" CHECK ((NOT ("__accepted_{genus,specific_epithet}" IS DISTINCT FROM regexp_split_to_array("Accepted_species[_binomial]__@TNRS__@vegpath.org", ' '::text)))),
|
|
20226 |
CONSTRAINT "__accepted_{genus,specific_epithet}" CHECK ((NOT ("__accepted_{genus,specific_epithet}" IS DISTINCT FROM regexp_split_to_array("*Accepted_name", ' '::text)))),
|
|
20227 | 20227 |
CONSTRAINT matched_has_accepted CHECK ((NOT (matched_has_accepted IS DISTINCT FROM ("*Accepted_name" IS NOT NULL)))), |
20228 | 20228 |
CONSTRAINT "matched~Name[_no_author]___@TNRS__@vegpath.org" CHECK ((NOT ("matched~Name[_no_author]___@TNRS__@vegpath.org" IS DISTINCT FROM NULLIF("*Name_matched", 'No suitable matches found.'::text)))) |
20229 | 20229 |
); |
... | ... | |
20420 | 20420 |
-- |
20421 | 20421 |
|
20422 | 20422 |
COMMENT ON COLUMN taxon_match."__accepted_{genus,specific_epithet}" IS ' |
20423 |
= regexp_split_to_array("Accepted_species[_binomial]__@TNRS__@vegpath.org", '' ''::text)
|
|
20423 |
= regexp_split_to_array("*Accepted_name", '' ''::text)
|
|
20424 | 20424 |
|
20425 | 20425 |
derived column |
20426 | 20426 |
|
20427 | 20427 |
to modify expr: |
20428 |
SELECT util.derived_col_update(((''"TNRS".taxon_match'', ''__accepted_{genus,specific_epithet}'')::util.col, $$regexp_split_to_array("Accepted_species[_binomial]__@TNRS__@vegpath.org", '' ''::text)$$)::util.derived_col_def);
|
|
20428 |
SELECT util.derived_col_update(((''"TNRS".taxon_match'', ''__accepted_{genus,specific_epithet}'')::util.col, $$regexp_split_to_array("*Accepted_name", '' ''::text)$$)::util.derived_col_def);
|
|
20429 | 20429 |
SELECT util.derived_cols_populate(''"TNRS".taxon_match''::regclass); |
20430 | 20430 |
|
20431 | 20431 |
to rename: |
Also available in: Unified diff
bugfix: inputs/.TNRS/schema.sql: taxon_match."__accepted_{genus,specific_epithet}": use "*Accepted_name" instead of "Accepted_species[_binomial]__@TNRS__@vegpath.org" (from "*Accepted_name_species") because Accepted_name_species apparently sometimes does not match the Accepted_name and uses malformed Unicode characters