Revision 12063
Added by Aaron Marcuse-Kubitza almost 11 years ago
trunk/validation/aggregating/specimens/qualitative_validations_specimens.sql | ||
---|---|---|
1 |
-- ------------------------------------------------------------------------- |
|
2 |
-- Quantitative validation queries on the BIEN database |
|
3 |
-- |
|
4 |
-- Applies to any datasource with specimens |
|
5 |
-- |
|
6 |
-- DB: vegbien |
|
7 |
-- Host: vegbiendev.nceas.ucsb.edu |
|
8 |
-- ------------------------------------------------------------------------- |
|
9 |
|
|
10 |
-- ------------------------------- |
|
11 |
-- 1. Count of total records (specimens) in source db |
|
12 |
-- Check: full join against equivalent query on BIEN3 db should return 1 row |
|
13 |
-- ------------------------------- |
|
14 |
|
|
15 |
-- ------------------------------- |
|
16 |
-- 2. Count of unique (verbatim) non-null families |
|
17 |
-- Check: Full inner join to equivalent query on BIEN3 db should return 1 row |
|
18 |
-- ------------------------------- |
|
19 |
|
|
20 |
-- ------------------------------- |
|
21 |
-- 3. List of verbatim families |
|
22 |
-- Check: Full inner join to equivalent query on BIEN3 db should return same number of rows |
|
23 |
-- ------------------------------- |
|
24 |
|
|
25 |
-- ------------------------------- |
|
26 |
-- 4. Count of unique (verbatim) non-null species, without author |
|
27 |
-- Check: Full inner join to equivalent query on BIEN3 db should return 1 row |
|
28 |
-- ------------------------------- |
|
29 |
|
|
30 |
-- ------------------------------- |
|
31 |
-- 5. List of verbatim species, excluding author |
|
32 |
-- Check: Full inner join to equivalent query on BIEN3 db should return 3335 rows |
|
33 |
-- ------------------------------- |
|
34 |
|
|
35 |
-- ------------------------------- |
|
36 |
-- 6. Count of unique (verbatim) non-null subspecific taxa, without author |
|
37 |
-- Check: Full inner join to equivalent query on BIEN3 db should return 1 row |
|
38 |
-- ------------------------------- |
|
39 |
|
|
40 |
-- ------------------------------- |
|
41 |
-- 7. List of verbatim subspecific taxa, without author |
|
42 |
-- Check: Full inner join to equivalent query on BIEN3 db should return 40145 rows |
|
43 |
-- ------------------------------- |
|
44 |
|
|
45 |
-- ------------------------------- |
|
46 |
-- 8. Count of unique (verbatim) taxa including author, for all taxa identified at least to genus |
|
47 |
-- Check: Full inner join to equivalent query on BIEN3 db should return 1 row |
|
48 |
-- ------------------------------- |
|
49 |
|
|
50 |
-- ------------------------------- |
|
51 |
-- 9. List of unique (verbatim) taxa including author, for all taxa identified at least to genus |
|
52 |
-- Check: Full inner join to equivalent query on BIEN3 db should return 45997 rows |
|
53 |
-- ------------------------------- |
|
54 |
|
|
55 |
-- ------------------------------- |
|
56 |
-- 10. Count number of records by institution |
|
57 |
-- Check: Full inner join to equivalent query on BIEN3 db should return 6 rows |
|
58 |
-- Note: Majority should be from 'NY'; these are standard herbarium acronyms |
|
59 |
-- ------------------------------- |
|
60 |
|
|
61 |
-- ------------------------------- |
|
62 |
-- 11. List of three standard political divisions |
|
63 |
-- Check: Full inner join to equivalent query on BIEN3 db should return 5232 rows |
|
64 |
-- Note: character set issues may cause mis-matches. This query is a good way to reveal |
|
65 |
-- character set issues, either in source db or in BIEN |
|
66 |
-- ------------------------------- |
|
67 |
|
|
68 |
-- ------------------------------- |
|
69 |
-- 12. Check distinct Collector names + collection numbers + collection dates, |
|
70 |
-- plus total records |
|
71 |
-- Check: Full inner join to equivalent query on BIEN3 db should return 309396 rows |
|
72 |
-- ------------------------------- |
|
73 |
|
|
74 |
-- ------------------------------- |
|
75 |
-- 13. Count of all verbatim Latitude and Longitude values, as well as all |
|
76 |
-- latitude and longitude values that are decimals numbers |
|
77 |
-- Check: full join to equivalent query against BIEN3 should return 1 row |
|
78 |
-- ------------------------------- |
|
79 |
|
|
80 |
-- ------------------------------- |
|
81 |
-- 14. Count of all verbatim Latitude and Longitude values that are not valid values |
|
82 |
-- of decimal latitude or decimal longitude |
|
83 |
-- Check: full join to equivalent query against BIEN3 should return 1 row |
|
84 |
-- ------------------------------- |
|
85 |
|
|
86 |
-- ------------------------------- |
|
87 |
-- 15. List distinct non-null locality descriptions |
|
88 |
-- Check: full join to equivalent query against BIEN3 should return 125592 records |
|
89 |
-- ------------------------------- |
|
90 |
|
|
91 |
-- ------------------------------- |
|
92 |
-- 16. List distinct non-null specimen descriptions |
|
93 |
-- Check: full join to equivalent query against BIEN3 should return 158460 records |
|
94 |
-- Note: specimens descriptions in nybg extract is in column PlantFungusDescription |
|
95 |
-- ------------------------------- |
Also available in: Unified diff
added validation/aggregating/specimens/qualitative_validations_specimens.sql template, with query descriptions from NY/qualitative_validations_source_db_NYBG.sql