Project

General

Profile

« Previous | Next » 

Revision 1254

specimens verification: Added # binomials test

View differences:

inputs/NYBG/verify/specimens.ref.sql
10 10
SELECT '# species' AS ___;
11 11
SELECT count(DISTINCT Genus, Species) AS count FROM nybg_raw;
12 12

  
13
SELECT '# binomials' AS ___;
14
SELECT count(DISTINCT ScientificName) AS count FROM nybg_raw;
15

  
13 16
/*
14
SELECT 
15
(
16
SELECT COUNT(DISTINCT Family) FROM nybg_raw WHERE Family IS NOT NULL
17
) AS families, 
18
(
19
SELECT COUNT(DISTINCT Genus) FROM nybg_raw WHERE Genus IS NOT NULL
20
) AS genera,
21
(
22
SELECT COUNT(DISTINCT Genus, Species) FROM nybg_raw 
23
WHERE Genus IS NOT NULL AND Species IS NOT NULL
24
) AS species;
25

  
26 17
SELECT DISTINCT CONCAT_WS(' ', Genus, Species) AS Species
27 18
FROM nybg_raw 
28 19
WHERE Genus IS NOT NULL AND Species IS NOT NULL;
inputs/NYBG/verify/specimens.ref
14 14
# species
15 15
count
16 16
40145
17
___
18
# binomials
19
count
20
46282
mappings/verify.specimens.sql
56 56
WHERE datasource_id =
57 57
    (SELECT party_id FROM party WHERE organizationname = :datasource)
58 58
;
59

  
60
SELECT '# binomials' AS ___;
61
SELECT count(DISTINCT plantname) AS count
62
FROM specimenreplicate
63
JOIN taxondetermination USING (taxonoccurrence_id)
64
JOIN plantconcept USING (plantconcept_id)
65
JOIN plantname
66
    ON plantname.plantname_id = plantconcept.plantname_id
67
    AND plantname.rank = 'Binomial'
68
WHERE datasource_id =
69
    (SELECT party_id FROM party WHERE organizationname = :datasource)
70
AND taxondetermination.isoriginal
71
;

Also available in: Unified diff