Project

General

Profile

« Previous | Next » 

Revision 58968197

Added by Andreas Müller over 4 years ago

ref #1444, ref #7976 improve misapplication handling in ERMS import

View differences:

cdm-pesi/src/main/java/eu/etaxonomy/cdm/io/pesi/erms/ErmsTaxonImport.java
194 194
		String sql =
195 195
                "          SELECT id FROM tu WHERE tu_accfinal is NULL" //id of taxa not having accepted taxon
196 196
                + " UNION  SELECT DISTINCT tu_accfinal FROM tu "  //fk to accepted taxon (either the accepted taxon or the taxon itself, if accepted)
197
                + " UNION  SELECT id FROM tu WHERE trim(tu.tu_unacceptreason) like 'misidentification' OR trim(tu.tu_unacceptreason) like 'misidentifications' OR "
198
                            + " tu.tu_unacceptreason like 'misapplied %%name' OR "
199
                            + " tu.tu_unacceptreason like '%%misapplication%%' OR "
200
                            + " tu.tu_unacceptreason like 'incorrect identification%%'" //Misapplications, see ErmsTransformer.getSynonymRelationTypesByKey
197 201
                + " UNION  SELECT syn.id FROM tu syn INNER JOIN tu acc ON syn.tu_accfinal = acc.id WHERE syn.id = acc.tu_parent AND acc.id <> syn.id "  //see also ErmsTaxonRelationImport.isAccepted, there are some autonyms being the accepted taxon of there own parents
198 202
                + " UNION  SELECT DISTINCT %s FROM %s " //vernaculars
199 203
                + " UNION  SELECT DISTINCT %s FROM %s "  //distributions
cdm-pesi/src/main/java/eu/etaxonomy/cdm/io/pesi/erms/ErmsTransformer.java
698 698

  
699 699
        //according to SQL script erms300_Match_Relation&Status.sql
700 700

  
701
        unacceptreason = unacceptreason == null? null: unacceptreason.trim();
701 702
        boolean handled = false;
702
        if (isBlank(unacceptreason)){
703
        if (unacceptreason == null || isBlank(unacceptreason)){
703 704
            handled = true;  //no change
704 705
        }else if (unacceptreason.matches("(?i)(synonym|superseded recombination|transferred to .*)")){
705 706
            handled = true;  //no change
......
713 714
            }else if (unacceptreason.matches("(?i)part.*\\s+synonym.*")){
714 715
                synType = null;
715 716
                taxonRelType = TaxonRelationshipType.PRO_PARTE_SYNONYM_FOR();
716
            }else if (unacceptreason.matches("(?i)misapplied.*")){
717
            }else if (unacceptreason.matches("(?i)(misidentifications?|misapplied .*name|.*misapplication.*|incorrect identification)")){
718
                //see ErmsTaxonImport.getAcceptedTaxaKeys()
717 719
                synType = null;
718 720
                taxonRelType = TaxonRelationshipType.MISAPPLIED_NAME_FOR();
719 721
            }else if (unacceptreason.matches("(?i)(.*jun.*syn.*|\\(synonym\\)|reverted genus transfer)")){

Also available in: Unified diff