Revision 12889
Added by Aaron Marcuse-Kubitza almost 11 years ago
trunk/validation/aggregating/specimens/qualitative_validations_specimens.sql | ||
---|---|---|
11 | 11 |
|
12 | 12 |
-- ------------------------------- |
13 | 13 |
-- 1. Count of total records (specimens) in source db |
14 |
-- Check: full outer join against equivalent query on BIEN3 db should return 1 row
|
|
14 |
-- Check: should return 1 row |
|
15 | 15 |
-- ------------------------------- |
16 | 16 |
CREATE OR REPLACE VIEW _specimens_01_count_of_total_records_specimens_in_source_db AS |
17 | 17 |
|
18 | 18 |
-- ------------------------------- |
19 | 19 |
-- 2. Count of unique (verbatim) non-null families |
20 |
-- Check: Full outer join to equivalent query on BIEN3 db should return 1 row
|
|
20 |
-- Check: should return 1 row |
|
21 | 21 |
-- ------------------------------- |
22 | 22 |
CREATE OR REPLACE VIEW _specimens_02_count_of_unique_verbatim_families AS |
23 | 23 |
|
24 | 24 |
-- ------------------------------- |
25 | 25 |
-- 3. List of verbatim families |
26 |
-- Check: Full outer join to equivalent query on BIEN3 db should return same number of rows
|
|
26 |
-- Check: should return same number of rows |
|
27 | 27 |
-- ------------------------------- |
28 | 28 |
CREATE OR REPLACE VIEW _specimens_03_list_of_verbatim_families AS |
29 | 29 |
|
30 | 30 |
-- ------------------------------- |
31 | 31 |
-- 4. Count of unique (verbatim) non-null species, without author |
32 |
-- Check: Full outer join to equivalent query on BIEN3 db should return 1 row
|
|
32 |
-- Check: should return 1 row |
|
33 | 33 |
-- ------------------------------- |
34 | 34 |
CREATE OR REPLACE VIEW _specimens_04_count_of_unique_verbatim_species_without_author AS |
35 | 35 |
|
36 | 36 |
-- ------------------------------- |
37 | 37 |
-- 5. List of verbatim species, excluding author |
38 |
-- Check: Full outer join to equivalent query on BIEN3 db should return 3335 rows
|
|
38 |
-- Check: should return 3335 rows |
|
39 | 39 |
-- ------------------------------- |
40 | 40 |
CREATE OR REPLACE VIEW _specimens_05_list_of_verbatim_species_excluding_author AS |
41 | 41 |
|
42 | 42 |
-- ------------------------------- |
43 | 43 |
-- 6. Count of unique (verbatim) non-null subspecific taxa, without author |
44 |
-- Check: Full outer join to equivalent query on BIEN3 db should return 1 row
|
|
44 |
-- Check: should return 1 row |
|
45 | 45 |
-- ------------------------------- |
46 | 46 |
CREATE OR REPLACE VIEW _specimens_06_count_of_unique_verbatim_subsp_taxa_without_author AS |
47 | 47 |
|
48 | 48 |
-- ------------------------------- |
49 | 49 |
-- 7. List of verbatim subspecific taxa, without author |
50 |
-- Check: Full outer join to equivalent query on BIEN3 db should return 40145 rows
|
|
50 |
-- Check: should return 40145 rows |
|
51 | 51 |
-- ------------------------------- |
52 | 52 |
CREATE OR REPLACE VIEW _specimens_07_list_of_verbatim_subspecific_taxa_without_author AS |
53 | 53 |
|
54 | 54 |
-- ------------------------------- |
55 | 55 |
-- 8. Count of unique (verbatim) taxa including author, for all taxa identified at least to genus |
56 |
-- Check: Full outer join to equivalent query on BIEN3 db should return 1 row
|
|
56 |
-- Check: should return 1 row |
|
57 | 57 |
-- ------------------------------- |
58 | 58 |
CREATE OR REPLACE VIEW _specimens_08_count_of_unique_verbatim_author_taxa_with_genus AS |
59 | 59 |
|
60 | 60 |
-- ------------------------------- |
61 | 61 |
-- 9. List of unique (verbatim) taxa including author, for all taxa identified at least to genus |
62 |
-- Check: Full outer join to equivalent query on BIEN3 db should return 45997 rows
|
|
62 |
-- Check: should return 45997 rows |
|
63 | 63 |
-- ------------------------------- |
64 | 64 |
CREATE OR REPLACE VIEW _specimens_09_list_of_unique_verbatim_author_taxa_with_genus AS |
65 | 65 |
|
66 | 66 |
-- ------------------------------- |
67 | 67 |
-- 10. Count number of records by institution |
68 |
-- Check: Full outer join to equivalent query on BIEN3 db should return 6 rows
|
|
68 |
-- Check: should return 6 rows |
|
69 | 69 |
-- Note: Majority should be from 'NY'; these are standard herbarium acronyms |
70 | 70 |
-- ------------------------------- |
71 | 71 |
CREATE OR REPLACE VIEW _specimens_10_count_number_of_records_by_institution AS |
72 | 72 |
|
73 | 73 |
-- ------------------------------- |
74 | 74 |
-- 11. List of three standard political divisions |
75 |
-- Check: Full outer join to equivalent query on BIEN3 db should return 5232 rows
|
|
75 |
-- Check: should return 5232 rows |
|
76 | 76 |
-- Note: character set issues may cause mis-matches. This query is a good way to reveal |
77 | 77 |
-- character set issues, either in source db or in BIEN |
78 | 78 |
-- ------------------------------- |
... | ... | |
81 | 81 |
-- ------------------------------- |
82 | 82 |
-- 12. Check distinct Collector names + collection numbers + collection dates, |
83 | 83 |
-- plus total records |
84 |
-- Check: Full outer join to equivalent query on BIEN3 db should return 309396 rows
|
|
84 |
-- Check: should return 309396 rows |
|
85 | 85 |
-- ------------------------------- |
86 | 86 |
CREATE OR REPLACE VIEW _specimens_12_distinct_collector_name_collect_num_date_w_count AS |
87 | 87 |
|
88 | 88 |
-- ------------------------------- |
89 | 89 |
-- 13. Count of all verbatim Latitude and Longitude values, as well as all |
90 | 90 |
-- latitude and longitude values that are decimals numbers |
91 |
-- Check: full outer join to equivalent query against BIEN3 should return 1 row
|
|
91 |
-- Check: should return 1 row |
|
92 | 92 |
-- ------------------------------- |
93 | 93 |
CREATE OR REPLACE VIEW _specimens_13_count_of_all_verbatim_and_decimal_lat_long AS |
94 | 94 |
|
95 | 95 |
-- ------------------------------- |
96 | 96 |
-- 14. Count of all verbatim Latitude and Longitude values that are not valid values |
97 | 97 |
-- of decimal latitude or decimal longitude |
98 |
-- Check: full outer join to equivalent query against BIEN3 should return 1 row
|
|
98 |
-- Check: should return 1 row |
|
99 | 99 |
-- ------------------------------- |
100 | 100 |
CREATE OR REPLACE VIEW _specimens_14_count_of_all_invalid_verbatim_lat_long AS |
101 | 101 |
|
102 | 102 |
-- ------------------------------- |
103 | 103 |
-- 15. List distinct non-null locality descriptions |
104 |
-- Check: full outer join to equivalent query against BIEN3 should return 125592 records
|
|
104 |
-- Check: should return 125592 records |
|
105 | 105 |
-- ------------------------------- |
106 | 106 |
CREATE OR REPLACE VIEW _specimens_15_list_distinct_locality_descriptions AS |
107 | 107 |
|
108 | 108 |
-- ------------------------------- |
109 | 109 |
-- 16. List distinct non-null specimen descriptions |
110 |
-- Check: full outer join to equivalent query against BIEN3 should return 158460 records
|
|
110 |
-- Check: should return 158460 records |
|
111 | 111 |
-- Note: specimens descriptions in nybg extract is in column PlantFungusDescription |
112 | 112 |
-- ------------------------------- |
113 | 113 |
CREATE OR REPLACE VIEW _specimens_16_list_distinct_specimen_descriptions AS |
Also available in: Unified diff
validation/aggregating/specimens/qualitative_validations_specimens.sql: reworded rowcount check comments to apply to the output queries