Revision 0ccecb37
Added by Andreas Müller over 3 years ago
cdm-pesi/src/main/java/eu/etaxonomy/cdm/app/pesi/validate/PesiEuroMedValidator.java | ||
---|---|---|
41 | 41 |
|
42 | 42 |
private static final ICdmDataSource defaultSource = CdmDestinations.cdm_test_local_mysql_euromed(); |
43 | 43 |
// private static final ICdmDataSource defaultSource = CdmDestinations.cdm_pesi2019_final(); |
44 |
// private static final Source defaultDestination = PesiDestinations.pesi_test_local_CDM_EM2PESI();
|
|
45 |
private static final Source defaultDestination = PesiDestinations.pesi_test_local_CDM_EM2PESI_2(); |
|
44 |
private static final Source defaultDestination = PesiDestinations.pesi_test_local_CDM_EM2PESI(); |
|
45 |
// private static final Source defaultDestination = PesiDestinations.pesi_test_local_CDM_EM2PESI_2();
|
|
46 | 46 |
|
47 | 47 |
boolean doReferences = false; |
48 | 48 |
boolean doTaxa = true; |
... | ... | |
321 | 321 |
boolean success = true; |
322 | 322 |
ResultSet srcRS = source.getResultSet("SELECT CAST(tn.id as char(20)) tid, tb.uuid as GUID, pt.id parentId, " |
323 | 323 |
+ " tn.rank_id, rank.titleCache rank_name, " |
324 |
+ " sec.titleCache secTitle, " |
|
324 |
+ " sec.titleCache secTitle, secAut.titleCache secAutTitle, "
|
|
325 | 325 |
+ " tn.genusOrUninomial, tn.infraGenericEpithet, tn.specificEpithet, tn.infraSpecificEpithet, " |
326 | 326 |
+ " tn.nameCache, tn.authorshipCache, tn.titleCache nameTitleCache, tn.fullTitleCache nameFullTitleCache, " |
327 | 327 |
+ " tb.DTYPE taxStatus, tb.titleCache, tb.appendedPhrase tbAppendedPhrase, tb.sec_id secId, " |
... | ... | |
334 | 334 |
+ " LEFT JOIN TaxonName tn on tb.name_id = tn.id " |
335 | 335 |
+ " LEFT JOIN DefinedTermBase rank ON rank.id = tn.rank_id " |
336 | 336 |
+ " LEFT JOIN Reference sec ON sec.id = tb.sec_id " |
337 |
+ " LEFT JOIN AgentBase secAut ON secAut.id = sec.authorship_id " |
|
337 | 338 |
+ " LEFT JOIN TaxonName_NomenclaturalStatus nsMN ON tn.id = nsMN.TaxonName_id " |
338 | 339 |
+ " LEFT JOIN NomenclaturalStatus ns ON ns.id = nsMN.status_id " |
339 | 340 |
+ " LEFT JOIN DefinedTermBase nsType ON nsType.id = ns.type_id " |
... | ... | |
413 | 414 |
success &= equals("Taxon GUID", srcRS.getString("GUID"), destRS.getString("GUID"), id); |
414 | 415 |
success &= equals("Taxon DerivedFromGuid", srcRS.getString("GUID"), destRS.getString("DerivedFromGuid"), id); //according to SQL script GUID and DerivedFromGuid are always the same, according to 2014DB this is even true for all databases |
415 | 416 |
success &= isNull("ExpertGUID", destRS, id); //according to SQL + PESI2014 |
416 |
//FIXME success &= equals("Taxon ExpertName", srcRS.getString("secTitle"), destRS.getString("ExpertName"), id); |
|
417 |
//FIXME success &= isNull("SpeciesExpertGUID", destRS); |
|
418 |
//FIXME success &= equals("Taxon SpeciesExpertName", srcRS.getString("secTitle"), destRS.getString("SpeciesExpertName"), id); |
|
417 |
success &= isNull("SpeciesExpertGUID", destRS, id); |
|
418 |
//ExpertName = SpeciesExpertName in E+M according to SQL script, 4689x NULL |
|
419 |
success &= equals("Taxon ExpertName", makeExpertName(srcRS), destRS.getString("ExpertName"), id); |
|
420 |
success &= equals("Taxon SpeciesExpertName", makeExpertName(srcRS), destRS.getString("SpeciesExpertName"), id); |
|
419 | 421 |
//FIXME !! success &= equals("Taxon cache citation", srcRS.getString("secTitle"), destRS.getString("CacheCitation"), id); |
420 | 422 |
success &= equals("Taxon Last Action", srcRS.getString("lastAction"), destRS.getString("LastAction"), id); |
421 | 423 |
success &= equals("Taxon Last Action Date", srcRS.getTimestamp("lastActionDate"), destRS.getTimestamp("LastActionDate"), id); |
... | ... | |
425 | 427 |
return success; |
426 | 428 |
} |
427 | 429 |
|
430 |
private String makeExpertName(ResultSet srcRs) throws SQLException { |
|
431 |
String autStr = srcRs.getString("secAutTitle"); |
|
432 |
if (autStr != null){ |
|
433 |
return autStr; |
|
434 |
}else{ |
|
435 |
return srcRs.getString("secTitle"); |
|
436 |
} |
|
437 |
} |
|
438 |
|
|
428 | 439 |
private String makeSource(ResultSet srcRs) throws SQLException { |
429 | 440 |
String secStr = srcRs.getString("secTitle"); |
430 | 441 |
if (secStr == null){ |
... | ... | |
867 | 878 |
success &= equals("CommonName name ", srcRs.getString("vername"), destRs.getString("CommonName"), id); |
868 | 879 |
success &= equals("Common name languageFk ", srcRs.getString("iso"), getLanguageIso(destRs), id); |
869 | 880 |
success = equals("CommonName LanguageCache ", normalizeLang(srcRs.getString("LanName")), destRs.getString("LanguageCache"), id); |
870 |
//TODO needed? success = equals("CommonName language code ", srcRs.getString("lan_id"), destRs.getString("LanguageFk"), id); |
|
881 |
//TODO cn lan_id needed? success = equals("CommonName language code ", srcRs.getString("lan_id"), destRs.getString("LanguageFk"), id);
|
|
871 | 882 |
success &= isNull("Region", destRs, id); //region does not seem to exist in ERMS |
872 |
//TODO see comments |
|
883 |
//TODO cn sources, see comments
|
|
873 | 884 |
// success &= isNull("SourceFk", destRs); //sources should be moved to extra table, check with PESI 2014 |
874 | 885 |
// success &= isNull("SourceNameCache", destRs); //sources should be moved to extra table, check with PESI 2014 |
875 | 886 |
success &= isNull("SpeciesExpertGUID", destRs, id); //SpeciesExpertGUID does not exist in ERMS |
... | ... | |
927 | 938 |
success &= equals("Reference abstract ", srcRS.getString("referenceAbstract"), destRS.getString("Abstract"), id); |
928 | 939 |
success &= equals("Reference title ", srcRS.getString("title"), destRS.getString("Title"), id); |
929 | 940 |
success &= equals("Reference author string ", srcRS.getString("author"), destRS.getString("AuthorString"), id); |
930 |
//TODO |
|
941 |
//TODO reference year
|
|
931 | 942 |
success &= equals("Reference year ", normalizeYear(srcRS), destRS.getString("RefYear"), id); |
932 |
//FIXME |
|
943 |
//FIXME reference nomrefcache
|
|
933 | 944 |
// success &= equals("Reference NomRefCache ", srcRS.getString("abbrevTitleCache"), destRS.getString("NomRefCache"), id); |
934 | 945 |
success &= equals("Reference DOI ", srcRS.getString("doi"), destRS.getString("Doi"), id); |
935 | 946 |
success &= equals("Reference link ", srcRS.getString("uri"), destRS.getString("Link"), id); |
936 |
//TODO Notes |
|
947 |
//TODO reference Notes
|
|
937 | 948 |
// success &= equals("Reference note ", srcRS.getString("source_note"), destRS.getString("Notes"), id); |
938 | 949 |
//complete |
939 | 950 |
return success; |
Also available in: Unified diff
ref #1447 latest changes to PesiFindIdenticalNamesActivator and PesiEuroMedValidator