SELECT '# specimen replicates' AS ___;
SELECT count(*) AS count
FROM specimenreplicate
JOIN party ON party_id = datasource_id AND organizationname = :datasource
;

SELECT '# families' AS ___;
SELECT count(DISTINCT plantname) AS count
FROM specimenreplicate
JOIN party ON party_id = datasource_id AND organizationname = :datasource
JOIN taxondetermination USING (taxonoccurrence_id)
JOIN plantconcept USING (plantconcept_id)
JOIN plantname USING (plantname_id)
WHERE rank = 'Family'
;
