Revision 12903
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: should return 1 row |
|
15 | 14 |
-- ------------------------------- |
16 | 15 |
CREATE OR REPLACE VIEW _specimens_01_count_of_total_records_specimens_in_source_db AS |
17 | 16 |
; |
18 | 17 |
|
19 | 18 |
-- ------------------------------- |
20 | 19 |
-- 2. Count of unique (verbatim) non-null families |
21 |
-- Check: should return 1 row |
|
22 | 20 |
-- ------------------------------- |
23 | 21 |
CREATE OR REPLACE VIEW _specimens_02_count_of_unique_verbatim_families AS |
24 | 22 |
; |
25 | 23 |
|
26 | 24 |
-- ------------------------------- |
27 | 25 |
-- 3. List of verbatim families |
28 |
-- Check: should return same number of rows |
|
29 | 26 |
-- ------------------------------- |
30 | 27 |
CREATE OR REPLACE VIEW _specimens_03_list_of_verbatim_families AS |
31 | 28 |
; |
32 | 29 |
|
33 | 30 |
-- ------------------------------- |
34 | 31 |
-- 4. Count of unique (verbatim) non-null species, without author |
35 |
-- Check: should return 1 row |
|
36 | 32 |
-- ------------------------------- |
37 | 33 |
CREATE OR REPLACE VIEW _specimens_04_count_of_unique_verbatim_species_without_author AS |
38 | 34 |
; |
39 | 35 |
|
40 | 36 |
-- ------------------------------- |
41 | 37 |
-- 5. List of verbatim species, excluding author |
42 |
-- Check: should return 3335 rows |
|
43 | 38 |
-- ------------------------------- |
44 | 39 |
CREATE OR REPLACE VIEW _specimens_05_list_of_verbatim_species_excluding_author AS |
45 | 40 |
; |
46 | 41 |
|
47 | 42 |
-- ------------------------------- |
48 | 43 |
-- 6. Count of unique (verbatim) non-null subspecific taxa, without author |
49 |
-- Check: should return 1 row |
|
50 | 44 |
-- ------------------------------- |
51 | 45 |
CREATE OR REPLACE VIEW _specimens_06_count_of_unique_verbatim_subsp_taxa_without_author AS |
52 | 46 |
; |
53 | 47 |
|
54 | 48 |
-- ------------------------------- |
55 | 49 |
-- 7. List of verbatim subspecific taxa, without author |
56 |
-- Check: should return 40145 rows |
|
57 | 50 |
-- ------------------------------- |
58 | 51 |
CREATE OR REPLACE VIEW _specimens_07_list_of_verbatim_subspecific_taxa_without_author AS |
59 | 52 |
; |
60 | 53 |
|
61 | 54 |
-- ------------------------------- |
62 | 55 |
-- 8. Count of unique (verbatim) taxa including author, for all taxa identified at least to genus |
63 |
-- Check: should return 1 row |
|
64 | 56 |
-- ------------------------------- |
65 | 57 |
CREATE OR REPLACE VIEW _specimens_08_count_of_unique_verbatim_author_taxa_with_genus AS |
66 | 58 |
; |
67 | 59 |
|
68 | 60 |
-- ------------------------------- |
69 | 61 |
-- 9. List of unique (verbatim) taxa including author, for all taxa identified at least to genus |
70 |
-- Check: should return 45997 rows |
|
71 | 62 |
-- ------------------------------- |
72 | 63 |
CREATE OR REPLACE VIEW _specimens_09_list_of_unique_verbatim_author_taxa_with_genus AS |
73 | 64 |
; |
74 | 65 |
|
75 | 66 |
-- ------------------------------- |
76 | 67 |
-- 10. Count number of records by institution |
77 |
-- Check: should return 6 rows |
|
78 | 68 |
-- ------------------------------- |
79 | 69 |
CREATE OR REPLACE VIEW _specimens_10_count_number_of_records_by_institution AS |
80 | 70 |
; |
81 | 71 |
|
82 | 72 |
-- ------------------------------- |
83 | 73 |
-- 11. List of three standard political divisions |
84 |
-- Check: should return 5232 rows |
|
85 | 74 |
-- Note: character set issues may cause mis-matches. This query is a good way to reveal |
86 | 75 |
-- character set issues, either in source db or in BIEN |
87 | 76 |
-- ------------------------------- |
... | ... | |
91 | 80 |
-- ------------------------------- |
92 | 81 |
-- 12. Check distinct Collector names + collection numbers + collection dates, |
93 | 82 |
-- plus total records |
94 |
-- Check: should return 309396 rows |
|
95 | 83 |
-- ------------------------------- |
96 | 84 |
CREATE OR REPLACE VIEW _specimens_12_distinct_collector_name_collect_num_date_w_count AS |
97 | 85 |
; |
... | ... | |
99 | 87 |
-- ------------------------------- |
100 | 88 |
-- 13. Count of all verbatim Latitude and Longitude values, as well as all |
101 | 89 |
-- latitude and longitude values that are decimals numbers |
102 |
-- Check: should return 1 row |
|
103 | 90 |
-- ------------------------------- |
104 | 91 |
CREATE OR REPLACE VIEW _specimens_13_count_of_all_verbatim_and_decimal_lat_long AS |
105 | 92 |
; |
... | ... | |
107 | 94 |
-- ------------------------------- |
108 | 95 |
-- 14. Count of all verbatim Latitude and Longitude values that are not valid values |
109 | 96 |
-- of decimal latitude or decimal longitude |
110 |
-- Check: should return 1 row |
|
111 | 97 |
-- ------------------------------- |
112 | 98 |
CREATE OR REPLACE VIEW _specimens_14_count_of_all_invalid_verbatim_lat_long AS |
113 | 99 |
; |
114 | 100 |
|
115 | 101 |
-- ------------------------------- |
116 | 102 |
-- 15. List distinct non-null locality descriptions |
117 |
-- Check: should return 125592 records |
|
118 | 103 |
-- ------------------------------- |
119 | 104 |
CREATE OR REPLACE VIEW _specimens_15_list_distinct_locality_descriptions AS |
120 | 105 |
; |
121 | 106 |
|
122 | 107 |
-- ------------------------------- |
123 | 108 |
-- 16. List distinct non-null specimen descriptions |
124 |
-- Check: should return 158460 records |
|
125 | 109 |
-- ------------------------------- |
126 | 110 |
CREATE OR REPLACE VIEW _specimens_16_list_distinct_specimen_descriptions AS |
127 | 111 |
; |
Also available in: Unified diff
validation/aggregating/specimens/qualitative_validations_specimens.sql: removed "Check: should return [#] rows" comments because these only apply to the NY results, not to all specimens datasources