Project

General

Profile

Revision 5b34cfd9

ID5b34cfd9db0109c75ef82380b6177354553edbd4
Parent e68e45bd
Child 5b113fbe

Added by Andreas Müller about 2 months ago

ref #9121 and ref #9124 add abbreviations to feature and add measurement unit to feature altitude

View differences:

cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/Feature.java
744 744
	        @SuppressWarnings("rawtypes") Map<UUID,DefinedTermBase> terms, boolean abbrevAsId) {
745 745
		Feature newInstance = super.readCsvLine(termClass, csvLine, termType, terms, abbrevAsId);
746 746

  
747
		//supported datatypes
748 747
		String text = csvLine.get(4);
748
		if (isNotBlank(text)){
749
		    newInstance.setSymbol(text);
750
		}
751

  
752
		//supported datatypes
753
		text = csvLine.get(5);
749 754
		if (text != null && text.length() == 8){
750 755
			if ("1".equals(text.substring(0, 1))){newInstance.setSupportsTextData(true);}
751 756
			if ("1".equals(text.substring(1, 2))){newInstance.setSupportsQuantitativeData(true);}
......
760 765
		}
761 766

  
762 767
		//availableFor
763
        text = csvLine.get(5);
768
        text = csvLine.get(6);
764 769
        if (text != null && text.length() == 3){
765 770
            if ("1".equals(text.substring(0, 1))){newInstance.setAvailableForTaxon(true);}
766 771
            if ("1".equals(text.substring(1, 2))){newInstance.setAvailableForOccurrence(true);}
......
769 774
            throw new IllegalStateException("AvailableFor XXX must exist for all 3 classes");
770 775
        }
771 776

  
772
        //abbrev label - there is no abbreviated label for features yet, if there is one in future we need to increment the index for supportXXX form 4 to 5
773
        newInstance.getRepresentation(Language.DEFAULT()).setAbbreviatedLabel(null);
777
        //recommended measurement unit
778
        text = csvLine.get(7);
779
        if (isNotBlank(text) && text.length() == 36){
780
            if (text.length() != 36){
781
                throw new IllegalStateException("Recommended measurement unit must be a UUID");
782
            }
783
            UUID uuid = UUID.fromString(text);
784
            MeasurementUnit recommendedMeasurementUnit = MeasurementUnit.getTermByUuid(uuid);
785
            if (recommendedMeasurementUnit == null){
786
                throw new IllegalArgumentException("Required recommended measurement unit not found for '"+text+"'");
787
            }else{
788
                newInstance.addRecommendedMeasurementUnit(recommendedMeasurementUnit);
789
            }
790
        }
791

  
774 792
		return newInstance;
775 793
	}
776 794

  
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/term/VocabularyEnum.java
62 62
	TermRelationshipType("4e5bb743-5ddf-4ee2-b893-36fbd386a5ee", TermRelationshipType.class),
63 63
    MarkerType("19dffff7-e142-429c-a420-5d28e4ebe305", MarkerType.class),
64 64
	AnnotationType("ca04609b-1ba0-4d31-9c2e-aa8eb2f4e62d", AnnotationType.class),
65
    MeasurementUnit("3b82c375-66bb-4636-be74-dc9cd087292a", MeasurementUnit.class),
65 66
	Feature("b187d555-f06f-4d65-9e53-da7c93f8eaa8", Feature.class),
66 67
	NameFeature("a7ca3eef-4092-49e1-beec-ed5096193e5e", Feature.class),
67 68
	TdwgArea("1fb40504-d1d7-44b0-9731-374fbe6cac77", NamedArea.class),
......
76 77
	ExtensionType("117cc307-5bd4-4b10-9b2f-2e14051b3b20",ExtensionType.class),
77 78
	ReferenceSystem("ec6376e5-0c9c-4f5c-848b-b288e6c17a86",ReferenceSystem.class),
78 79
	InstitutionType("29ad808b-3126-4274-be81-4561e7afc76f", DefinedTerm.class),
79
	MeasurementUnit("3b82c375-66bb-4636-be74-dc9cd087292a", MeasurementUnit.class),
80 80
	Scope("109bf76d-6f55-43d5-9ec5-6115d9490faa", DefinedTerm.class),
81 81
	Stage("4d475bea-c3ae-4494-be16-6796f22fabac", DefinedTerm.class),
82 82
	State("ceb65a53-c6cf-42bb-862f-daca7f2fc11d", State.class),
cdmlib-model/src/main/resources/terms/Feature.csv
1 1
"b187d555-f06f-4d65-9e53-da7c93f8eaa8",,"Feature","Feature","FE","0"
2
"910307f1-dc3c-452c-a6dd-af5ac7cd365c",,"Unknown","Unknown Feature Type","10000000","110",
3
"9087cdcd-8b08-4082-a1de-34c9ba9fb493",,"Description","Description","10000000","110",
4
"9fc9d10c-ba50-49ee-b174-ce83fc3f80c6",,"Distribution","Distribution","10100000","100",
5
"fd8c64f0-6ea5-44b0-9f70-e95833d6076e",,"Distribution (General)","Distribution (General)","10000000","100",
6
"aa923827-d333-4cf5-9a5f-438ae0a4746b",,"Ecology","Ecology","10000000","110",
7
"fb16929f-bc9c-456f-9d40-dec987b36438",,"Habitat","Habitat","10000000","110",
8
"9fdc4663-4d56-47d0-90b5-c0bf251bafbb",,"Habitat & Ecology","Habitat & Ecology","10000000","110",
9
"6f677e98-d8d5-4bc5-80bf-affdb7e3945a",,"Chromosome Numbers","Chromosome Numbers","10000000","110",
10
"9832e24f-b670-43b4-ac7c-20a7261a1d8c",,"Biology And Ecology","Biology And Ecology","10000000","110",
11
"a677f827-22b9-4205-bb37-11cb48dd9106",,"Key","Key","10000000","100",
12
"7c0c7571-a864-47c1-891d-01f59000dae1",,"Materials Examined","Materials Examined","10000000","100",
13
"1e87d9c3-0844-4a03-9686-773e2ccb3ab6",,"Materials Methods","Materials Methods","10000000","100",
14
"dd653d48-355c-4aec-a4e7-724f6eb29f8d",,"Etymology","Etymology","10000000","100",
15
"d43d8501-ceab-4caa-9e51-e87138528fac",,"Diagnosis","Diagnosis","10000000","100",
16
"d3c4cbb6-0025-4322-886b-cd0156753a25",,"Discussion","Discussion","10000000","100",
17
"86bd920d-f8c5-48b9-af1d-03f63c31de5c",,"Abstract","Abstract","10000000","100",
18
"e75255ca-8ff4-4905-baad-f842927fe1d3",,"Introduction","Introduction","10000000","100",
19
"489bf358-b78a-45e2-a691-f9f3f10446ce",,"Synopsis","Synopsis","10000000","100",
20
"89d3b005-9876-4923-89d9-60eb75b9583b",,"Multiple","Multiple","10000000","100",
21
"555a46bc-211a-476f-a022-c472970d6f8b",,"Acknowledgments","Acknowledgments","10000000","100",
22
"fc810911-51f0-4a46-ab97-6562fe263ae5",,"Common Name","Common Name","10000100","100",
23
"a7786d3e-7c58-4141-8416-346d4c80c4a2",,"Phenology","Phenology","10000000","100",
24
"5deff505-1a32-4817-9a74-50e6936fd630",,"Occurrence","Occurrence","10000000","100",
25
"99b2842f-9aa7-42fa-bd5f-7285311e0101",,"Citation","Citation","10000000","101",
26
"e5374d39-b210-47c7-bec1-bee05b5f1cb6",,"Uses","Uses","10000000","100",
27
"4518fc20-2492-47de-b345-777d2b83c9cf",,"Conservation","Conservation","10000000","100",
28
"e28965b2-a367-48c5-b954-8afc8ac2c69b",,"Cultivation","Cultivation","10000000","100",
29
"84193b2c-327f-4cce-90ef-c8da18fd5bb5",,"Image","Image","10000000","110",
30
"94213b2c-e67a-4d37-25ef-e8d316edfba1",,"Anatomy","Anatomy","10000000","110",
31
"6e9de1d5-05f0-40d5-8786-2fe30d0d894d",,"Host Plant","Host Plant","10001000","110",
32
"002d05f2-fd72-49f1-ba4d-196cf09240b5",,"Pathogen Agent","Pathogen Agent","10001000","110",
33
"e2308f37-ddc5-447d-b483-5e2171dd85fd",,"Individuals Association","Individuals Association","10010000","100",
34
"8200e050-d5fd-4cac-8a76-4b47afb13809",,"Specimen","Specimen","10010000","100",
35
"f59e747d-0b4f-4bf7-b69a-cbd50bc78595",,"Observation","Observation","10010000","100",
36
"86d40635-2a63-4ad6-be75-9faa4a6a57fb",,"Status","Status","10000000","100",
37
"bd9aca17-cd0e-4418-a3a1-1a4b80dbc162",,"Systematics","Systematics","10000000","100",
38
"b5780b45-6439-4f3c-9818-d89d26d36eb2",,"Notes","Taxonomic Notes","10000000","100",
39
"db9228d3-8bbf-4460-abfe-0b1326c82f8e",,"Life-form","Life-form","10000010","100",
40
"03710cb5-606e-444a-a3e6-594268e3cc47",,"Flowering Period","Flowering Period","10000001","100",
41
"04aa8993-24b4-43e3-888c-5afaa733376e",,"Fruiting Period","Fruiting Period","10000001","100",
42
"1a28ed59-e15f-4001-b5c2-ea89f0012671",,"Altitude","Altitude","11000000","110",
2
"910307f1-dc3c-452c-a6dd-af5ac7cd365c",,"Unknown","Unknown Feature Type","","10000000","110",,
3
"9087cdcd-8b08-4082-a1de-34c9ba9fb493",,"Description","Description","","10000000","110",,
4
"9fc9d10c-ba50-49ee-b174-ce83fc3f80c6",,"Distribution","Distribution","","10100000","100",,
5
"fd8c64f0-6ea5-44b0-9f70-e95833d6076e",,"Distribution (General)","Distribution (General)","","10000000","100",,
6
"aa923827-d333-4cf5-9a5f-438ae0a4746b",,"Ecology","Ecology","","10000000","110",,
7
"fb16929f-bc9c-456f-9d40-dec987b36438",,"Habitat","Habitat","","10000000","110",,
8
"9fdc4663-4d56-47d0-90b5-c0bf251bafbb",,"Habitat & Ecology","Habitat & Ecology","","10000000","110",,
9
"6f677e98-d8d5-4bc5-80bf-affdb7e3945a",,"Chromosome Numbers","Chromosome Numbers","","10000000","110",,
10
"9832e24f-b670-43b4-ac7c-20a7261a1d8c",,"Biology And Ecology","Biology And Ecology","","10000000","110",,
11
"a677f827-22b9-4205-bb37-11cb48dd9106",,"Key","Key","","10000000","100",,
12
"7c0c7571-a864-47c1-891d-01f59000dae1",,"Materials Examined","Materials Examined","","10000000","100",,
13
"1e87d9c3-0844-4a03-9686-773e2ccb3ab6",,"Materials Methods","Materials Methods","","10000000","100",,
14
"dd653d48-355c-4aec-a4e7-724f6eb29f8d",,"Etymology","Etymology","","10000000","100",,
15
"d43d8501-ceab-4caa-9e51-e87138528fac",,"Diagnosis","Diagnosis","","10000000","100",,
16
"d3c4cbb6-0025-4322-886b-cd0156753a25",,"Discussion","Discussion","","10000000","100",,
17
"86bd920d-f8c5-48b9-af1d-03f63c31de5c",,"Abstract","Abstract","","10000000","100",,
18
"e75255ca-8ff4-4905-baad-f842927fe1d3",,"Introduction","Introduction","","10000000","100",,
19
"489bf358-b78a-45e2-a691-f9f3f10446ce",,"Synopsis","Synopsis","","10000000","100",,
20
"89d3b005-9876-4923-89d9-60eb75b9583b",,"Multiple","Multiple","","10000000","100",,
21
"555a46bc-211a-476f-a022-c472970d6f8b",,"Acknowledgments","Acknowledgments","","10000000","100",,
22
"fc810911-51f0-4a46-ab97-6562fe263ae5",,"Common Name","Common Name","","10000100","100",,
23
"a7786d3e-7c58-4141-8416-346d4c80c4a2",,"Phenology","Phenology","","10000000","100",,
24
"5deff505-1a32-4817-9a74-50e6936fd630",,"Occurrence","Occurrence","","10000000","100",,
25
"99b2842f-9aa7-42fa-bd5f-7285311e0101",,"Citation","Citation","","10000000","101",,
26
"e5374d39-b210-47c7-bec1-bee05b5f1cb6",,"Uses","Uses","","10000000","100",,
27
"4518fc20-2492-47de-b345-777d2b83c9cf",,"Conservation","Conservation","","10000000","100",,
28
"e28965b2-a367-48c5-b954-8afc8ac2c69b",,"Cultivation","Cultivation","","10000000","100",,
29
"84193b2c-327f-4cce-90ef-c8da18fd5bb5",,"Image","Image","","10000000","110",,
30
"94213b2c-e67a-4d37-25ef-e8d316edfba1",,"Anatomy","Anatomy","","10000000","110",,
31
"6e9de1d5-05f0-40d5-8786-2fe30d0d894d",,"Host Plant","Host Plant","","10001000","110",,
32
"002d05f2-fd72-49f1-ba4d-196cf09240b5",,"Pathogen Agent","Pathogen Agent","","10001000","110",,
33
"e2308f37-ddc5-447d-b483-5e2171dd85fd",,"Individuals Association","Individuals Association","","10010000","100",,
34
"8200e050-d5fd-4cac-8a76-4b47afb13809",,"Specimen","Specimen","","10010000","100",,
35
"f59e747d-0b4f-4bf7-b69a-cbd50bc78595",,"Observation","Observation","","10010000","100",,
36
"86d40635-2a63-4ad6-be75-9faa4a6a57fb",,"Status","Status","","10000000","100",,
37
"bd9aca17-cd0e-4418-a3a1-1a4b80dbc162",,"Systematics","Systematics","","10000000","100",,
38
"b5780b45-6439-4f3c-9818-d89d26d36eb2",,"Notes","Taxonomic Notes","","10000000","100",,
39
"db9228d3-8bbf-4460-abfe-0b1326c82f8e",,"Life-form","Life-form","","10000010","100",,
40
"03710cb5-606e-444a-a3e6-594268e3cc47",,"Flowering Period","Flowering Period","Fl.","10000001","100",,
41
"04aa8993-24b4-43e3-888c-5afaa733376e",,"Fruiting Period","Fruiting Period","Fr.","10000001","100",,
42
"1a28ed59-e15f-4001-b5c2-ea89f0012671",,"Altitude","Altitude","","11000000","110","8bef5055-789c-41e5-bea2-8dc2ea8ecdf6",
cdmlib-model/src/main/resources/terms/NameFeature.csv
1 1
"a7ca3eef-4092-49e1-beec-ed5096193e5e",,"Name Feature","Features used in name descriptions","FE","0"
2
"71b356c5-1e3f-4f5d-9b0f-c2cf8ae7779f",,"Protologue","Protologue","10000000","001",
3
"2c355c16-cb04-4858-92bf-8da8d56dea95",,"Additional Publication","Additional Publication","10000000","001",
4
"355b2f47-d213-42af-a9e3-58a5db0f5b5c",,"Typification Notes","Typification Notes","10000000","001",
5
"0e5a93fc-3783-4248-be66-4cc346cd8e18",,"Orthography","Orthography","10000000","001",
6
"3b46f5f2-5619-4f1a-884f-d7a805471942",,"Etymology","Etymology","10000000","001",
2
"71b356c5-1e3f-4f5d-9b0f-c2cf8ae7779f",,"Protologue","Protologue","","10000000","001",,
3
"2c355c16-cb04-4858-92bf-8da8d56dea95",,"Additional Publication","Additional Publication","","10000000","001",,
4
"355b2f47-d213-42af-a9e3-58a5db0f5b5c",,"Typification Notes","Typification Notes","","10000000","001",,
5
"0e5a93fc-3783-4248-be66-4cc346cd8e18",,"Orthography","Orthography","","10000000","001",,
6
"3b46f5f2-5619-4f1a-884f-d7a805471942",,"Etymology","Etymology","","10000000","001",,
cdmlib-model/src/test/java/eu/etaxonomy/cdm/model/term/DefaultTermInitializerTest.java
11 11
import static org.junit.Assert.assertNotNull;
12 12
import static org.junit.Assert.assertNull;
13 13

  
14
import java.util.Set;
15

  
14 16
import org.apache.log4j.Logger;
15 17
import org.junit.Assert;
16 18
import org.junit.BeforeClass;
......
43 45
		assertNotNull("Default language should be english but is null", Language.DEFAULT());
44 46
		TermVocabulary<Language> voc = Language.DEFAULT().getVocabulary();
45 47
		assertNotNull("language for language vocabulary representation was null but must be default language", voc.getRepresentation(Language.DEFAULT()));
48

  
49
		Set<MeasurementUnit> units = Feature.ALTITUDE().getRecommendedMeasurementUnits();
50
		Assert.assertEquals("Recommended measurement unit should exist", 1, units.size());
51
		Assert.assertEquals(MeasurementUnit.uuidMeter, units.iterator().next().getUuid());
46 52
	}
47 53
}

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)