Project

General

Profile

Revision 9585c46e

ID9585c46e93802b5a073e9fb7cd5f5c69a626db45
Parent 7a8c920c
Child 8876144e

Added by Andreas Müller 2 months ago

ref #9778, ref #9755, ref #9754, ref # 9757 split grex and add new ranks lusus, subproles and subgrex

View differences:

cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/berlinModel/BerlinModelTransformer.java
1030 1030
						case 58: return Rank.SPECIESAGGREGATE();
1031 1031
						case 59: return Rank.SPECIESGROUP();
1032 1032
						case 60: return Rank.SPECIES();
1033
						case 61: return Rank.GREX();
1033
						case 61: return Rank.GREX_INFRASPEC();
1034 1034
						case 65: return Rank.SUBSPECIES();
1035 1035
						case 66: {System.out.println("Rank 66 not yet implemented"); throw new UnknownCdmTypeException("Unknown Rank id" + Integer.valueOf(rankId).toString());}
1036 1036
						case 67: {System.out.println("Rank 67 not yet implemented"); throw new UnknownCdmTypeException("Unknown Rank id" + Integer.valueOf(rankId).toString());}
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/name/Rank.java
108 108
    public static final UUID uuidInfragenericTaxon = UUID.fromString("41bcc6ac-37d3-4fd4-bb80-3cc5b04298b9");
109 109
    public static final UUID uuidSpecies = UUID.fromString("b301f787-f319-4ccc-a10f-b4ed3b99a86d");
110 110
    private static final UUID uuidSubspecificAggregate = UUID.fromString("72c248b9-027d-4402-b375-dd4f0850c9ad");
111
    private static final UUID uuidGrexInfraspec = UUID.fromString("08dcb4ff-ac58-48a3-93af-efb3d836ac84");
112
    private static final UUID uuidSubgrex = UUID.fromString("fc7cd06f-199c-4128-92b2-312ac42efc34");
111 113
    private static final UUID uuidSubspecies = UUID.fromString("462a7819-8b00-4190-8313-88b5be81fad5");
112 114
    private static final UUID uuidInfraspecies = UUID.fromString("f28ebc9e-bd50-4194-9af1-42f5cb971a2c");
113 115
    private static final UUID uuidNatio = UUID.fromString("965f2f38-7f97-4270-ab5a-1999bf050a22");
......
118 120
    private static final UUID uuidSubsubvariety = UUID.fromString("bff22f84-553a-4429-a4e7-c4b3796c3a18");
119 121

  
120 122
    public static final UUID uuidProles = UUID.fromString("8810d1ba-6a34-4ae3-a355-919ccd1cd1a5");
123
    public static final UUID uuidSubproles = UUID.fromString("47bd1439-c2ba-4c4e-994f-9c60853258f8");
121 124
    public static final UUID uuidRace = UUID.fromString("196dee39-cfd8-4460-8bf0-88b83da27f62");
125
    public static final UUID uuidLusus = UUID.fromString("4c8e12f6-2c16-4eda-a7db-fd247dcce789");
122 126
    public static final UUID uuidSublusus = UUID.fromString("1fafa596-a8e7-4e62-a378-3cc8cb3627ca");
123 127

  
124 128
    private static final UUID uuidConvar = UUID.fromString("2cc740c9-cebb-43c8-9b06-1bef79e6a56a");
......
129 133
    public static final UUID uuidInfraspecificTaxon = UUID.fromString("eb75c27d-e154-4570-9d96-227b2df60474");
130 134
    private static final UUID uuidCandidate = UUID.fromString("ead9a1f5-dfd4-4de2-9121-70a47accb10b");
131 135
    private static final UUID uuidDenominationClass = UUID.fromString("49bdf74a-2170-40ed-8be2-887a0db517bf");
132
    public static final UUID uuidGrex = UUID.fromString("08dcb4ff-ac58-48a3-93af-efb3d836ac84");
136
    public static final UUID uuidGrexICNCP = UUID.fromString("1abffd79-1a1e-4a00-bb48-08df756d73d3");
133 137
    public static final UUID uuidGraftChimaera = UUID.fromString("6b4063bc-f934-4796-9bf3-0ef3aea5c1cb");
134 138
    public static final UUID uuidCultivarGroup = UUID.fromString("d763e7d3-e7de-4bb1-9d75-225ca6948659");
135 139
    public static final UUID uuidCultivar = UUID.fromString("5e98415b-dc6e-440b-95d6-ea33dbb39ad0");
......
356 360
    public static final Rank SUBSPECIFICAGGREGATE(){
357 361
        return getTermByUuid(uuidSubspecificAggregate);
358 362
    }
363
    public static final Rank GREX_INFRASPEC(){
364
        return getTermByUuid(uuidGrexInfraspec);
365
    }
366
    public static final Rank SUBGREX(){
367
        return getTermByUuid(uuidSubgrex);
368
    }
359 369
    public static final Rank SUBSPECIES(){
360 370
        return getTermByUuid(uuidSubspecies);
361 371
    }
......
380 390
    public static final Rank PROLES(){
381 391
        return getTermByUuid(uuidProles);
382 392
    }
393
    public static final Rank SUBPROLES(){
394
        return getTermByUuid(uuidSubproles);
395
    }
383 396
    public static final Rank RACE(){
384 397
        return getTermByUuid(uuidRace);
385 398
    }
399
    public static final Rank LUSUS(){
400
        return getTermByUuid(uuidLusus);
401
    }
386 402
    public static final Rank SUBLUSUS(){
387 403
        return getTermByUuid(uuidSublusus);
388 404
    }
......
415 431
    public static final Rank DENOMINATIONCLASS(){
416 432
        return getTermByUuid(uuidDenominationClass);
417 433
    }
418
    public static final Rank GREX(){
419
        return getTermByUuid(uuidGrex);
434
    public static final Rank GREX_ICNCP(){
435
        return getTermByUuid(uuidGrexICNCP);
420 436
    }
421 437
    public static final Rank GRAFTCHIMAERA(){
422 438
        return getTermByUuid(uuidGraftChimaera);
......
563 579
    public boolean isCultivar(){
564 580
        //TODO handle correctly as rankClass?
565 581
        return this.uuid.equals(uuidCultivar) || this.uuid.equals(uuidCultivarGroup)
566
                || this.uuid.equals(uuidGraftChimaera) || this.uuid.equals(uuidGrex);
582
                || this.uuid.equals(uuidGraftChimaera) || this.uuid.equals(uuidGrexICNCP);
567 583
    }
568 584

  
569 585

  
cdmlib-model/src/main/java/eu/etaxonomy/cdm/strategy/cache/name/TaxonNameDefaultCacheStrategy.java
402 402
            cultivarStr = CdmUtils.concat(" ", groupStr, cultivarStr);
403 403
        }else if (rankUuid.equals(Rank.uuidCultivarGroup)){
404 404
            cultivarStr = CdmUtils.concat(" ", groupStr, checkHasGroupEpithet(groupStr)? null: "Group");
405
        }else if (rankUuid.equals(Rank.uuidGrex)){
405
        }else if (rankUuid.equals(Rank.uuidGrexICNCP)){
406 406
            cultivarStr = CdmUtils.concat(" ", groupStr, checkHasGrexEpithet(groupStr)? null: "grex");
407 407
        }else{
408 408
            rankIsHandled = false;
cdmlib-model/src/main/java/eu/etaxonomy/cdm/strategy/parser/NonViralNameParserImpl.java
1569 1569
		    parseFullName(nameToBeFilled, scientificFullName, null, false);
1570 1570

  
1571 1571
            if (isNotBlank(grexName)){
1572
                nameToBeFilled.setRank(Rank.GREX());
1572
                nameToBeFilled.setRank(Rank.GREX_ICNCP());
1573 1573
                nameToBeFilled.setCultivarGroupEpithet(grexName);
1574 1574
            }
1575 1575
            if (isNotBlank(groupEpi) || isNotBlank(brGroupName)){
cdmlib-model/src/main/java/eu/etaxonomy/cdm/strategy/parser/NonViralNameParserImplRegExBase.java
95 95
    protected static String aggrOrGroupMarker = "(aggr\\.|agg\\.|group)";
96 96
    protected static String infraSpeciesMarkerNoNotho = "(subsp\\.|convar\\.|var\\.|subvar\\.|f\\.|forma|subf\\.|f\\.\\ssp\\.|f\\.spec\\.|f\\.sp\\.|\\[unranked\\]|\\[ranglos\\]|tax\\." + fWs + "infrasp\\.)";
97 97
    public static String infraSpeciesMarker = "(n|notho)?" + infraSpeciesMarkerNoNotho;
98
    public static String oldInfraSpeciesMarker = "(prol\\.|proles|race|taxon|sublusus)";
98
    public static String oldInfraSpeciesMarker = "(prol\\.|proles|race|taxon|(sub)?lusus|(sub)?grex)";
99 99

  
100 100
    //AuthorString
101 101
    protected static String qm = "[" + UTF8.QUOT_SINGLE_RIGHT + UTF8.ACUTE_ACCENT + UTF8.QUOT_SINGLE_LEFT_HIGH + "'`]";
cdmlib-model/src/main/resources/terms/Rank.csv
44 44
"d1988a11-292b-46fa-8fb7-bc64ea6d8fc6",,"Species Group","Species Group","species group","AG"
45 45
"b301f787-f319-4ccc-a10f-b4ed3b99a86d",,"Species","Species","sp.","SP"
46 46
"72c248b9-027d-4402-b375-dd4f0850c9ad",,"Subspecific Aggregate","Subspecific Aggregate",,"IS"
47
"08dcb4ff-ac58-48a3-93af-efb3d836ac84",,"Grex (infraspec)","Grex as used e.g. for Hieracium by German school (Zahn et al.)","grex","IS"
48
"fc7cd06f-199c-4128-92b2-312ac42efc34",,"Subgrex","Subgrex (see Grex (infraspec))","subgrex","IS"
47 49
"462a7819-8b00-4190-8313-88b5be81fad5",,"Subspecies","Subspecies","subsp.","IS"
48 50
"f28ebc9e-bd50-4194-9af1-42f5cb971a2c",,"Infraspecies","Infraspecies",,"IS"
49 51
"965f2f38-7f97-4270-ab5a-1999bf050a22",,"Natio","Natio",,"IS"
......
53 55
"9a83862a-7aee-480c-a98d-4bceaf8712ca",,"Subvariety","Subvariety","subvar.","IS"
54 56
"bff22f84-553a-4429-a4e7-c4b3796c3a18",,"Subsubvariety","Subsubvariety",,"IS"
55 57
"8810d1ba-6a34-4ae3-a355-919ccd1cd1a5",,"Proles","Rank 'Proles'. Note: This rank is not compliant with the current nomenclatural codes","prol.","IS"
58
"47bd1439-c2ba-4c4e-994f-9c60853258f8",,"Subproles","Rank 'Subproles'. Note: This rank is not compliant with the current nomenclatural codes","subprol.","IS"
56 59
"196dee39-cfd8-4460-8bf0-88b83da27f62",,"Race","Rank 'Race'. Note: This rank is not compliant with the current nomenclatural codes","race","IS"
60
"4c8e12f6-2c16-4eda-a7db-fd247dcce789",,"Lusus","Rank 'lusus'. Note: This rank is not compliant with the current nomenclatural codes","lusus","IS"
57 61
"1fafa596-a8e7-4e62-a378-3cc8cb3627ca",,"Sublusus","Rank 'Sublusus'. Note: This rank is not compliant with the current nomenclatural codes","sublusus","IS"
58 62
"2cc740c9-cebb-43c8-9b06-1bef79e6a56a",,"Convar","Convar","convar.","IS"
59 63
"0461281e-458a-47b9-8d41-19a3d39356d5",,"Form","Form","f.","IS"
......
63 67
"eb75c27d-e154-4570-9d96-227b2df60474",,"Unranked (infraspecific)","'Unranked' Infraspecific Rank: The infraspecific name on purpose has no rank","[infraspec.]","IS"
64 68
"ead9a1f5-dfd4-4de2-9121-70a47accb10b",,"Candidate","Candidate",,"IS"
65 69
"49bdf74a-2170-40ed-8be2-887a0db517bf",,"Denomination Class","Denomination Class",,"IS"
66
"08dcb4ff-ac58-48a3-93af-efb3d836ac84",,"Grex","Grex","grex","IS"
70
"1abffd79-1a1e-4a00-bb48-08df756d73d3",,"Grex (ICNCP)","Grex as defined ICNCP for orchids","gx","IS"
67 71
"6b4063bc-f934-4796-9bf3-0ef3aea5c1cb",,"Graft Chimaera","Graft Chimaera",,"IS"
68 72
"d763e7d3-e7de-4bb1-9d75-225ca6948659",,"Cultivar Group","Cultivar Group","Gp","IS"
69 73
"5e98415b-dc6e-440b-95d6-ea33dbb39ad0",,"Cultivar","Cultivar","cv.","IS"
cdmlib-model/src/test/java/eu/etaxonomy/cdm/model/name/RankTest.java
78 78
	private static final UUID uuidSubsubvariety = UUID.fromString("bff22f84-553a-4429-a4e7-c4b3796c3a18");
79 79

  
80 80
	private static final UUID uuidProles = UUID.fromString("8810d1ba-6a34-4ae3-a355-919ccd1cd1a5");
81
    private static final UUID uuidSubproles = UUID.fromString("47bd1439-c2ba-4c4e-994f-9c60853258f8");
81 82
	private static final UUID uuidRace = UUID.fromString("196dee39-cfd8-4460-8bf0-88b83da27f62");
83
	private static final UUID uuidLusus = UUID.fromString("4c8e12f6-2c16-4eda-a7db-fd247dcce789");
82 84
	private static final UUID uuidSublusus = UUID.fromString("1fafa596-a8e7-4e62-a378-3cc8cb3627ca");
83 85

  
84 86
	private static final UUID uuidConvar = UUID.fromString("2cc740c9-cebb-43c8-9b06-1bef79e6a56a");
......
359 361
	public void testPROLES() {
360 362
		assertEquals(uuidProles,  Rank.PROLES().getUuid());
361 363
	}
364
    @Test
365
    public void testSUBPROLES() {
366
        assertEquals(uuidSubproles,  Rank.SUBPROLES().getUuid());
367
    }
362 368

  
363 369
	@Test
364 370
	public void testRACE() {
365 371
		assertEquals(uuidRace,  Rank.RACE().getUuid());
366 372
	}
367

  
373
    @Test
374
    public void testLUSUS() {
375
        assertEquals(uuidLusus, Rank.LUSUS().getUuid());
376
    }
368 377
	@Test
369 378
	public void testSUBLUSUS() {
370 379
		assertEquals(uuidSublusus,  Rank.SUBLUSUS().getUuid());
......
412 421

  
413 422
	@Test
414 423
	public void testGREX() {
415
		assertEquals(uuidGrex,  Rank.GREX().getUuid());
424
		assertEquals(uuidGrex, Rank.GREX_INFRASPEC().getUuid());
416 425
	}
417 426

  
418 427
	@Test
......
505 514
		assertTrue(Rank.SUBSPECIES().isInfraSpecific());
506 515
		assertTrue(Rank.SUBSPECIES().isInfraSpecific());
507 516
		assertTrue(Rank.SUBSPECIES().isInfraSpecific());
508
		assertTrue(Rank.CULTIVAR().isInfraSpecific());
517
		assertTrue(Rank.CULTIVAR().isInfraSpecific());   //AM: ??
518

  
519
		assertTrue(Rank.GREX_INFRASPEC().isInfraSpecific());
520
	    assertTrue(Rank.SUBGREX().isInfraSpecific());
521
        assertTrue(Rank.LUSUS().isInfraSpecific());
522
        assertTrue(Rank.SUBLUSUS().isInfraSpecific());
523
        assertTrue(Rank.PROLES().isInfraSpecific());
509 524
	}
510 525

  
511 526
	@Test
cdmlib-model/src/test/java/eu/etaxonomy/cdm/strategy/cache/name/TaxonNameDefaultCacheStrategyTest.java
282 282
        Assert.assertEquals("", "Abies alba \u00D7 Second parent", hybridName.getNameCache());
283 283
    }
284 284

  
285
    //#9778
286
    @Test
287
    public void testOldRanks(){
288

  
289
        //grex
290
        subSpeciesName.setRank(Rank.GREX_INFRASPEC());
291
        Assert.assertEquals("Abies alba grex beta", strategy.getTitleCache(subSpeciesName));
292
        //subgrex
293
        subSpeciesName.setRank(Rank.SUBGREX());
294
        Assert.assertEquals("Abies alba subgrex beta", strategy.getTitleCache(subSpeciesName));
295
        //proles
296
        subSpeciesName.setRank(Rank.PROLES());
297
        Assert.assertEquals("Abies alba prol. beta", strategy.getTitleCache(subSpeciesName));
298
        //proles
299
        subSpeciesName.setRank(Rank.SUBPROLES());
300
        Assert.assertEquals("Abies alba subprol. beta", strategy.getTitleCache(subSpeciesName));
301
        //lusus
302
        subSpeciesName.setRank(Rank.LUSUS());
303
        Assert.assertEquals("Abies alba lusus beta", strategy.getTitleCache(subSpeciesName));
304
        //sublusus
305
        subSpeciesName.setRank(Rank.SUBLUSUS());
306
        Assert.assertEquals("Abies alba sublusus beta", strategy.getTitleCache(subSpeciesName));
307
    }
308

  
285 309
    //#9754
286 310
    @Test
287 311
    public void testCultivar(){
......
334 358
        Assert.assertEquals("Correct formatting for missing epithet needs to be discussed", "Abies Group", strategy.getTitleCache(speciesName));
335 359

  
336 360
        //grex
337
        speciesName.setRank(Rank.GREX());
361
        speciesName.setRank(Rank.GREX_ICNCP());
338 362
        speciesName.setCultivarGroupEpithet("Lovely");
339 363
        Assert.assertEquals("Abies Lovely grex", strategy.getTitleCache(speciesName));
340 364
        speciesName.setCultivarGroupEpithet(null);
cdmlib-model/src/test/java/eu/etaxonomy/cdm/strategy/parser/NonViralNameParserImplTest.java
831 831
        assertEquals( "infraspecific", name.getInfraSpecificEpithet());
832 832
        assertEquals( "Proles should be parsed", Rank.PROLES(), name.getRank());
833 833

  
834
        //lusus
835
        infraspecificUnranked = "Genus species lusus infraspecific";
836
        name = parser.parseFullName(infraspecificUnranked);
837
        assertEquals( "Genus", name.getGenusOrUninomial());
838
        assertEquals( "species", name.getSpecificEpithet());
839
        assertEquals( "infraspecific", name.getInfraSpecificEpithet());
840
        assertEquals( "Sublusus should be parsed", Rank.LUSUS(), name.getRank());
841

  
834 842
        //sublusus
835 843
        infraspecificUnranked = "Genus species sublusus infraspecific";
836 844
        name = parser.parseFullName(infraspecificUnranked);
......
846 854
        assertEquals( "species", name.getSpecificEpithet());
847 855
        assertEquals( "infraspecific", name.getInfraSpecificEpithet());
848 856
        assertEquals( "Race should be parsed", Rank.RACE(), name.getRank());
857

  
858
        //grex
859
        infraspecificUnranked = "Genus species grex infraspecific";
860
        name = parser.parseFullName(infraspecificUnranked);
861
        assertEquals( "Genus", name.getGenusOrUninomial());
862
        assertEquals( "species", name.getSpecificEpithet());
863
        assertEquals( "infraspecific", name.getInfraSpecificEpithet());
864
        assertEquals( "Race should be parsed", Rank.GREX_INFRASPEC(), name.getRank());
849 865
    }
850 866

  
851 867
    @Test
......
2482 2498
        Assert.assertNull(name.getSpecificEpithet());
2483 2499
        Assert.assertEquals("Albus grex", name.getCultivarGroupEpithet());
2484 2500
        Assert.assertEquals("Abies Albus grex", name.getNameCache());
2485
        Assert.assertEquals(Rank.uuidGrex, name.getRank().getUuid());
2501
        Assert.assertEquals(Rank.uuidGrexICNCP, name.getRank().getUuid());
2486 2502

  
2487 2503
        //same but using referenced name
2488 2504
        grex = "Abies Albus grex";
......
2491 2507
        Assert.assertNull(name.getSpecificEpithet());
2492 2508
        Assert.assertEquals("Albus grex", name.getCultivarGroupEpithet());
2493 2509
        Assert.assertEquals("Abies Albus grex", name.getNameCache());
2494
        Assert.assertEquals(Rank.uuidGrex, name.getRank().getUuid());
2510
        Assert.assertEquals(Rank.uuidGrexICNCP, name.getRank().getUuid());
2495 2511

  
2496 2512
        grex = "Abies Albus Second grex";
2497 2513
        name = parser.parseReferencedName(grex);
......
2499 2515
        Assert.assertNull(name.getSpecificEpithet());
2500 2516
        Assert.assertEquals("Albus Second grex", name.getCultivarGroupEpithet());
2501 2517
        Assert.assertEquals("Abies Albus Second grex", name.getNameCache());
2502
        Assert.assertEquals(Rank.uuidGrex, name.getRank().getUuid());
2518
        Assert.assertEquals(Rank.uuidGrexICNCP, name.getRank().getUuid());
2503 2519

  
2504 2520
        //combined
2505 2521
        String combined = "Abies (Albus Gruppo) 'Pretty'";

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)