Revision 664255b8
Added by Andreas Müller over 4 years ago
cdm-pesi/src/main/java/eu/etaxonomy/cdm/io/pesi/erms/validation/PesiErmsValidator.java | ||
---|---|---|
165 | 165 |
return equals("CommonName count ", countSrc, countDest, String.valueOf(-1)); |
166 | 166 |
} |
167 | 167 |
|
168 |
private final String countTaxonRelation = "SELECT count(*) FROM tu WHERE tu_acctaxon <> id AND id " + moneraFilter; |
|
168 |
private final String countSynonymRelation = "SELECT count(*) FROM tu WHERE tu_acctaxon <> id AND id " + moneraFilter; |
|
169 |
private final String countParentRelation = "SELECT count(*) FROM tu WHERE tu_parent is not null and tu_status = 1 and id <> tu_parent AND id " + moneraFilter; |
|
169 | 170 |
private boolean testTaxonRelationCount() { |
170 |
int countSrc = source.getUniqueInteger(countTaxonRelation); |
|
171 |
int countDest = destination.getUniqueInteger("SELECT count(*) FROM RelTaxon "); |
|
172 |
return equals("Taxon count ", countSrc, countDest, String.valueOf(-1)); |
|
171 |
//synonyms |
|
172 |
int countSrc = source.getUniqueInteger(countSynonymRelation); |
|
173 |
//TODO |
|
174 |
int countDest = destination.getUniqueInteger("SELECT count(*) FROM RelTaxon WHERE RelTaxonQualifierFk > 101"); |
|
175 |
boolean result = equals("Synonym count ", countSrc, countDest, String.valueOf(-1)); |
|
176 |
// update Match_RelStat set RelTaxon = 102 where tu_unacceptreason like 'currently placed%' |
|
177 |
// update Match_RelStat set RelTaxon = 102 where tu_unacceptreason like 'currently held%' |
|
178 |
// update Match_RelStat set RelTaxon = 102 where tu_unacceptreason like 'sy%' or tu_unacceptreason like '%jun%syn%' |
|
179 |
// update Match_RelStat set RelTaxon = 102 where tu_unacceptreason = '(synonym)' |
|
180 |
// update Match_RelStat set RelTaxon = 102 where tu_unacceptreason = 'reverted genus transfer' |
|
181 |
// update Match_RelStat set RelTaxon = 103 where tu_unacceptreason like 'misapplied%' |
|
182 |
// update Match_RelStat set RelTaxon = 104 where tu_unacceptreason like 'part% synonym%' |
|
183 |
// update Match_RelStat set RelTaxon = 106 where tu_unacceptreason = 'heterotypic synonym' or tu_unacceptreason = 'subjective synonym' |
|
184 |
// update Match_RelStat set RelTaxon = 107 where tu_unacceptreason like '%homot%syn%' or tu_unacceptreason = 'objective synonym' synyonym |
|
185 |
// update Match_RelStat set RelTaxon = 107 where tu_unacceptreason like '%bas[iy][no]%ny%' |
|
186 |
|
|
187 |
//Name relations |
|
188 |
countSrc = source.getUniqueInteger("SELECT count(*) FROM tu WHERE id " + moneraFilter + " AND (" |
|
189 |
+ " tu_unacceptreason like '%bas[iy][no]%ny%' OR tu_unacceptreason = 'original combination' " |
|
190 |
+ " OR tu_unacceptreason = 'Subsequent combination' OR tu_unacceptreason like '%genus transfer%' " |
|
191 |
+ " OR tu_unacceptreason = 'genus change' " //1 |
|
192 |
+ " OR tu_unacceptreason like '%homon%' " // 2 |
|
193 |
+ " OR tu_unacceptreason like '%spell%' OR tu_unacceptreason like 'lapsus %' " //16 |
|
194 |
|
|
195 |
+ ")"); |
|
196 |
countDest = destination.getUniqueInteger("SELECT count(*) FROM RelTaxon WHERE RelTaxonQualifierFk <100 "); |
|
197 |
result = equals("Taxon name relation count ", countSrc, countDest, String.valueOf(-1)); |
|
198 |
|
|
199 |
//included in |
|
200 |
countSrc = source.getUniqueInteger(countParentRelation); |
|
201 |
//TODO |
|
202 |
countDest = destination.getUniqueInteger("SELECT count(*) FROM RelTaxon WHERE RelTaxonQualifierFk = 101 "); |
|
203 |
result &= equals("Tax included in count ", countSrc, countDest, String.valueOf(-1)); |
|
204 |
return result; |
|
173 | 205 |
} |
174 | 206 |
|
175 | 207 |
|
... | ... | |
177 | 209 |
private boolean testTaxaCount() { |
178 | 210 |
int countSrc = source.getUniqueInteger(countTaxon); |
179 | 211 |
int countDest = destination.getUniqueInteger("SELECT count(*) FROM Taxon "); |
180 |
return equals("Taxon count ", countSrc, countDest, String.valueOf(-1)); |
|
212 |
boolean result = equals("Taxon count ", countSrc, countDest, String.valueOf(-1)); |
|
213 |
|
|
214 |
//NomStatus |
|
215 |
countSrc = source.getUniqueInteger("SELECT count(*) FROM tu WHERE id " + moneraFilter + " AND (" |
|
216 |
+ " tu_unacceptreason like '%inval%' OR tu_unacceptreason like '%not val%' " |
|
217 |
+ " OR tu_unacceptreason like '%illeg%' OR tu_unacceptreason like '%nud%' " |
|
218 |
+ " OR tu_unacceptreason like '%rej.%' OR tu_unacceptreason like '%superfl%' " |
|
219 |
+ " OR tu_unacceptreason like '%Comb. nov%' OR tu_unacceptreason like '%New name%' " |
|
220 |
+ " OR tu_unacceptreason = 'new combination' " |
|
221 |
+ " OR tu_status IN (3,5,6,7,8) )"); |
|
222 |
countDest = destination.getUniqueInteger("SELECT count(*) FROM Taxon WHERE NameStatusFk IS NOT NULL "); |
|
223 |
result = equals("Taxon name status count ", countSrc, countDest, String.valueOf(-1)); |
|
224 |
|
|
225 |
return result; |
|
181 | 226 |
} |
182 | 227 |
|
183 | 228 |
private boolean testSingleTaxa(int n) throws SQLException { |
Also available in: Unified diff
ref #8508 add nomstatus, name rel and taxon rel validation