Project

General

Profile

« Previous | Next » 

Revision c32dfb15

Added by Andreas Müller over 4 years ago

ref #1444, ref #8508, ref #8509 improve ERMS notes pipeline

View differences:

cdm-pesi/src/main/java/eu/etaxonomy/cdm/io/pesi/erms/ErmsNotesImport.java
20 20
import org.springframework.stereotype.Component;
21 21

  
22 22
import eu.etaxonomy.cdm.io.common.IOValidator;
23
import eu.etaxonomy.cdm.io.common.mapping.DbImportAnnotationMapper;
24 23
import eu.etaxonomy.cdm.io.common.mapping.DbImportFeatureCreationMapper;
25 24
import eu.etaxonomy.cdm.io.common.mapping.DbImportMapping;
26 25
import eu.etaxonomy.cdm.io.common.mapping.DbImportMultiLanguageTextMapper;
27 26
import eu.etaxonomy.cdm.io.common.mapping.DbImportTextDataCreationMapper;
28 27
import eu.etaxonomy.cdm.io.pesi.erms.validation.ErmsNoteImportValidator;
29 28
import eu.etaxonomy.cdm.model.common.Annotation;
30
import eu.etaxonomy.cdm.model.common.AnnotationType;
31 29
import eu.etaxonomy.cdm.model.common.CdmBase;
32 30
import eu.etaxonomy.cdm.model.common.Language;
33 31
import eu.etaxonomy.cdm.model.description.TextData;
......
69 67
		if (mapping == null){
70 68
			mapping = new DbImportMapping<>();
71 69
			mapping.addMapper(DbImportTextDataCreationMapper.NewInstance("id", NOTES_NAMESPACE, "tu_id", TAXON_NAMESPACE));
72
			mapping.addMapper(DbImportMultiLanguageTextMapper.NewInstance("note", "lan_id", LANGUAGE_NAMESPACE, "Text"));
73
			Language notesNoteLanguage = null;
74
			mapping.addMapper(DbImportAnnotationMapper.NewInstance("note", AnnotationType.EDITORIAL(), notesNoteLanguage));
75 70
			mapping.addMapper(DbImportFeatureCreationMapper.NewInstance("type", FEATURE_NAMESPACE, "type", "type", "type"));
71
			mapping.addMapper(DbImportMultiLanguageTextMapper.NewInstance("note", "lan_id", LANGUAGE_NAMESPACE, "Text"));
72
//			Language notesNoteLanguage = null;
73
//			mapping.addMapper(DbImportAnnotationMapper.NewInstance("note", AnnotationType.EDITORIAL(), notesNoteLanguage));
76 74
		}
77 75
		return mapping;
78 76
	}
cdm-pesi/src/main/java/eu/etaxonomy/cdm/io/pesi/erms/ErmsTransformer.java
207 207
	public static final UUID uuidNomenclature = UUID.fromString("15fe184f-4aab-4076-8bbb-3415d6f1f27f");
208 208
	public static final UUID uuidTypespecies = UUID.fromString("cf674b0d-76e2-4628-952c-2cd06e209c6e");
209 209
	public static final UUID uuidTaxonomicRemark = UUID.fromString("044e7c4e-aab8-4f44-bfa5-0339e7576c74");
210
	public static final UUID uuidDateofPublication = UUID.fromString("2a416574-69db-4f80-b9a7-b912d5ed1816");
211 210
	public static final UUID uuidAcknowledgments = UUID.fromString("3b2fd495-3f9a-480e-986a-7643741177da");
212 211
	public static final UUID uuidOriginalpublication = UUID.fromString("ea9b7e53-0487-499f-a281-3d82d10e76dd");
213 212
	public static final UUID uuidTypelocality = UUID.fromString("7c1c5779-2b4b-467b-b2ca-5ca2e029e116");
......
224 223
    public static final UUID uuidDiet = UUID.fromString("17e22a59-6fea-4eb2-8e0c-4578f633cd0a");
225 224
    public static final UUID uuidReproduction = UUID.fromString("fffdc170-db89-4ef6-9d21-f9dff19b4fb4");
226 225

  
226
    public static final UUID uuidNewCombination = UUID.fromString("f51f71c7-4a07-491d-b04a-ac5360173ab9");
227
    public static final UUID uuidTypeMaterial = UUID.fromString("5df1ad63-5f8c-43f9-812d-4448f30ddd0a");
228
    public static final UUID uuidOriginalCombination = UUID.fromString("1c8e5637-1024-452f-9ebe-28058a5c6473");
229
    public static final UUID uuidTypeSpecimen = UUID.fromString("0e74bee7-8a83-4f07-a6e9-05e5b1358411");
230
    public static final UUID uuidOriginalDescription = UUID.fromString("bf7b3d4b-90e1-4eb2-b3ae-4f89e27b126f");
231
    public static final UUID uuidSpecimen = UUID.fromString("a08e8158-d39d-4897-a6a0-ded4186d4ed0");
232
    public static final UUID uuidEditorsComment = UUID.fromString("b46ad912-8c61-4c76-ad89-d38451d650e9");
233
    public static final UUID uuidSyntype = UUID.fromString("6d0989a1-7467-43ec-a087-4838fa8246de");
234
    public static final UUID uuidBiology = UUID.fromString("af5c6832-74f3-4b87-bac9-6fdfc68ffada");
235

  
227 236
	//extension type uuids
228 237
	public static final UUID uuidErmsTaxonStatus = UUID.fromString("859eee7f-5240-48a0-8edc-7af63557fa6e");
229 238

  
......
557 566
		}else if (key.equalsIgnoreCase("Distribution")){return Feature.DISTRIBUTION();
558 567
		}else if (key.equalsIgnoreCase("Ecology")){return Feature.ECOLOGY();
559 568
		}else if (key.equalsIgnoreCase("Diagnosis")){return Feature.DIAGNOSIS();
560
		}else if (key.equalsIgnoreCase("Biology")){return Feature.BIOLOGY_ECOLOGY();
561 569
		}else if (key.equalsIgnoreCase("Host")){return Feature.HOSTPLANT();
562
		}else{
570
		}else if (key.equalsIgnoreCase("Etymology")){return Feature.ETYMOLOGY();
571
        }else{
563 572
			return null;
564 573
		}
565 574
	}
......
588 597
		}else if (key.equalsIgnoreCase("Nomenclature")){return uuidNomenclature;
589 598
		}else if (key.equalsIgnoreCase("Type species")){return uuidTypespecies;
590 599
		}else if (key.equalsIgnoreCase("Taxonomic Remark")){return uuidTaxonomicRemark;
591
		}else if (key.equalsIgnoreCase("Date of Publication")){return uuidDateofPublication;
600
		}else if (key.equalsIgnoreCase("Date of Publication")){return uuidPublicationdate;
592 601
		}else if (key.equalsIgnoreCase("Acknowledgments")){return uuidAcknowledgments;
593 602
		}else if (key.equalsIgnoreCase("Original publication")){return uuidOriginalpublication;
594 603
		}else if (key.equalsIgnoreCase("Type locality")){return uuidTypelocality;
......
603 612
	    }else if (key.equalsIgnoreCase("Dimensions")){return uuidDimensions;
604 613
	    }else if (key.equalsIgnoreCase("Diet")){return uuidDiet;
605 614
	    }else if (key.equalsIgnoreCase("Reproduction")){return uuidReproduction;
615
	    }else if (key.equalsIgnoreCase("New combination")){return uuidNewCombination;
616
	    }else if (key.equalsIgnoreCase("Type material")){return uuidTypeMaterial;
617
	    }else if (key.equalsIgnoreCase("Original Combination")){return uuidOriginalCombination;
618
	    }else if (key.equalsIgnoreCase("Type specimen")){return uuidTypeSpecimen;
619
	    }else if (key.equalsIgnoreCase("Original description")){return uuidOriginalDescription;
620
	    }else if (key.equalsIgnoreCase("Specimen")){return uuidSpecimen;
621
	    }else if (key.equalsIgnoreCase("Original description")){return uuidOriginalDescription;
622
	    }else if (key.equalsIgnoreCase("Editor's comment")){return uuidEditorsComment;
623
	    }else if (key.equalsIgnoreCase("Original description")){return uuidOriginalDescription;
624
	    }else if (key.equalsIgnoreCase("Syntype")){return uuidSyntype;
625
	    }else if (key.equalsIgnoreCase("Biology")){return uuidBiology;
606 626

  
607 627
		}else{
608 628
			logger.warn("Feature key " + key + " not yet supported by ERMS transformer");
cdm-pesi/src/main/java/eu/etaxonomy/cdm/io/pesi/erms/validation/PesiErmsValidator.java
31 31
    private static final Logger logger = Logger.getLogger(PesiErmsValidator.class);
32 32

  
33 33
    private static final Source defaultSource = PesiSources.PESI2019_ERMS();
34
    private static final Source defaultDestination = PesiDestinations.pesi_test_local_CDM_ERMS2PESI();
34
    private static final Source defaultDestination = PesiDestinations.pesi_test_local_CDM_ERMS2PESI_2();
35 35

  
36 36
    private Source source = defaultSource;
37 37
    private Source destination = defaultDestination;
......
46 46
//            success &= testTaxa();
47 47
//            success &= testTaxonRelations();
48 48
//            success &= testCommonNames();
49
            success &= testDistributions();
49
//            success &= testDistributions();
50
            success &= testNotes();
50 51
        } catch (Exception e) {
51 52
            e.printStackTrace();
52 53
            success = false;
......
55 56
        System.out.println("end validation " + (success? "":"NOT ") + "successful.");
56 57
    }
57 58

  
59
    private boolean testNotes() throws SQLException {
60
        boolean success = testNotesCount();
61
        if (!success){
62
              success &= testSingleNotes(source.getUniqueInteger("SELECT count(*) FROM notes "));
63
        }
64
        return success;
65
    }
66

  
58 67
    private boolean testDistributions() throws SQLException {
59 68
        boolean success = testDistributionCount();
60 69
        if (success){
......
92 101
        return success;
93 102
    }
94 103

  
104
    private boolean testNotesCount() {
105
        int countSrc = source.getUniqueInteger("SELECT count(*) FROM notes ");
106
        int countDest = destination.getUniqueInteger("SELECT count(*) FROM Note ");
107
        return equals("Notes count ", countSrc, countDest, String.valueOf(-1));
108
    }
109

  
95 110
    private boolean testDistributionCount() {
96 111
        int countSrc = source.getUniqueInteger("SELECT count(*) FROM dr ");
97 112
        int countDest = destination.getUniqueInteger("SELECT count(*) FROM Occurrence ");
......
238 253
        }
239 254
    }
240 255

  
256

  
257
    private boolean testSingleNotes(int n) throws SQLException {
258
        boolean success = true;
259
        ResultSet srcRs = source.getResultSet("SELECT CAST(ISNULL(tu.tu_accfinal, tu.id) as nvarchar(20)) tuId, no.*, l.LanName "
260
                + " FROM notes no INNER JOIN tu ON no.tu_id = tu.id "
261
                + "    LEFT JOIN languages l ON l.LanID = no.lan_id "
262
                + " ORDER BY CAST(tu.id as nvarchar(20)), no.type ");  //, no.note (not possible because ntext
263
        ResultSet destRs = destination.getResultSet("SELECT t.IdInSource, no.*, cat.NoteCategory, l.Language "
264
                + " FROM Note no INNER JOIN Taxon t ON t.TaxonId = no.TaxonFk "
265
                + "    LEFT JOIN NoteCategory cat ON cat.NoteCategoryId = no.NoteCategoryFk "
266
                + "    LEFT JOIN Language l ON l.LanguageId = no.LanguageFk "
267
                + " WHERE t.OriginalDB = 'erms' "
268
                + " ORDER BY t.IdInSource, no.NoteCategoryCache ");
269
        int count = 0;
270
        while (srcRs.next() && destRs.next()){
271
            success &= testSingleNote(srcRs, destRs);
272
            count++;
273
        }
274
        success &= equals("Notes count differs", n, count, "-1");
275
        return success;
276
    }
277

  
278
    private boolean testSingleNote(ResultSet srcRs, ResultSet destRs) throws SQLException {
279
        String id = String.valueOf(srcRs.getInt("tuId") + "-" + srcRs.getString("type"));
280
        boolean success = equals("Note taxonID ", "tu_id: " + String.valueOf(srcRs.getInt("tuId")), destRs.getString("IdInSource"), id);
281
        success &= equals("Note Note_1 ", srcRs.getString("note"), destRs.getString("Note_1"), id);
282
        success &= isNull("Note_2", destRs);
283
        success &= equals("Note category ", srcRs.getString("type"), destRs.getString("NoteCategoryCache"), id);
284
        success &= equals("Note language ", srcRs.getString("LanName"), destRs.getString("Language"), id);
285

  
286
        //TODO
287
        //SpeciesExpertGUID, SpeciesExpertName, LastAction, LastActionDate
288
        return success;
289
    }
290

  
241 291
    private boolean testSingleDistributions(int n) throws SQLException {
242 292
        boolean success = true;
243 293
        ResultSet srcRs = source.getResultSet("SELECT CAST(ISNULL(tu.tu_accfinal, tu.id) as nvarchar(20)) tuId, gu.gazetteer_id, dr.*, gu.id guId, gu.gu_name "
cdm-pesi/src/main/java/eu/etaxonomy/cdm/io/pesi/out/PesiDescriptionExport.java
46 46
import eu.etaxonomy.cdm.io.common.mapping.out.DbTextDataMapper;
47 47
import eu.etaxonomy.cdm.io.common.mapping.out.IdMapper;
48 48
import eu.etaxonomy.cdm.io.common.mapping.out.MethodMapper;
49
import eu.etaxonomy.cdm.io.pesi.erms.ErmsTransformer;
49 50
import eu.etaxonomy.cdm.model.common.CdmBase;
50 51
import eu.etaxonomy.cdm.model.common.Extension;
51 52
import eu.etaxonomy.cdm.model.common.ExtensionType;
......
106 107
	private static int countAdditionalSources;
107 108
	private static int countImages;
108 109
	private static int countNotes;
110
	private static int countSourceOfSynonymy;
109 111

  
110 112
	private static int countCommonName;
111 113
	private static int countOccurrence;
......
239 241
		logger.info("AddSrc: " + countAdditionalSources);
240 242
		logger.info("Images: " + countImages);
241 243
		logger.info("Notes: " + countNotes);
244
	    logger.info("Source of Synonymy: " + countSourceOfSynonymy);
242 245
		logger.info("Others: " + countOthers);
243 246

  
244 247
		// Commit transaction
......
315 318
		logger.info("AddSrc: " + countAdditionalSources);
316 319
		logger.info("Images: " + countImages);
317 320
		logger.info("Notes: " + countNotes);
318
		logger.info("Others: " + countOthers);
321
		logger.info("Source of Synonymy: " + countSourceOfSynonymy);
322
        logger.info("Others: " + countOthers);
319 323

  
320 324
		// Commit transaction
321 325
		commitTransaction(txStatus);
......
393 397
				countNotes++;
394 398
				success &= notesMapping.invoke(element);
395 399

  
396
			}else{
400
			}else if (isSourceOfSynonymy(element)){
401
                countSourceOfSynonymy++;
402
                if(countSourceOfSynonymy < 2){
403
                    logger.warn("Source of synonymy not yet implemented!");
404
                }
405
            }else{
397 406
				countOthers++;
398 407
				String featureTitle = element.getFeature() == null ? "no feature" :element.getFeature().getTitleCache();
399 408
				logger.warn("Description element type not yet handled by PESI export: " + element.getUuid() + ", " +  element.getClass() + ", " +  featureTitle);
......
406 415
		}
407 416
	}
408 417

  
409
	private boolean isExcludedNote(DescriptionElementBase element) {
418
    private boolean isSourceOfSynonymy(DescriptionElementBase element) {
419
        if (element.getFeature() == null){
420
            return false;
421
        }else {
422
            return element.getFeature().getUuid().equals(ErmsTransformer.uuidSourceOfSynonymy);
423
        }
424
    }
425

  
426
    private boolean isExcludedNote(DescriptionElementBase element) {
410 427
		Integer categoryFk = PesiTransformer.feature2NoteCategoryFk(element.getFeature());
411 428
		//TODO decide where to handle them best (configurator, transformer, single method, ...)
412 429
		return (excludedNoteCategories.contains(categoryFk));
......
467 484

  
468 485
	private boolean isOccurrence(DescriptionElementBase element) {
469 486
		Feature feature = element.getFeature();
470
		if (feature != null && feature.equals(Feature.DISTRIBUTION())){
471
			return true;
472
		}else if (element.isInstanceOf(Distribution.class)){
473
			logger.warn("Description element has class 'Distribution' but has no feature 'Distribution'");
474
			return true;
487
		if (element.isInstanceOf(Distribution.class)){
488
		    if (!Feature.DISTRIBUTION().equals(feature)){
489
		        logger.warn("Description element has class 'Distribution' but has no feature 'Distribution'");
490
		    }
491
		    return true;
492
		}else if (Feature.DISTRIBUTION().equals(feature)){
493
		    logger.debug("Description element has feature Distribtuion but is not of class 'Distribution'");
494
            return false;
475 495
		}else{
476 496
			return false;
477 497
		}
cdm-pesi/src/main/java/eu/etaxonomy/cdm/io/pesi/out/PesiTransformer.java
435 435
	public static int NoteCategory_Spelling = 261;
436 436
	public static int NoteCategory_Systematics = 262;
437 437
	public static int NoteCategory_Remark = 263;
438
	public static int NoteCategory_Date_of_publication = 264;
439 438
	public static int NoteCategory_Additional_information = 266;
440 439
	public static int NoteCategory_Status = 267;
441 440
	public static int NoteCategory_Nomenclature = 268;
......
456 455
	public static int NoteCategory_Rank = 285;
457 456
	public static int NoteCategory_Taxonomic_Remark = 286;
458 457
	public static int NoteCategory_Taxonomic_Remarks = 287;
459
	public static int NoteCategory_Fossil_Range = 305;
458
	public static int NoteCategory_Etymology = 288;
459
    public static int NoteCategory_Type_species = 289;
460 460
	public static int NoteCategory_Depth_Range = 290;
461 461
	public static int NoteCategory_Grammatical_Gender = 291;
462 462
	public static int NoteCategory_Introduced_Species_Remark = 292;
463 463
	public static int NoteCategory_Alien_Species = 293;
464 464
	public static int NoteCategory_Dimensions = 294;
465
	public static int NoteCategory_Diet = 295;
466
	public static int NoteCategory_Reproduction = 296;
465
    public static int NoteCategory_New_Combination = 295;
466
    public static int NoteCategory_Original_Combination = 296;
467 467

  
468 468
	public static int NoteCategory_Conservation_Status= 301;
469 469
	public static int NoteCategory_Use = 302;
470 470
	public static int NoteCategory_Comments = 303;
471
    public static int NoteCategory_Diet = 304;
472
    public static int NoteCategory_Fossil_Range = 305;
473
    public static int NoteCategory_Original_Description = 306;
474
    public static int NoteCategory_Reproduction = 307;
475
    public static int NoteCategory_Specimen = 308;
476
    public static int NoteCategory_Type_Specimen = 309;
477
    public static int NoteCategory_Type_Material = 310;
478
    public static int NoteCategory_Editors_Comment = 311;
479
    public static int NoteCategory_Syntype = 312;
471 480

  
472 481
	// FossilStatus
473 482
	public static int FOSSILSTATUS_RECENT_ONLY = 1;
......
1450 1459
			return NoteCategory_ecology;
1451 1460
		} else if (feature.equals(Feature.PHENOLOGY())) {
1452 1461
			return NoteCategory_phenology;
1453
		} else if (feature.equals(Feature.COMMON_NAME())) {
1462
		} else if (feature.equals(Feature.DIAGNOSIS())) {
1463
            return NoteCategory_Diagnosis;
1464
        } else if (feature.equals(Feature.COMMON_NAME())) {
1454 1465
			return NoteCategory_Common_names;
1455 1466
		} else if (feature.equals(Feature.OCCURRENCE())) {
1456 1467
			return NoteCategory_Occurrence;
1457 1468
		} else if (feature.equals(Feature.DISTRIBUTION())) {
1458 1469
			return NoteCategory_Distribution;
1459
		} else if (feature.getUuid().equals(ErmsTransformer.uuidRemark)) {
1460
			return NoteCategory_Remark;
1470
		} else if (feature.equals(Feature.ETYMOLOGY())) {
1471
            return NoteCategory_Etymology;
1472
        } else if (feature.getUuid().equals(ErmsTransformer.uuidAcknowledgments)){
1473
		    return NoteCategory_Acknowledgments;
1461 1474
		} else if (feature.getUuid().equals(ErmsTransformer.uuidAdditionalinformation)) {
1462
			return NoteCategory_Additional_information;
1463
		} else if (feature.getUuid().equals(ErmsTransformer.uuidSpelling)) {
1464
			return NoteCategory_Spelling;
1465
		} else if (feature.getUuid().equals(ErmsTransformer.uuidDateofPublication)) {
1466
			return NoteCategory_Date_of_publication;
1467
		} else if (feature.getUuid().equals(ErmsTransformer.uuidSystematics)) {
1468
			return NoteCategory_Systematics;
1475
		    return NoteCategory_Additional_information;
1476
		} else if (feature.getUuid().equals(ErmsTransformer.uuidAlienSpecies)) {
1477
		    return NoteCategory_Alien_Species;
1478
		} else if (feature.getUuid().equals(ErmsTransformer.uuidAuthority)) {
1479
		    return NoteCategory_Authority;
1480
		} else if (feature.getUuid().equals(ErmsTransformer.uuidDepthRange)) {
1481
		    return NoteCategory_Depth_Range;
1482
		} else if (feature.getUuid().equals(ErmsTransformer.uuidBiology)) {
1483
		    return NoteCategory_Biology;
1469 1484
		} else if (feature.getUuid().equals(ErmsTransformer.uuidClassification)) {
1470
			return NoteCategory_Classification;
1485
		    return NoteCategory_Classification;
1486
		} else if (feature.getUuid().equals(ErmsTransformer.uuidDiet)) {
1487
		    return NoteCategory_Diet;
1488
		} else if (feature.getUuid().equals(ErmsTransformer.uuidDimensions)) {
1489
		    return NoteCategory_Dimensions;
1490
		} else if (feature.getUuid().equals(ErmsTransformer.uuidEditorsComment)) {
1491
		    return NoteCategory_Editors_Comment;
1471 1492
		} else if (feature.getUuid().equals(ErmsTransformer.uuidEnvironment)) {
1472
			return NoteCategory_Environment;
1493
		    return NoteCategory_Environment;
1494
		} else if (feature.getUuid().equals(ErmsTransformer.uuidFossilRange)) {
1495
		    return NoteCategory_Fossil_Range;
1496
		} else if (feature.getUuid().equals(ErmsTransformer.uuidGrammaticalGender)) {
1497
		    return NoteCategory_Grammatical_Gender;
1473 1498
		} else if (feature.getUuid().equals(ErmsTransformer.uuidHabitat)) {
1474
			return NoteCategory_Habitat;
1475
		} else if (feature.getUuid().equals(ErmsTransformer.uuidAuthority)) {
1476
			return NoteCategory_Authority;
1499
		    return NoteCategory_Habitat;
1500
		} else if (feature.getUuid().equals(ErmsTransformer.uuidHomonymy)) {
1501
		    return NoteCategory_Homonymy;
1502
		} else if (feature.getUuid().equals(ErmsTransformer.uuidIdentification)) {
1503
		    return NoteCategory_Identification;
1504
		} else if (feature.getUuid().equals(ErmsTransformer.uuidIntroducedSpeciesRemark)) {
1505
		    return NoteCategory_Introduced_Species_Remark;
1477 1506
		} else if (feature.getUuid().equals(ErmsTransformer.uuidMorphology)) {
1478
			return NoteCategory_Morphology;
1507
		    return NoteCategory_Morphology;
1508
		} else if (feature.getUuid().equals(ErmsTransformer.uuidNewCombination)) {
1509
		    return NoteCategory_New_Combination;
1510
		} else if (feature.getUuid().equals(ErmsTransformer.uuidNomenclature)) {
1511
		    return NoteCategory_Nomenclature;
1512
		} else if (feature.getUuid().equals(ErmsTransformer.uuidNote)){
1513
		    return NoteCategory_Note;
1514
		} else if (feature.getUuid().equals(ErmsTransformer.uuidOriginalCombination)) {
1515
		    return NoteCategory_Original_Combination;
1516
		} else if (feature.getUuid().equals(ErmsTransformer.uuidOriginalDescription)) {
1517
		    return NoteCategory_Original_Description;
1518
		} else if (feature.getUuid().equals(ErmsTransformer.uuidOriginalpublication)) {
1519
		    return NoteCategory_Original_publication;
1520
		} else if (feature.getUuid().equals(ErmsTransformer.uuidPublicationdate)) {
1521
            return NoteCategory_Publication_date;
1522
        } else if (feature.getUuid().equals(ErmsTransformer.uuidRank)) {
1523
		    return NoteCategory_Rank;
1524
		} else if (feature.getUuid().equals(ErmsTransformer.uuidRemark)) {
1525
		    return NoteCategory_Remark;
1526
		} else if (feature.getUuid().equals(ErmsTransformer.uuidReproduction)) {
1527
		    return NoteCategory_Reproduction;
1528
		} else if (feature.getUuid().equals(ErmsTransformer.uuidSpelling)) {
1529
		    return NoteCategory_Spelling;
1530
		} else if (feature.getUuid().equals(ErmsTransformer.uuidSpecimen)) {
1531
            return NoteCategory_Specimen;
1532
        } else if (feature.getUuid().equals(ErmsTransformer.uuidStatus)){
1533
		    return NoteCategory_Status;
1534
		} else if (feature.getUuid().equals(ErmsTransformer.uuidSynonymy)) {
1535
		    return NoteCategory_Synonymy;
1536
		} else if (feature.getUuid().equals(ErmsTransformer.uuidSyntype)) {
1537
		    return NoteCategory_Syntype;
1538
		} else if (feature.getUuid().equals(ErmsTransformer.uuidSystematics)) {
1539
		    return NoteCategory_Systematics;
1479 1540
		} else if (feature.getUuid().equals(ErmsTransformer.uuidTaxonomicRemarks)) {
1480 1541
			return NoteCategory_Taxonomic_Remarks;
1481
		} else if (feature.getUuid().equals(ErmsTransformer.uuidNote)){
1482
			return NoteCategory_Note;
1483 1542
		} else if (feature.getUuid().equals(ErmsTransformer.uuidTaxonomy)) {
1484 1543
			return NoteCategory_Taxonomy;
1485 1544
		} else if (feature.getUuid().equals(ErmsTransformer.uuidTaxonomicstatus)) {
1486 1545
			return NoteCategory_Taxonomic_status;
1487
		} else if (feature.getUuid().equals(ErmsTransformer.uuidStatus)){
1488
			return NoteCategory_Status;
1489
		} else if (feature.getUuid().equals(ErmsTransformer.uuidRank)) {
1490
			return NoteCategory_Rank;
1491
		} else if (feature.getUuid().equals(ErmsTransformer.uuidHomonymy)) {
1492
			return NoteCategory_Homonymy;
1493
		} else if (feature.getUuid().equals(ErmsTransformer.uuidNomenclature)) {
1494
			return NoteCategory_Nomenclature;
1546
		} else if (feature.getUuid().equals(ErmsTransformer.uuidTypelocality)) {
1547
		    return NoteCategory_Type_locality;
1548
		} else if (feature.getUuid().equals(ErmsTransformer.uuidTypeMaterial)) {
1549
		    return NoteCategory_Type_Material;
1550
		} else if (feature.getUuid().equals(ErmsTransformer.uuidTypeSpecimen)) {
1551
		    return NoteCategory_Type_Specimen;
1552
        } else if (feature.getUuid().equals(ErmsTransformer.uuidTypespecies)) {
1553
            return NoteCategory_Type_species;
1495 1554
		} else if (feature.getUuid().equals(ErmsTransformer.uuidTaxonomicRemark)) {
1496 1555
			return NoteCategory_Taxonomic_Remark;
1497
		} else if (feature.getUuid().equals(ErmsTransformer.uuidAcknowledgments)){
1498
			return NoteCategory_Acknowledgments;
1499
		} else if (feature.getUuid().equals(ErmsTransformer.uuidOriginalpublication)) {
1500
			return NoteCategory_Original_publication;
1501
		} else if (feature.getUuid().equals(ErmsTransformer.uuidTypelocality)) {
1502
			return NoteCategory_Type_locality;
1503 1556
		} else if (feature.getUuid().equals(ErmsTransformer.uuidValidity)) {
1504 1557
			return NoteCategory_Validity;
1505
		} else if (feature.getUuid().equals(ErmsTransformer.uuidIdentification)) {
1506
			return NoteCategory_Identification;
1507
		} else if (feature.getUuid().equals(ErmsTransformer.uuidSynonymy)) {
1508
			return NoteCategory_Synonymy;
1509
		} else if (feature.getUuid().equals(ErmsTransformer.uuidFossilRange)) {
1510
            return NoteCategory_Fossil_Range;
1511
		} else if (feature.getUuid().equals(ErmsTransformer.uuidDepthRange)) {
1512
            return NoteCategory_Depth_Range;
1513
		} else if (feature.getUuid().equals(ErmsTransformer.uuidGrammaticalGender)) {
1514
            return NoteCategory_Grammatical_Gender;
1515
        } else if (feature.getUuid().equals(ErmsTransformer.uuidIntroducedSpeciesRemark)) {
1516
            return NoteCategory_Introduced_Species_Remark;
1517
        } else if (feature.getUuid().equals(ErmsTransformer.uuidAlienSpecies)) {
1518
            return NoteCategory_Alien_Species;
1519
        } else if (feature.getUuid().equals(ErmsTransformer.uuidDimensions)) {
1520
            return NoteCategory_Dimensions;
1521
        } else if (feature.getUuid().equals(ErmsTransformer.uuidDiet)) {
1522
            return NoteCategory_Diet;
1523
        } else if (feature.getUuid().equals(ErmsTransformer.uuidReproduction)) {
1524
            return NoteCategory_Reproduction;
1558

  
1559

  
1525 1560
        } else if (feature.getUuid().equals(ErmsTransformer.uuidSourceOfSynonymy)) {
1526 1561
		    logger.debug("Source of synonymy not yet handled");
1527 1562
		    return null;

Also available in: Unified diff