1
|
/**
|
2
|
* Copyright (C) 2009 EDIT
|
3
|
* European Distributed Institute of Taxonomy
|
4
|
* http://www.e-taxonomy.eu
|
5
|
*
|
6
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
7
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
8
|
*/
|
9
|
package eu.etaxonomy.cdm.io.pesi.out;
|
10
|
|
11
|
import java.sql.ResultSet;
|
12
|
import java.sql.SQLException;
|
13
|
import java.util.EnumSet;
|
14
|
import java.util.HashMap;
|
15
|
import java.util.HashSet;
|
16
|
import java.util.Map;
|
17
|
import java.util.Set;
|
18
|
import java.util.UUID;
|
19
|
|
20
|
import org.apache.commons.lang.StringUtils;
|
21
|
import org.apache.log4j.Logger;
|
22
|
|
23
|
import eu.etaxonomy.cdm.common.CdmUtils;
|
24
|
import eu.etaxonomy.cdm.io.berlinModel.BerlinModelTransformer;
|
25
|
import eu.etaxonomy.cdm.io.common.Source;
|
26
|
import eu.etaxonomy.cdm.io.common.mapping.UndefinedTransformerMethodException;
|
27
|
import eu.etaxonomy.cdm.io.common.mapping.out.ExportTransformerBase;
|
28
|
import eu.etaxonomy.cdm.io.pesi.erms.ErmsTransformer;
|
29
|
import eu.etaxonomy.cdm.io.pesi.faunaEuropaea.FaunaEuropaeaTransformer;
|
30
|
import eu.etaxonomy.cdm.io.pesi.out.PesiExportBase.PesiSource;
|
31
|
import eu.etaxonomy.cdm.model.common.CdmBase;
|
32
|
import eu.etaxonomy.cdm.model.common.Language;
|
33
|
import eu.etaxonomy.cdm.model.common.RelationshipBase;
|
34
|
import eu.etaxonomy.cdm.model.common.RelationshipTermBase;
|
35
|
import eu.etaxonomy.cdm.model.description.Feature;
|
36
|
import eu.etaxonomy.cdm.model.description.PresenceAbsenceTerm;
|
37
|
import eu.etaxonomy.cdm.model.location.Country;
|
38
|
import eu.etaxonomy.cdm.model.location.NamedArea;
|
39
|
import eu.etaxonomy.cdm.model.name.HybridRelationshipType;
|
40
|
import eu.etaxonomy.cdm.model.name.NameRelationshipType;
|
41
|
import eu.etaxonomy.cdm.model.name.NameTypeDesignationStatus;
|
42
|
import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
|
43
|
import eu.etaxonomy.cdm.model.name.NomenclaturalStatusType;
|
44
|
import eu.etaxonomy.cdm.model.name.Rank;
|
45
|
import eu.etaxonomy.cdm.model.name.TaxonName;
|
46
|
import eu.etaxonomy.cdm.model.reference.Reference;
|
47
|
import eu.etaxonomy.cdm.model.reference.ReferenceType;
|
48
|
import eu.etaxonomy.cdm.model.taxon.Synonym;
|
49
|
import eu.etaxonomy.cdm.model.taxon.SynonymType;
|
50
|
import eu.etaxonomy.cdm.model.taxon.Taxon;
|
51
|
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
|
52
|
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
|
53
|
import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
|
54
|
import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
|
55
|
import eu.etaxonomy.cdm.strategy.exceptions.UnknownCdmTypeException;
|
56
|
|
57
|
/**
|
58
|
* @author e.-m.lee
|
59
|
* @author a.mueller (update)
|
60
|
* @since 16.02.2010
|
61
|
*/
|
62
|
public final class PesiTransformer extends ExportTransformerBase{
|
63
|
|
64
|
private static final Logger logger = Logger.getLogger(PesiTransformer.class);
|
65
|
|
66
|
public static final String AUCT_STRING = "auct.";
|
67
|
|
68
|
//sourceRefUUIDs
|
69
|
public static final UUID uuidSourceRefEuroMed = UUID.fromString("51b3900c-91e0-4cc5-94f3-577a352ca9c4");
|
70
|
public static final UUID uuidSourceRefFaunaEuropaea = UUID.fromString("f27a5e67-d065-4b79-8d41-eabd3ae0edd0");
|
71
|
public static final UUID uuidSourceRefErms = UUID.fromString("7744bc26-f914-42c4-b54a-dd2a030a8bb7");
|
72
|
public static final UUID uuidSourceRefIndexFungorum = UUID.fromString("8de25d27-7d40-47f4-af3b-59d64935a843");
|
73
|
public static final UUID uuidSourceRefAuct = UUID.fromString("5f79f96c-c100-4cd8-b78e-2b2dacf09a23");
|
74
|
public static final UUID uuidSourceRefFaunaEuropaea_fromSql = UUID.fromString("6786d863-75d4-4796-b916-c1c3dff4cb70");
|
75
|
|
76
|
public static final UUID uuidTaxonValuelessEuroMed = UUID.fromString("f0a9322b-a57e-447b-9a75-a909f2f2a994");
|
77
|
|
78
|
public static final String SOURCE_STR_EM = "E+M";
|
79
|
public static final String SOURCE_STR_FE = "FaEu";
|
80
|
public static final String SOURCE_STR_IF = "IF";
|
81
|
public static final String SOURCE_STR_ERMS = "ERMS";
|
82
|
|
83
|
// status keys
|
84
|
private static int QUALITY_STATUS_CHECKED_EDITOR_ERMS_1_1 = 0;
|
85
|
private static int QUALITY_STATUS_ADD_BY_DBMT= 2;
|
86
|
private static int QUALITY_STATUS_CHECKED_EDITOR = 3;
|
87
|
private static int QUALITY_STATUS_EDITED_BY_DBMT = 4;
|
88
|
|
89
|
// marker type
|
90
|
public static final UUID uuidMarkerGuidIsMissing = UUID.fromString("24e70843-05e2-44db-954b-84df0d23ea20");
|
91
|
public static final UUID uuidMarkerTypeHasNoLastAction = UUID.fromString("99652d5a-bc92-4251-b57d-0fec4d258ab7");
|
92
|
// public static final UUID uuidMarkerFossil = UUID.fromString("761ce108-031a-4e07-b444-f8d757070312");
|
93
|
|
94
|
|
95
|
//extension type uuids
|
96
|
public static final UUID uuidExtCacheCitation = UUID.fromString("29656168-32d6-4301-9067-d57c63be5c67");
|
97
|
//public static final UUID expertUserIdUuid = UUID.fromString("e25813d3-c67c-4585-9aa0-970fafde50b4");
|
98
|
//public static final UUID speciesExpertUserIdUuid = UUID.fromString("6d42abd8-8894-4980-ae07-e918affd4172");
|
99
|
public static final UUID uuidExtExpertName = BerlinModelTransformer.uuidExpertName;
|
100
|
public static final UUID uuidExtSpeciesExpertName = BerlinModelTransformer.uuidSpeciesExpertName;
|
101
|
public static final UUID uuidExtLastActionDate = UUID.fromString("8d0a7d81-bb83-4576-84c3-8c906ef039b2");
|
102
|
public static final UUID uuidExtLastAction = UUID.fromString("bc20d5bc-6161-4279-9499-89ea26ce5f6a");
|
103
|
public static final UUID uuidExtTaxComment = UUID.fromString("8041a752-0479-4626-ab1b-b266b751f816");
|
104
|
public static final UUID uuidExtFauComment = UUID.fromString("054f773a-41c8-4ad5-83e3-981320c1c126");
|
105
|
public static final UUID uuidExtFauExtraCodes = UUID.fromString("b8c7e77d-9869-4787-bed6-b4b302dbc5f5");
|
106
|
|
107
|
// References
|
108
|
private static int REF_ARTICLE_IN_PERIODICAL = 1;
|
109
|
private static int REF_PART_OF_OTHER = 2;
|
110
|
public static int REF_BOOK = 3;
|
111
|
public static int REF_DATABASE = 4;
|
112
|
private static int REF_INFORMAL = 5;
|
113
|
private static int REF_NOT_APPLICABLE = 6;
|
114
|
private static int REF_WEBSITE = 7;
|
115
|
public static int REF_PUBLISHED_CD = 8;
|
116
|
public static int REF_JOURNAL = 9;
|
117
|
public static int REF_UNRESOLVED = 10;
|
118
|
public static int REF_PUBLICATION = 11;
|
119
|
public static String REF_STR_UNRESOLVED = "unresolved";
|
120
|
|
121
|
private static int LANG_UNKNOWN = -99;
|
122
|
private static int LANG_DUTCH = 11;
|
123
|
private static int LANG_VALENCIAN = 65;
|
124
|
private static int LANG_HIGH_ARAGONES = 66;
|
125
|
private static int LANG_MAJORCAN = 67;
|
126
|
|
127
|
|
128
|
// NameStatus
|
129
|
public static UUID uuidNomStatusTemporaryName = UUID.fromString("aa6ada5a-ca21-4fef-b76f-9ae237e9c4ae");
|
130
|
|
131
|
private static int NAME_ST_NOM_INVAL = 1;
|
132
|
private static int NAME_ST_NOM_ILLEG = 2;
|
133
|
private static int NAME_ST_NOM_NUD = 3;
|
134
|
private static int NAME_ST_NOM_REJ = 4;
|
135
|
private static int NAME_ST_NOM_REJ_PROP = 5;
|
136
|
private static int NAME_ST_NOM_UTIQUE_REJ = 6;
|
137
|
private static int NAME_ST_NOM_UTIQUE_REJ_PROP = 7;
|
138
|
private static int NAME_ST_NOM_CONS = 8;
|
139
|
private static int NAME_ST_NOM_CONS_PROP = 9;
|
140
|
private static int NAME_ST_ORTH_CONS = 10;
|
141
|
private static int NAME_ST_ORTH_CONS_PROP = 11;
|
142
|
private static int NAME_ST_NOM_SUPERFL = 12;
|
143
|
private static int NAME_ST_NOM_AMBIG = 13;
|
144
|
private static int NAME_ST_NOM_PROVIS = 14;
|
145
|
private static int NAME_ST_NOM_DUB = 15;
|
146
|
private static int NAME_ST_NOM_NOV = 16;
|
147
|
private static int NAME_ST_NOM_CONFUS = 17;
|
148
|
private static int NAME_ST_NOM_ALTERN = 18;
|
149
|
private static int NAME_ST_COMB_INVAL = 19;
|
150
|
private static int NAME_ST_LEGITIMATE = 20; // PESI specific from here
|
151
|
private static int NAME_ST_COMB_INED = 21;
|
152
|
private static int NAME_ST_COMB_AND_STAT_INED = 22;
|
153
|
private static int NAME_ST_NOM_AND_ORTH_CONS = 23;
|
154
|
private static int NAME_ST_NOM_NOV_INED = 24;
|
155
|
private static int NAME_ST_SP_NOV_INED = 25;
|
156
|
private static int NAME_ST_ALTERNATE_REPRESENTATION = 26;
|
157
|
private static int NAME_ST_TEMPORARY_NAME = 27;
|
158
|
private static int NAME_ST_SPECIES_INQUIRENDA = 28;
|
159
|
|
160
|
// TaxonStatus
|
161
|
public static int T_STATUS_ACCEPTED = 1;
|
162
|
public static int T_STATUS_SYNONYM = 2;
|
163
|
public static int T_STATUS_PARTIAL_SYN = 3;
|
164
|
public static int T_STATUS_PRO_PARTE_SYN = 4;
|
165
|
private static int T_STATUS_UNRESOLVED = 5;
|
166
|
private static int T_STATUS_ORPHANED = 6;
|
167
|
public static int T_STATUS_UNACCEPTED = 7;
|
168
|
private static int T_STATUS_NOT_ACCEPTED_VALUELESS = 8;
|
169
|
|
170
|
// TypeDesginationStatus // -> not a table anymore
|
171
|
private static int TYPE_BY_ORIGINAL_DESIGNATION = 1;
|
172
|
private static int TYPE_BY_SUBSEQUENT_DESIGNATION = 2;
|
173
|
private static int TYPE_BY_MONOTYPY = 3;
|
174
|
private static String TYPE_STR_BY_ORIGINAL_DESIGNATION = "Type by original designation";
|
175
|
private static String TYPE_STR_BY_SUBSEQUENT_DESIGNATION = "Type by subsequent designation";
|
176
|
private static String TYPE_STR_BY_MONOTYPY = "Type by monotypy";
|
177
|
|
178
|
// RelTaxonQualifier
|
179
|
private static int IS_BASIONYM_FOR = 1;
|
180
|
private static int IS_LATER_HOMONYM_OF = 2;
|
181
|
private static int IS_REPLACED_SYNONYM_FOR = 3;
|
182
|
private static int IS_VALIDATION_OF = 4;
|
183
|
private static int IS_LATER_VALIDATION_OF = 5;
|
184
|
private static int IS_TYPE_OF = 6;
|
185
|
private static int IS_CONSERVED_TYPE_OF = 7;
|
186
|
private static int IS_REJECTED_TYPE_OF = 8;
|
187
|
private static int IS_FIRST_PARENT_OF = 9;
|
188
|
private static int IS_SECOND_PARENT_OF = 10;
|
189
|
private static int IS_FEMALE_PARENT_OF = 11;
|
190
|
private static int IS_MALE_PARENT_OF = 12;
|
191
|
private static int IS_CONSERVED_AGAINST = 13;
|
192
|
private static int IS_REJECTED_IN_FAVOUR_OF = 14;
|
193
|
private static int IS_TREATED_AS_LATER_HOMONYM_OF = 15;
|
194
|
private static int IS_ORTHOGRAPHIC_VARIANT_OF = 16;
|
195
|
private static int IS_ALTERNATIVE_NAME_FOR = 17;
|
196
|
private static int HAS_SAME_TYPE_AS = 18;
|
197
|
private static int IS_ORIGINAL_SPELLING_FOR = 19;
|
198
|
private static int IS_BLOCKING_NAME_FOR = 20;
|
199
|
private static int IS_LECTOTYPE_OF = 61;
|
200
|
private static int TYPE_NOT_DESIGNATED = 62;
|
201
|
public static int IS_TAXONOMICALLY_INCLUDED_IN = 101;
|
202
|
public static int IS_SYNONYM_OF = 102;
|
203
|
private static int IS_MISAPPLIED_NAME_FOR = 103;
|
204
|
private static int IS_PRO_PARTE_SYNONYM_OF = 104;
|
205
|
private static int IS_PARTIAL_SYNONYM_OF = 105;
|
206
|
private static int IS_HETEROTYPIC_SYNONYM_OF = 106;
|
207
|
private static int IS_HOMOTYPIC_SYNONYM_OF = 107;
|
208
|
private static int IS_PRO_PARTE_MISAPPLIED_NAME_FOR = 108;
|
209
|
private static int IS_PRO_PARTE_AND_HOMOTYPIC_SYNONYM_OF = 201;
|
210
|
private static int IS_PRO_PARTE_AND_HETEROTYPIC_SYNONYM_OF = 202;
|
211
|
private static int IS_PARTIAL_AND_HOMOTYPIC_SYNONYM_OF = 203;
|
212
|
private static int IS_PARTIAL_AND_HETEROTYPIC_SYNONYM_OF = 204;
|
213
|
private static int IS_INFERRED_EPITHET_FOR = 301;
|
214
|
private static int IS_INFERRED_GENUS_FOR = 302;
|
215
|
private static int IS_POTENTIAL_COMBINATION_FOR = 303;
|
216
|
|
217
|
//namespaces
|
218
|
public static String STR_NAMESPACE_NOMINAL_TAXON = "Nominal taxon from TAX_ID:";
|
219
|
public static String STR_NAMESPACE_INFERRED_EPITHET = "Inferred epithet from TAX_ID:";
|
220
|
public static String STR_NAMESPACE_INFERRED_GENUS = "Inferred genus from TAX_ID:";
|
221
|
public static String STR_NAMESPACE_POTENTIAL_COMBINATION = "Potential combination from TAX_ID:";
|
222
|
|
223
|
// Kingdoms
|
224
|
private static final int KINGDOM_NULL = 0;
|
225
|
private static final int KINGDOM_ANIMALIA = 2;
|
226
|
private static final int KINGDOM_PLANTAE = 3;
|
227
|
private static final int KINGDOM_FUNGI = 4;
|
228
|
private static final int KINGDOM_PROTOZOA = 5;
|
229
|
private static final int KINGDOM_BACTERIA = 6;
|
230
|
private static final int KINGDOM_CHROMISTA = 7;
|
231
|
|
232
|
// Kingdoms
|
233
|
private static Map<String, Integer> pesiKingdomMap = new HashMap<>();
|
234
|
|
235
|
//Kingdom title
|
236
|
private static String KINGDOM_PLANTAE_STRING = "Plantae";
|
237
|
private static String KINGDOM_FUNGI_STRING = "Fungi";
|
238
|
private static String KINGDOM_PROTOZOA_STRING = "Protozoa";
|
239
|
private static String kINGDOM_BACTERIA_STRING = "Bacteria";
|
240
|
private static String KINGDOM_CHROMISTA_STRING = "Chromista";
|
241
|
|
242
|
//ranks of all kingdoms
|
243
|
private static int Kingdom = 10;
|
244
|
private static int Subkingdom = 20;
|
245
|
private static int Phylum = 30; //Phylum and Division is same (#8541) according to ICNAFP
|
246
|
private static int Division = 30;
|
247
|
private static int Subphylum = 40; //See above comment
|
248
|
private static int Subdivision = 40;
|
249
|
private static int Class = 60;
|
250
|
private static int Subclass = 70;
|
251
|
private static int Order = 100;
|
252
|
private static int Suborder = 110;
|
253
|
private static int Family = 140;
|
254
|
private static int Subfamily = 150;
|
255
|
private static int Tribe = 160;
|
256
|
private static int Subtribe = 170;
|
257
|
private static int Genus = 180;
|
258
|
private static int Subgenus = 190;
|
259
|
private static int Species =220;
|
260
|
private static int Subspecies = 230;
|
261
|
private static int Variety = 240;
|
262
|
private static int Forma = 260;
|
263
|
|
264
|
//ranks of some kingdoms
|
265
|
private static int Infrakingdom = 25; //2,3,5,7
|
266
|
private static int Infraphylum = 45; //2,7
|
267
|
private static int Superclass = 50; //2,5,6,7
|
268
|
private static int Infraclass = 80; //2,5,6,7
|
269
|
private static int Superorder = 90; //2,3,5,6,7
|
270
|
private static int Infraorder = 120; //2,5,6,7
|
271
|
private static int Superfamily = 130; //2,5,6,7
|
272
|
private static int Bot_Section = 200; //3,4,7
|
273
|
private static int Bot_Subsection = 210; //3,4,7
|
274
|
private static int Subvariety = 250; //2,3,4,7
|
275
|
private static int Subform = 270; //2,3,4
|
276
|
private static int Forma_spec = 275; //3,4,5,7
|
277
|
|
278
|
// Animalia Ranks
|
279
|
private static int Superphylum = 28;
|
280
|
private static int Subterclass = 85;
|
281
|
private static int Parvorder = 122;
|
282
|
private static int Animalia_Section = 125;
|
283
|
private static int Animalia_Subsection = 127;
|
284
|
private static int Natio = 235;
|
285
|
|
286
|
// Plantae Ranks
|
287
|
private static int Series = 212;
|
288
|
private static int Subseries = 214;
|
289
|
private static int Aggregate = 216;
|
290
|
private static int Coll_Species = 218;
|
291
|
private static int Grex = 225;
|
292
|
private static int Proles = 232;
|
293
|
private static int Race = 234;
|
294
|
private static int Convarietas = 236;
|
295
|
private static int Taxa_infragen = 280;
|
296
|
private static int Taxa_infraspec = 285;
|
297
|
|
298
|
|
299
|
//NoteCategory
|
300
|
private static int NoteCategory_description = 1;
|
301
|
public static int NoteCategory_ecology = 4;
|
302
|
private static int NoteCategory_phenology = 5;
|
303
|
private static int NoteCategory_general_distribution_euromed = 10;
|
304
|
private static int NoteCategory_general_distribution_world = 11;
|
305
|
private static int NoteCategory_Common_names = 12;
|
306
|
private static int NoteCategory_Occurrence = 13;
|
307
|
private static int NoteCategory_Maps =14;
|
308
|
private static int NoteCategory_Link_to_maps = 20;
|
309
|
private static int NoteCategory_Link_to_images = 21;
|
310
|
public static int NoteCategory_Link_to_taxonomy = 22;
|
311
|
public static int NoteCategory_Link_to_general_information = 23;
|
312
|
public static int NoteCategory_undefined_link = 24;
|
313
|
private static int NoteCategory_Editor_Braces = 249;
|
314
|
private static int NoteCategory_Editor_Brackets = 250;
|
315
|
private static int NoteCategory_Editor_Parenthesis = 251;
|
316
|
private static int NoteCategory_Inedited = 252;
|
317
|
private static int NoteCategory_Comments_on_editing_process = 253;
|
318
|
private static int NoteCategory_Publication_date = 254;
|
319
|
private static int NoteCategory_Morphology = 255;
|
320
|
private static int NoteCategory_Acknowledgments = 257;
|
321
|
private static int NoteCategory_Original_publication = 258;
|
322
|
private static int NoteCategory_Type_locality = 259;
|
323
|
private static int NoteCategory_Environment = 260;
|
324
|
private static int NoteCategory_Spelling = 261;
|
325
|
private static int NoteCategory_Systematics = 262;
|
326
|
private static int NoteCategory_Remark = 263;
|
327
|
private static int NoteCategory_Additional_information = 266;
|
328
|
private static int NoteCategory_Status = 267;
|
329
|
private static int NoteCategory_Nomenclature = 268;
|
330
|
private static int NoteCategory_Homonymy = 269;
|
331
|
private static int NoteCategory_Taxonomy = 270;
|
332
|
private static int NoteCategory_Taxonomic_status = 272;
|
333
|
private static int NoteCategory_Authority = 273;
|
334
|
private static int NoteCategory_Identification = 274;
|
335
|
private static int NoteCategory_Validity = 275;
|
336
|
private static int NoteCategory_Classification = 276;
|
337
|
private static int NoteCategory_Distribution = 278;
|
338
|
private static int NoteCategory_Synonymy = 279;
|
339
|
private static int NoteCategory_Habitat = 280;
|
340
|
private static int NoteCategory_Biology = 281;
|
341
|
private static int NoteCategory_Diagnosis = 282;
|
342
|
private static int NoteCategory_Host = 283;
|
343
|
private static int NoteCategory_Note = 284;
|
344
|
private static int NoteCategory_Rank = 285;
|
345
|
private static int NoteCategory_Taxonomic_Remark = 286;
|
346
|
private static int NoteCategory_Taxonomic_Remarks = 287;
|
347
|
private static int NoteCategory_Etymology = 288;
|
348
|
private static int NoteCategory_Type_species = 289;
|
349
|
private static int NoteCategory_Depth_Range = 290;
|
350
|
private static int NoteCategory_Grammatical_Gender = 291;
|
351
|
private static int NoteCategory_Introduced_Species_Remark = 292;
|
352
|
private static int NoteCategory_Alien_Species = 293;
|
353
|
private static int NoteCategory_Dimensions = 294;
|
354
|
private static int NoteCategory_New_Combination = 295;
|
355
|
private static int NoteCategory_Original_Combination = 296;
|
356
|
|
357
|
private static int NoteCategory_Conservation_Status= 301;
|
358
|
private static int NoteCategory_Use = 302;
|
359
|
private static int NoteCategory_Comments = 303;
|
360
|
private static int NoteCategory_Diet = 304;
|
361
|
private static int NoteCategory_Fossil_Range = 305;
|
362
|
private static int NoteCategory_Original_Description = 306;
|
363
|
private static int NoteCategory_Reproduction = 307;
|
364
|
private static int NoteCategory_Specimen = 308;
|
365
|
private static int NoteCategory_Type_Specimen = 309;
|
366
|
private static int NoteCategory_Type_Material = 310;
|
367
|
private static int NoteCategory_Editors_Comment = 311;
|
368
|
private static int NoteCategory_Syntype = 312;
|
369
|
|
370
|
// FossilStatus
|
371
|
private static int FOSSILSTATUS_RECENT_ONLY = 1;
|
372
|
private static int FOSSILSTATUS_FOSSIL_ONLY = 2;
|
373
|
private static int FOSSILSTATUS_RECENT_FOSSIL = 3;
|
374
|
public static String STR_FOSSIL_ONLY = "fossil only"; //still used for Index Fungorum
|
375
|
|
376
|
// SourceUse
|
377
|
private static int ORIGINAL_DESCRIPTION = 1;
|
378
|
private static int BASIS_OF_RECORD = 2;
|
379
|
private static int ADDITIONAL_SOURCE = 3;
|
380
|
private static int SOURCE_OF_SYNONYMY = 4;
|
381
|
private static int REDESCRIPTION = 5;
|
382
|
private static int NEW_COMBINATION_REFERENCE = 6;
|
383
|
private static int STATUS_SOURCE = 7;
|
384
|
public static int NOMENCLATURAL_REFERENCE = 8;
|
385
|
public static String STR_NOMENCLATURAL_REFERENCE = "nomenclatural reference";
|
386
|
|
387
|
// Area
|
388
|
private static int AREA_EAST_AEGEAN_ISLANDS = 1;
|
389
|
private static int AREA_GREEK_EAST_AEGEAN_ISLANDS = 2;
|
390
|
private static int AREA_TURKISH_EAST_AEGEAN_ISLANDS = 3;
|
391
|
private static int AREA_ALBANIA = 4;
|
392
|
private static int AREA_AUSTRIA_WITH_LIECHTENSTEIN = 5;
|
393
|
private static int AREA_AUSTRIA = 6;
|
394
|
private static int AREA_LIECHTENSTEIN = 7;
|
395
|
private static int AREA_AZORES = 8;
|
396
|
private static int AREA_CORVO = 9;
|
397
|
private static int AREA_FAIAL = 10;
|
398
|
private static int AREA_GRACIOSA = 11;
|
399
|
private static int AREA_SAO_JORGE = 12;
|
400
|
private static int AREA_FLORES = 13;
|
401
|
private static int AREA_SAO_MIGUEL = 14;
|
402
|
private static int AREA_PICO = 15;
|
403
|
private static int AREA_SANTA_MARIA = 16;
|
404
|
private static int AREA_TERCEIRA = 17;
|
405
|
private static int AREA_BELGIUM_WITH_LUXEMBOURG = 18;
|
406
|
private static int AREA_BELGIUM = 19;
|
407
|
private static int AREA_LUXEMBOURG = 20;
|
408
|
private static int AREA_BOSNIA_HERZEGOVINA = 21;
|
409
|
private static int AREA_BALEARES = 22;
|
410
|
private static int AREA_IBIZA_WITH_FORMENTERA = 23;
|
411
|
private static int AREA_MALLORCA = 24;
|
412
|
private static int AREA_MENORCA = 25;
|
413
|
private static int AREA_GREAT_BRITAIN = 26;
|
414
|
private static int AREA_BALTIC_STATES_ESTONIA_LATVIA_LITHUANIA_AND_KALININGRAD_REGION = 27;
|
415
|
private static int AREA_BULGARIA = 28;
|
416
|
private static int AREA_BELARUS = 29;
|
417
|
private static int AREA_CANARY_ISLANDS = 30;
|
418
|
private static int AREA_GRAN_CANARIA = 31;
|
419
|
private static int AREA_FUERTEVENTURA_WITH_LOBOS = 32;
|
420
|
private static int AREA_GOMERA = 33;
|
421
|
private static int AREA_HIERRO = 34;
|
422
|
private static int AREA_LANZAROTE_WITH_GRACIOSA = 35;
|
423
|
private static int AREA_LA_PALMA = 36;
|
424
|
private static int AREA_TENERIFE = 37;
|
425
|
private static int AREA_MONTENEGRO = 38;
|
426
|
private static int AREA_CORSE = 39;
|
427
|
private static int AREA_CRETE_WITH_KARPATHOS_KASOS_AND_GAVDHOS = 40;
|
428
|
private static int AREA_CZECH_REPUBLIC = 41;
|
429
|
private static int AREA_CROATIA = 42;
|
430
|
private static int AREA_CYPRUS = 43;
|
431
|
private static int AREA_FORMER_CZECHOSLOVAKIA = 44;
|
432
|
private static int AREA_DENMARK_WITH_BORNHOLM = 45;
|
433
|
private static int AREA_ESTONIA = 46;
|
434
|
private static int AREA_FAROE_ISLANDS = 47;
|
435
|
private static int AREA_FINLAND_WITH_AHVENANMAA = 48;
|
436
|
private static int AREA_FRANCE = 49;
|
437
|
private static int AREA_CHANNEL_ISLANDS = 50;
|
438
|
private static int AREA_FRENCH_MAINLAND = 51;
|
439
|
private static int AREA_MONACO = 52;
|
440
|
private static int AREA_GERMANY = 53;
|
441
|
private static int AREA_GREECE_WITH_CYCLADES_AND_MORE_ISLANDS = 54;
|
442
|
private static int AREA_IRELAND = 55;
|
443
|
private static int AREA_REPUBLIC_OF_IRELAND = 56;
|
444
|
private static int AREA_NORTHERN_IRELAND = 57;
|
445
|
private static int AREA_SWITZERLAND = 58;
|
446
|
private static int AREA_NETHERLANDS = 59;
|
447
|
private static int AREA_SPAIN = 60;
|
448
|
private static int AREA_ANDORRA = 61;
|
449
|
private static int AREA_GIBRALTAR = 62;
|
450
|
private static int AREA_KINGDOM_OF_SPAIN = 63;
|
451
|
private static int AREA_HUNGARY = 64;
|
452
|
private static int AREA_ICELAND = 65;
|
453
|
private static int AREA_ITALY = 66;
|
454
|
private static int AREA_ITALIAN_MAINLAND = 67;
|
455
|
private static int AREA_SAN_MARINO = 68;
|
456
|
private static int AREA_FORMER_JUGOSLAVIA = 69;
|
457
|
private static int AREA_LATVIA = 70;
|
458
|
private static int AREA_LITHUANIA = 71;
|
459
|
private static int AREA_PORTUGUESE_MAINLAND = 72;
|
460
|
private static int AREA_MADEIRA_ARCHIPELAGO = 73;
|
461
|
private static int AREA_DESERTAS = 74;
|
462
|
private static int AREA_MADEIRA = 75;
|
463
|
private static int AREA_PORTO_SANTO = 76;
|
464
|
private static int AREA_THE_FORMER_JUGOSLAV_REPUBLIC_OF_MAKEDONIJA = 77;
|
465
|
private static int AREA_MOLDOVA = 78;
|
466
|
private static int AREA_NORWEGIAN_MAINLAND = 79;
|
467
|
private static int AREA_POLAND = 80;
|
468
|
private static int AREA_THE_RUSSIAN_FEDERATION = 81;
|
469
|
private static int AREA_NOVAYA_ZEMLYA_AND_FRANZ_JOSEPH_LAND = 82;
|
470
|
private static int AREA_CENTRAL_EUROPEAN_RUSSIA = 83;
|
471
|
private static int AREA_EASTERN_EUROPEAN_RUSSIA = 84;
|
472
|
private static int AREA_KALININGRAD = 85;
|
473
|
private static int AREA_NORTHERN_EUROPEAN_RUSSIA = 86;
|
474
|
private static int AREA_NORTHWEST_EUROPEAN_RUSSIA = 87;
|
475
|
private static int AREA_SOUTH_EUROPEAN_RUSSIA = 88;
|
476
|
private static int AREA_ROMANIA = 89;
|
477
|
private static int AREA_FORMER_USSR = 90;
|
478
|
private static int AREA_RUSSIA_BALTIC = 91;
|
479
|
private static int AREA_RUSSIA_CENTRAL = 92;
|
480
|
private static int AREA_RUSSIA_SOUTHEAST = 93;
|
481
|
private static int AREA_RUSSIA_NORTHERN = 94;
|
482
|
private static int AREA_RUSSIA_SOUTHWEST = 95;
|
483
|
private static int AREA_SARDEGNA = 96;
|
484
|
private static int AREA_SVALBARD_WITH_BJORNOYA_AND_JAN_MAYEN = 97;
|
485
|
private static int AREA_SELVAGENS_ISLANDS = 98;
|
486
|
private static int AREA_SICILY_WITH_MALTA = 99;
|
487
|
private static int AREA_MALTA = 100;
|
488
|
private static int AREA_SICILY = 101;
|
489
|
private static int AREA_SLOVAKIA = 102;
|
490
|
private static int AREA_SLOVENIA = 103;
|
491
|
private static int AREA_SERBIA_WITH_MONTENEGRO = 104;
|
492
|
private static int AREA_SERBIA_INCLUDING_VOJVODINA_AND_WITH_KOSOVO = 105;
|
493
|
private static int AREA_SWEDEN = 106;
|
494
|
private static int AREA_EUROPEAN_TURKEY = 107;
|
495
|
private static int AREA_UKRAINE_INCLUDING_CRIMEA = 108;
|
496
|
private static int AREA_CRIMEA = 109;
|
497
|
private static int AREA_UKRAINE = 110;
|
498
|
private static int AREA_GREEK_MAINLAND = 111;
|
499
|
private static int AREA_CRETE = 112;
|
500
|
private static int AREA_DODECANESE_ISLANDS = 113;
|
501
|
private static int AREA_CYCLADES_ISLANDS = 114;
|
502
|
private static int AREA_NORTH_AEGEAN_ISLANDS = 115;
|
503
|
private static int AREA_VATICAN_CITY = 116;
|
504
|
private static int AREA_FRANZ_JOSEF_LAND = 117;
|
505
|
private static int AREA_NOVAYA_ZEMLYA = 118;
|
506
|
private static int AREA_AZERBAIJAN_INCLUDING_NAKHICHEVAN = 119;
|
507
|
private static int AREA_AZERBAIJAN = 120;
|
508
|
private static int AREA_NAKHICHEVAN = 121;
|
509
|
private static int AREA_ALGERIA = 122;
|
510
|
private static int AREA_ARMENIA = 123;
|
511
|
private static int AREA_CAUCASUS_REGION = 124;
|
512
|
private static int AREA_EGYPT = 125;
|
513
|
private static int AREA_GEORGIA = 126;
|
514
|
private static int AREA_ISRAEL_JORDAN = 127;
|
515
|
private static int AREA_ISRAEL = 128;
|
516
|
private static int AREA_JORDAN = 129;
|
517
|
private static int AREA_LEBANON = 130;
|
518
|
private static int AREA_LIBYA = 131;
|
519
|
private static int AREA_LEBANON_SYRIA = 132;
|
520
|
private static int AREA_MOROCCO = 133;
|
521
|
private static int AREA_NORTH_CAUCASUS = 134;
|
522
|
private static int AREA_SINAI = 135;
|
523
|
private static int AREA_SYRIA = 136;
|
524
|
private static int AREA_TUNISIA = 137;
|
525
|
private static int AREA_ASIATIC_TURKEY = 138;
|
526
|
private static int AREA_TURKEY = 139;
|
527
|
private static int AREA_NORTHERN_AFRICA = 140;
|
528
|
private static int AREA_AFRO_TROPICAL_REGION = 141;
|
529
|
private static int AREA_AUSTRALIAN_REGION = 142;
|
530
|
private static int AREA_EAST_PALAEARCTIC = 143;
|
531
|
private static int AREA_NEARCTIC_REGION = 144;
|
532
|
private static int AREA_NEOTROPICAL_REGION = 145;
|
533
|
private static int AREA_NEAR_EAST = 146;
|
534
|
private static int AREA_ORIENTAL_REGION = 147;
|
535
|
private static int AREA_EUROPEAN_MARINE_WATERS = 148;
|
536
|
private static int AREA_MEDITERRANEAN_SEA = 149;
|
537
|
private static int AREA_WHITE_SEA = 150;
|
538
|
private static int AREA_NORTH_SEA = 151;
|
539
|
private static int AREA_BALTIC_SEA = 152;
|
540
|
private static int AREA_BLACK_SEA = 153;
|
541
|
private static int AREA_BARENTSZ_SEA = 154;
|
542
|
private static int AREA_CASPIAN_SEA = 155;
|
543
|
private static int AREA_PORTUGUESE_EXCLUSIVE_ECONOMIC_ZONE = 156;
|
544
|
private static int AREA_BELGIAN_EXCLUSIVE_ECONOMIC_ZONE = 157;
|
545
|
private static int AREA_FRENCH_EXCLUSIVE_ECONOMIC_ZONE = 158;
|
546
|
private static int AREA_ENGLISH_CHANNEL = 159;
|
547
|
private static int AREA_ADRIATIC_SEA = 160;
|
548
|
private static int AREA_BISCAY_BAY = 161;
|
549
|
private static int AREA_DUTCH_EXCLUSIVE_ECONOMIC_ZONE = 162;
|
550
|
private static int AREA_UNITED_KINGDOM_EXCLUSIVE_ECONOMIC_ZONE = 163;
|
551
|
private static int AREA_SPANISH_EXCLUSIVE_ECONOMIC_ZONE = 164;
|
552
|
private static int AREA_EGYPTIAN_EXCLUSIVE_ECONOMIC_ZONE = 165;
|
553
|
private static int AREA_GREEK_EXCLUSIVE_ECONOMIC_ZONE = 166;
|
554
|
private static int AREA_TIRRENO_SEA = 167;
|
555
|
private static int AREA_ICELANDIC_EXCLUSIVE_ECONOMIC_ZONE = 168;
|
556
|
private static int AREA_IRISH_EXCLUSIVE_ECONOMIC_ZONE = 169;
|
557
|
private static int AREA_IRISH_SEA = 170;
|
558
|
private static int AREA_ITALIAN_EXCLUSIVE_ECONOMIC_ZONE = 171;
|
559
|
private static int AREA_NORWEGIAN_SEA = 172;
|
560
|
private static int AREA_MOROCCAN_EXCLUSIVE_ECONOMIC_ZONE = 173;
|
561
|
private static int AREA_NORWEGIAN_EXCLUSIVE_ECONOMIC_ZONE = 174;
|
562
|
private static int AREA_SKAGERRAK = 175;
|
563
|
private static int AREA_TUNISIAN_EXCLUSIVE_ECONOMIC_ZONE = 176;
|
564
|
private static int AREA_WADDEN_SEA = 177;
|
565
|
private static int AREA_BELT_SEA = 178;
|
566
|
private static int AREA_MARMARA_SEA = 179;
|
567
|
private static int AREA_SEA_OF_AZOV = 180;
|
568
|
private static int AREA_AEGEAN_SEA = 181;
|
569
|
private static int AREA_BULGARIAN_EXCLUSIVE_ECONOMIC_ZONE = 182;
|
570
|
private static int AREA_SOUTH_BALTIC_PROPER = 183;
|
571
|
private static int AREA_BALTIC_PROPER = 184;
|
572
|
private static int AREA_NORTH_BALTIC_PROPER = 185;
|
573
|
private static int AREA_ARCHIPELAGO_SEA = 186;
|
574
|
private static int AREA_BOTHNIAN_SEA = 187;
|
575
|
private static int AREA_GERMAN_EXCLUSIVE_ECONOMIC_ZONE = 188;
|
576
|
private static int AREA_SWEDISH_EXCLUSIVE_ECONOMIC_ZONE = 189;
|
577
|
private static int AREA_UKRAINIAN_EXCLUSIVE_ECONOMIC_ZONE = 190;
|
578
|
private static int AREA_MADEIRAN_EXCLUSIVE_ECONOMIC_ZONE = 191;
|
579
|
private static int AREA_LEBANESE_EXCLUSIVE_ECONOMIC_ZONE = 192;
|
580
|
private static int AREA_SPANISH_EXCLUSIVE_ECONOMIC_ZONE_MEDITERRANEAN_PART = 193;
|
581
|
private static int AREA_ESTONIAN_EXCLUSIVE_ECONOMIC_ZONE = 194;
|
582
|
private static int AREA_CROATIAN_EXCLUSIVE_ECONOMIC_ZONE = 195;
|
583
|
private static int AREA_BALEAR_SEA = 196;
|
584
|
private static int AREA_TURKISH_EXCLUSIVE_ECONOMIC_ZONE = 197;
|
585
|
private static int AREA_DANISH_EXCLUSIVE_ECONOMIC_ZONE = 198;
|
586
|
private static int AREA_TRANSCAUCASUS = 199;
|
587
|
|
588
|
private static int AREA_GEORGIA_G = 200;
|
589
|
private static int AREA_ABKHAZIA = 201;
|
590
|
private static int AREA_ADZARIA = 202;
|
591
|
|
592
|
private static int AREA_UNITED_KINGDOM = 203;
|
593
|
private static int AREA_DENMARK_COUNTRY = 204;
|
594
|
private static int AREA_TURKEY_COUNTRY = 205;
|
595
|
private static int AREA_SPAIN_COUNTRY = 206;
|
596
|
private static int AREA_GREECE_COUNTRY = 207;
|
597
|
private static int AREA_PORTUGAL_COUNTRY = 208;
|
598
|
//continued ERMS areas without variables
|
599
|
//...
|
600
|
private static int AREA_WALES = 293;
|
601
|
|
602
|
//new E+M areas
|
603
|
private static int AREA_SERBIA = 294;
|
604
|
private static int AREA_KOSOVO = 295;
|
605
|
|
606
|
|
607
|
//FauEu area UUIDs
|
608
|
private static UUID uuidAreaAD = UUID.fromString("38dd31d2-8275-4b05-8b85-eb71a390d67f");
|
609
|
private static UUID uuidAreaAFR = UUID.fromString("c3123386-51a4-42a4-9ff4-b3905b18a83c");//x
|
610
|
private static UUID uuidAreaAL = UUID.fromString("84c54f15-fc90-44bb-a45d-26b7daa26ceb");
|
611
|
private static UUID uuidAreaAT = UUID.fromString("d285e4a5-d027-4610-a4ff-f5e6dd16cdc3");
|
612
|
private static UUID uuidAreaAUS = UUID.fromString("930e6455-de5e-4002-bfc3-45eecd07e4f3");//x
|
613
|
private static UUID uuidAreaBA = UUID.fromString("946a06ea-200f-409e-bb2f-05e64e55ed41");
|
614
|
private static UUID uuidAreaBE = UUID.fromString("f914f7fd-d5a3-4165-8409-004f197ae4e9");
|
615
|
private static UUID uuidAreaBG = UUID.fromString("9586daca-a739-4d28-836e-6d15861375e1");
|
616
|
private static UUID uuidAreaBY = UUID.fromString("b6f94a56-990d-41da-8e92-abf757afeca1");
|
617
|
private static UUID uuidAreaCH = UUID.fromString("cccc1da5-6a0e-47c2-900e-e274fd593ff0");
|
618
|
private static UUID uuidAreaCY = UUID.fromString("78950366-3f15-48bb-80c9-8b24afedcd3c");
|
619
|
private static UUID uuidAreaCZ = UUID.fromString("d1221dbc-a7c5-4805-b7c8-15ae56557825");
|
620
|
private static UUID uuidAreaDE = UUID.fromString("6f31223e-9a10-4c97-b482-85d96f195a23");
|
621
|
private static UUID uuidAreaDK_DEN = UUID.fromString("4ed51fa9-f89a-47c8-a9ce-43d462f74c53");
|
622
|
private static UUID uuidAreaDK_FOR = UUID.fromString("272874cf-b6f7-4805-8a0c-1a0efbbf0a21");
|
623
|
private static UUID uuidAreaEE = UUID.fromString("1472705d-c94e-41e8-9482-adb46f201f71");
|
624
|
private static UUID uuidAreaEPA = UUID.fromString("2f162235-6c5a-4ad4-8ba0-8dca28826dab");//x
|
625
|
private static UUID uuidAreaES_BAL = UUID.fromString("d5466ee2-38fa-47e8-8109-008b71a2f47b");
|
626
|
private static UUID uuidAreaES_CNY = UUID.fromString("1f19cdaa-af1e-406c-bb58-25f17ee00228");
|
627
|
private static UUID uuidAreaES_SPA = UUID.fromString("d3cc7b05-b506-44b7-a49a-77d36974bd5f");
|
628
|
private static UUID uuidAreaFI = UUID.fromString("93d6e2ba-308b-4d57-851c-94583e139806");
|
629
|
private static UUID uuidAreaFR_COR = UUID.fromString("f7088b27-805f-46df-916f-eeed47a2e336");
|
630
|
private static UUID uuidAreaFR_FRA = UUID.fromString("83d2df98-c0b4-4ad8-9a02-7cdfcfa74371");
|
631
|
private static UUID uuidAreaGB_CI = UUID.fromString("a97807d0-e7e2-4ee0-8567-07f3a72d91bb");
|
632
|
private static UUID uuidAreaGB_GI = UUID.fromString("4441b42a-7c9f-4a39-89d6-5c9c9dab9c05");
|
633
|
private static UUID uuidAreaGB_GRB = UUID.fromString("94561875-19a6-4bf4-ade7-340c245ffd67");
|
634
|
private static UUID uuidAreaGB_NI = UUID.fromString("791be300-6e86-4253-b1ba-aef46ea6bfb9");
|
635
|
private static UUID uuidAreaGR_AEG = UUID.fromString("efb2f01a-f01e-4da2-ba02-464b0e1687e5");//x
|
636
|
private static UUID uuidAreaGR_CYC = UUID.fromString("f9ad21b1-c9ed-4062-9086-cba6e6ef353b");//x
|
637
|
private static UUID uuidAreaGR_DOD = UUID.fromString("7a84feae-9d93-4408-8122-e82b9485fc0f");//x
|
638
|
private static UUID uuidAreaGR_GRC = UUID.fromString("a392dbac-8671-40e6-95c7-a0d2db8f7d9c");//x
|
639
|
private static UUID uuidAreaGR_KRI = UUID.fromString("ed8e7bcd-2267-4953-b422-bc2ff45238f7");//x
|
640
|
private static UUID uuidAreaHR = UUID.fromString("83323e5b-8a62-4784-956a-5f21ddc853b9");
|
641
|
private static UUID uuidAreaHU = UUID.fromString("ab6985e7-e718-4bcb-bc84-55e563870998");
|
642
|
private static UUID uuidAreaIE = UUID.fromString("6a623016-2cd7-4391-8bc9-ae8af50060b4");
|
643
|
private static UUID uuidAreaIS = UUID.fromString("b8469350-7c87-4202-9cb1-5f0ad11ec89c");
|
644
|
private static UUID uuidAreaIT_ITA = UUID.fromString("43df04d6-90b4-4cf4-8dfc-f60ae921f92c");
|
645
|
private static UUID uuidAreaIT_SAR = UUID.fromString("f68d9695-238d-4684-901a-f4bbc24813ee");
|
646
|
private static UUID uuidAreaIT_SI = UUID.fromString("1889a571-d12a-48f1-a49f-112e60c699ef");
|
647
|
private static UUID uuidAreaLI = UUID.fromString("ebad24b5-559e-46c4-8b0d-87107e05169e");
|
648
|
private static UUID uuidAreaLT = UUID.fromString("d00df2a8-8d5d-4c36-b3a2-4afc9006be70");
|
649
|
private static UUID uuidAreaLU = UUID.fromString("65bbbb63-3351-4fda-a8f8-50557bc34e0d");
|
650
|
private static UUID uuidAreaLV = UUID.fromString("997d97ea-4678-4e01-9a81-518c09da7d7c");
|
651
|
private static UUID uuidAreaMC = UUID.fromString("0debabad-e7e2-4aad-b959-876d3d85a4b1");
|
652
|
private static UUID uuidAreaMD = UUID.fromString("7a4ffe59-f8d6-4a58-bb4e-449fbe8420b3");
|
653
|
private static UUID uuidAreaMK = UUID.fromString("40140714-6214-4338-bc45-f85455f7eaed");
|
654
|
private static UUID uuidAreaMT = UUID.fromString("b36c2f47-47d5-497f-9235-2faf0d9a6e6c");
|
655
|
private static UUID uuidAreaNAF = UUID.fromString("e3b2193d-e23a-47a7-9bf5-7f7eebe61afb");//x
|
656
|
private static UUID uuidAreaNEA = UUID.fromString("d6082e94-7289-45a3-a298-5cb730cfbd7f");//x
|
657
|
private static UUID uuidAreaNEO = UUID.fromString("7a530ae7-d070-49aa-8496-7b06c4ed735b");//x
|
658
|
private static UUID uuidAreaNL = UUID.fromString("7b74033f-ada3-4956-87b7-ec9bf0cb4c76");
|
659
|
private static UUID uuidAreaNO_NOR = UUID.fromString("11b26fc9-3da4-4323-8b03-e960e8b1c914");
|
660
|
private static UUID uuidAreaNO_SVA = UUID.fromString("9a3fe056-2011-4b02-a416-59de00eaf533");
|
661
|
private static UUID uuidAreaNRE = UUID.fromString("5e005e59-b313-4c5b-8702-c2f88317db25");//x
|
662
|
private static UUID uuidAreaORR = UUID.fromString("2047d0dd-12dc-4454-8344-07ad52fa0af0");//x
|
663
|
private static UUID uuidAreaPL = UUID.fromString("68edc557-dbed-494e-9549-6746f11fb904");
|
664
|
private static UUID uuidAreaPT_AZO = UUID.fromString("6f5e4eb5-83c8-4baf-99f2-cb6e25d8ac9d");
|
665
|
private static UUID uuidAreaPT_MDR = UUID.fromString("97bed937-f4ad-4b42-ba0c-8832816fa234");
|
666
|
private static UUID uuidAreaPT_POR = UUID.fromString("09107b85-2bdb-4534-a51c-8d02cdd71590");
|
667
|
private static UUID uuidAreaPT_SEL = UUID.fromString("e067287c-50c6-4e54-9859-91aa15aa289a");
|
668
|
private static UUID uuidAreaRO = UUID.fromString("de3e2ca8-d2ea-4c1f-8a19-a7a0b5daf39d");
|
669
|
private static UUID uuidAreaRU_FJL = UUID.fromString("2b79434b-df7d-4dc5-996f-1ca4227f6e0e");//x
|
670
|
private static UUID uuidAreaRU_KGD = UUID.fromString("227a661b-91de-489c-88ed-6b72f78481f0");
|
671
|
private static UUID uuidAreaRU_NOZ = UUID.fromString("2b26f68a-fdac-41ab-bce0-105b24d7eb26");//x
|
672
|
private static UUID uuidAreaRU_RUC = UUID.fromString("235748eb-9eef-48a8-9b9a-c4abd00b6244");
|
673
|
private static UUID uuidAreaRU_RUE = UUID.fromString("5ad5b07e-518f-44ee-ac96-c7608d93e757");
|
674
|
private static UUID uuidAreaRU_RUN = UUID.fromString("05d35653-9f67-442c-8d99-4a7ae68cf5d1");
|
675
|
private static UUID uuidAreaRU_RUS = UUID.fromString("98b00cf8-7bd6-4f44-885c-0927bbc1d456");
|
676
|
private static UUID uuidAreaRU_RUW = UUID.fromString("ae84bc08-957a-4c62-a828-1fb3fc2f0c3e");
|
677
|
private static UUID uuidAreaSE = UUID.fromString("8ff37027-4832-4ce1-9f25-e21eaf26299c");
|
678
|
private static UUID uuidAreaSI = UUID.fromString("0b76b448-5564-415c-bc18-727c37e62bf1");
|
679
|
private static UUID uuidAreaSK = UUID.fromString("e966cd7c-3e68-4153-887b-54920eb6eb47");
|
680
|
private static UUID uuidAreaSM = UUID.fromString("c40b8a71-c50c-4636-96de-be0bb48ed025");
|
681
|
private static UUID uuidAreaTR_TUE = UUID.fromString("807317b3-746b-4916-9441-d8086d0d1cb1");
|
682
|
private static UUID uuidAreaUA = UUID.fromString("2f80440d-cb03-499c-a829-c4ac4c6608d3");//x
|
683
|
private static UUID uuidAreaVA = UUID.fromString("cd256143-1b74-4a7d-998f-ba0a9c01bb3e");
|
684
|
private static UUID uuidAreaYU = UUID.fromString("cd80a852-1993-465a-b0e3-8c73218d4d90");
|
685
|
|
686
|
|
687
|
// OccurrenceStatus
|
688
|
private static int STATUS_PRESENT = 1;
|
689
|
public static int STATUS_ABSENT = 2;
|
690
|
public static int STATUS_NATIVE = 3;
|
691
|
public static int STATUS_INTRODUCED = 4;
|
692
|
public static int STATUS_NATURALISED = 5;
|
693
|
private static int STATUS_INVASIVE = 6;
|
694
|
public static int STATUS_MANAGED = 7;
|
695
|
public static int STATUS_DOUBTFUL = 8;
|
696
|
|
697
|
private final Map<String, Integer> tdwgKeyMap = new HashMap<>();
|
698
|
private final Map<Integer, String> areaCacheMap = new HashMap<>();
|
699
|
private final Map<Integer, String> languageCacheMap = new HashMap<>();
|
700
|
private static final Map<String,Integer> languageCodeToKeyMap = new HashMap<>();
|
701
|
|
702
|
private final Map<Integer, String> featureCacheMap = new HashMap<>();
|
703
|
private final Map<Integer, String> nameStatusCacheMap = new HashMap<>();
|
704
|
private final Map<Integer, String> qualityStatusCacheMap = new HashMap<>();
|
705
|
private final Map<Integer, String> taxonStatusCacheMap = new HashMap<>();
|
706
|
private final Map<Integer, String> taxRelQualifierCacheMap = new HashMap<>();
|
707
|
private final Map<Integer, String> taxRelZooQualifierCacheMap = new HashMap<>();
|
708
|
private final Map<Integer, String> sourceUseCacheMap = new HashMap<>();
|
709
|
private final Map<Integer, String> fossilStatusCacheMap = new HashMap<>();
|
710
|
private final Map<Integer, String> typeDesigStatusCacheMap = new HashMap<>();
|
711
|
private final Map<Integer, String> sourceCategoryCacheMap = new HashMap<>();
|
712
|
private final Map<Integer, String> occurrenceStatusCacheMap = new HashMap<>();
|
713
|
private final Map<Integer, Map<Integer, String>> rankCacheMap = new HashMap<>();
|
714
|
private final Map<Integer, Map<Integer, String>> rankAbbrevCacheMap = new HashMap<>();
|
715
|
|
716
|
|
717
|
private final Source destination;
|
718
|
|
719
|
public PesiTransformer(Source destination) {
|
720
|
super();
|
721
|
this.destination = destination;
|
722
|
fillMaps();
|
723
|
}
|
724
|
|
725
|
private void fillMaps() {
|
726
|
try {
|
727
|
//TDWG
|
728
|
String sql = " SELECT AreaId, AreaName, AreaTdwgCode, AreaEmCode, AreaFaEuCode FROM Area";
|
729
|
ResultSet rs = destination.getResultSet(sql);
|
730
|
while (rs.next()){
|
731
|
String tdwg = rs.getString("AreaTdwgCode");
|
732
|
Integer id = rs.getInt("AreaId");
|
733
|
String label = rs.getString("AreaName");
|
734
|
|
735
|
if (StringUtils.isNotBlank(tdwg)){
|
736
|
this.tdwgKeyMap.put(tdwg, id);
|
737
|
}
|
738
|
this.areaCacheMap.put(id, label);
|
739
|
}
|
740
|
|
741
|
//rankCache
|
742
|
sql = " SELECT KingdomId, RankId, Rank, RankAbbrev, Kingdom FROM Rank";
|
743
|
rs = destination.getResultSet(sql);
|
744
|
while (rs.next()){
|
745
|
String rank = rs.getString("Rank");
|
746
|
String abbrev = rs.getString("RankAbbrev");
|
747
|
Integer rankId = rs.getInt("RankId");
|
748
|
Integer kingdomId = rs.getInt("KingdomId");
|
749
|
String kingdom = rs.getString("Kingdom");
|
750
|
|
751
|
//rank str
|
752
|
Map<Integer, String> kingdomMap = rankCacheMap.get(kingdomId);
|
753
|
if (kingdomMap == null){
|
754
|
kingdomMap = new HashMap<>();
|
755
|
rankCacheMap.put(kingdomId, kingdomMap);
|
756
|
}
|
757
|
kingdomMap.put(rankId, rank);
|
758
|
|
759
|
if (rank.equals("Kingdom")){
|
760
|
pesiKingdomMap.put(kingdom, kingdomId);
|
761
|
}
|
762
|
|
763
|
//rank abbrev
|
764
|
Map<Integer, String> kingdomAbbrevMap = rankAbbrevCacheMap.get(kingdomId);
|
765
|
if (kingdomAbbrevMap == null){
|
766
|
kingdomAbbrevMap = new HashMap<>();
|
767
|
rankAbbrevCacheMap.put(kingdomId, kingdomAbbrevMap);
|
768
|
}
|
769
|
if (StringUtils.isNotBlank(abbrev)){
|
770
|
kingdomAbbrevMap.put(rankId, abbrev);
|
771
|
}
|
772
|
}
|
773
|
|
774
|
//languageCache
|
775
|
fillSingleMap(languageCacheMap, "Language");
|
776
|
|
777
|
//feature / note category
|
778
|
fillSingleMap(featureCacheMap, "NoteCategory");
|
779
|
|
780
|
//nameStatusCache
|
781
|
fillSingleMap(nameStatusCacheMap, "NameStatus", "NomStatus");
|
782
|
|
783
|
//qualityStatusCache
|
784
|
fillSingleMap(qualityStatusCacheMap, "QualityStatus");
|
785
|
|
786
|
//taxonStatusCache
|
787
|
fillSingleMap(taxonStatusCacheMap, "TaxonStatus", "Status");
|
788
|
|
789
|
//sourceUse
|
790
|
fillSingleMap(sourceUseCacheMap, "SourceUse");
|
791
|
|
792
|
//fossil status
|
793
|
fillSingleMap(fossilStatusCacheMap, "FossilStatus");
|
794
|
|
795
|
//fossil status
|
796
|
fillSingleMap(typeDesigStatusCacheMap, "FossilStatus");
|
797
|
|
798
|
//fossil status
|
799
|
fillSingleMap(occurrenceStatusCacheMap, "OccurrenceStatus");
|
800
|
|
801
|
//source category
|
802
|
fillSingleMap(sourceCategoryCacheMap, "SourceCategory", "Category", "SourceCategoryId");
|
803
|
|
804
|
//RelTaxonQualifier
|
805
|
sql = " SELECT QualifierId, Qualifier, ZoologQualifier FROM RelTaxonQualifier ";
|
806
|
rs = destination.getResultSet(sql);
|
807
|
while (rs.next()){
|
808
|
Integer key = rs.getInt("QualifierId");
|
809
|
String cache = rs.getString("Qualifier");
|
810
|
if (StringUtils.isNotBlank(cache)){
|
811
|
this.taxRelQualifierCacheMap.put(key, cache);
|
812
|
}
|
813
|
String zoologCache = rs.getString("ZoologQualifier");
|
814
|
if (StringUtils.isNotBlank(zoologCache)){
|
815
|
this.taxRelZooQualifierCacheMap.put(key, zoologCache);
|
816
|
}
|
817
|
}
|
818
|
|
819
|
//language code map
|
820
|
sql = " SELECT LanguageId, Language, ISO639_1, ISO639_2, ISO639_3 FROM Language";
|
821
|
rs = destination.getResultSet(sql);
|
822
|
while (rs.next()){
|
823
|
Integer id = rs.getInt("LanguageId");
|
824
|
Integer oldId;
|
825
|
String iso639_1 = rs.getString("ISO639_1");
|
826
|
if (StringUtils.isNotBlank(iso639_1)){
|
827
|
oldId = languageCodeToKeyMap.put(iso639_1, id);
|
828
|
checkOldId(id, oldId, iso639_1);
|
829
|
}
|
830
|
String iso639_2 = rs.getString("ISO639_2");
|
831
|
if (StringUtils.isNotBlank(iso639_2)){
|
832
|
oldId = languageCodeToKeyMap.put(iso639_2, id);
|
833
|
checkOldId(id, oldId, iso639_1);
|
834
|
}
|
835
|
String iso639_3 = rs.getString("ISO639_3");
|
836
|
if (StringUtils.isNotBlank(iso639_3)){
|
837
|
oldId = languageCodeToKeyMap.put(iso639_3, id);
|
838
|
checkOldId(id, oldId, iso639_1);
|
839
|
}
|
840
|
|
841
|
}
|
842
|
rs = null;
|
843
|
} catch (Exception e) {
|
844
|
logger.error("Exception when trying to read area map", e);
|
845
|
e.printStackTrace();
|
846
|
}
|
847
|
}
|
848
|
|
849
|
private void checkOldId(Integer id, Integer oldId, String isoCode) {
|
850
|
if (oldId != null && !oldId.equals(id)){
|
851
|
logger.warn("Language code " + isoCode + " exists for >1 language IDs. This should not happen.");
|
852
|
}
|
853
|
}
|
854
|
|
855
|
private void fillSingleMap(Map<Integer, String> map, String tableName) throws SQLException {
|
856
|
fillSingleMap(map, tableName, tableName, tableName + "Id");
|
857
|
}
|
858
|
|
859
|
private void fillSingleMap(Map<Integer, String> map, String tableName, String attr) throws SQLException {
|
860
|
fillSingleMap(map, tableName, attr, attr + "Id");
|
861
|
}
|
862
|
|
863
|
private void fillSingleMap(Map<Integer, String> map, String tableName, String attr, String idAttr) throws SQLException {
|
864
|
String sql;
|
865
|
ResultSet rs;
|
866
|
sql = " SELECT %s, %s FROM %s ";
|
867
|
sql = String.format(sql, idAttr, attr, tableName);
|
868
|
rs = destination.getResultSet(sql);
|
869
|
while (rs.next()){
|
870
|
Integer key = rs.getInt(idAttr);
|
871
|
String cache = rs.getString(attr);
|
872
|
if (StringUtils.isNotBlank(cache)){
|
873
|
map.put(key, cache);
|
874
|
}
|
875
|
}
|
876
|
}
|
877
|
|
878
|
/**
|
879
|
* Converts the databaseString to its abbreviation if its known.
|
880
|
* Otherwise the databaseString is returned.
|
881
|
* @param databaseString
|
882
|
* @return
|
883
|
*/
|
884
|
public static String databaseString2Abbreviation(String databaseString) {
|
885
|
String result = databaseString;
|
886
|
if (databaseString.equals("Fauna Europaea database")) {
|
887
|
result = "FaEu";
|
888
|
}
|
889
|
return result;
|
890
|
}
|
891
|
|
892
|
/**
|
893
|
* Returns the OccurrenceStatusId for a given PresenceAbsenceTerm.
|
894
|
* @param term
|
895
|
* @return
|
896
|
* @throws UnknownCdmTypeException
|
897
|
*/
|
898
|
public static Integer presenceAbsenceTerm2OccurrenceStatusId(PresenceAbsenceTerm term) {
|
899
|
Integer result = null;
|
900
|
if (term == null){
|
901
|
return null;
|
902
|
//present
|
903
|
}else if (term.isInstanceOf(PresenceAbsenceTerm.class)) {
|
904
|
PresenceAbsenceTerm presenceTerm = CdmBase.deproxy(term, PresenceAbsenceTerm.class);
|
905
|
if (presenceTerm.equals(PresenceAbsenceTerm.PRESENT()) ||
|
906
|
presenceTerm.equals(PresenceAbsenceTerm.INTRODUCED_DOUBTFULLY_INTRODUCED()) ||
|
907
|
presenceTerm.equals(PresenceAbsenceTerm.NATIVE_DOUBTFULLY_NATIVE())) {
|
908
|
result = STATUS_PRESENT;
|
909
|
} else if (presenceTerm.equals(PresenceAbsenceTerm.NATIVE())) {
|
910
|
result = STATUS_NATIVE;
|
911
|
} else if (presenceTerm.equals(PresenceAbsenceTerm.INTRODUCED()) ||
|
912
|
presenceTerm.equals(PresenceAbsenceTerm.CASUAL()) ||
|
913
|
presenceTerm.equals(PresenceAbsenceTerm.INTRODUCED_UNCERTAIN_DEGREE_OF_NATURALISATION())) {
|
914
|
result = STATUS_INTRODUCED;
|
915
|
} else if (presenceTerm.equals(PresenceAbsenceTerm.NATURALISED())
|
916
|
|| presenceTerm.equals(PresenceAbsenceTerm.NATURALISED())) {
|
917
|
result = STATUS_NATURALISED;
|
918
|
} else if (presenceTerm.equals(PresenceAbsenceTerm.INVASIVE())) {
|
919
|
result = STATUS_INVASIVE;
|
920
|
} else if (presenceTerm.equals(PresenceAbsenceTerm.CULTIVATED())) {
|
921
|
result = STATUS_MANAGED;
|
922
|
} else if (presenceTerm.equals(PresenceAbsenceTerm.PRESENT_DOUBTFULLY())||
|
923
|
presenceTerm.equals(PresenceAbsenceTerm.INTRODUCED_PRESENCE_QUESTIONABLE()) ||
|
924
|
presenceTerm.equals(PresenceAbsenceTerm.NATIVE_PRESENCE_QUESTIONABLE() )) {
|
925
|
result = STATUS_DOUBTFUL;
|
926
|
//absent
|
927
|
}else if (presenceTerm.equals(PresenceAbsenceTerm.ABSENT()) || presenceTerm.equals(PresenceAbsenceTerm.NATIVE_FORMERLY_NATIVE()) ||
|
928
|
presenceTerm.equals(PresenceAbsenceTerm.CULTIVATED_REPORTED_IN_ERROR()) || presenceTerm.equals(PresenceAbsenceTerm.INTRODUCED_REPORTED_IN_ERROR()) ||
|
929
|
presenceTerm.equals(PresenceAbsenceTerm.INTRODUCED_FORMERLY_INTRODUCED()) || presenceTerm.equals(PresenceAbsenceTerm.NATIVE_REPORTED_IN_ERROR() ) ) {
|
930
|
result = STATUS_ABSENT;
|
931
|
} else {
|
932
|
logger.error("PresenceAbsenceTerm could not be translated to datawarehouse occurrence status id: " + presenceTerm.getLabel());
|
933
|
}
|
934
|
}
|
935
|
return result;
|
936
|
}
|
937
|
|
938
|
@Override
|
939
|
public String getCacheByPresenceAbsenceTerm(PresenceAbsenceTerm status) throws UndefinedTransformerMethodException {
|
940
|
if (status == null){
|
941
|
return null;
|
942
|
}else{
|
943
|
return this.occurrenceStatusCacheMap.get(getKeyByPresenceAbsenceTerm(status));
|
944
|
}
|
945
|
}
|
946
|
|
947
|
@Override
|
948
|
public Object getKeyByPresenceAbsenceTerm(PresenceAbsenceTerm status) throws UndefinedTransformerMethodException {
|
949
|
return presenceAbsenceTerm2OccurrenceStatusId(status);
|
950
|
}
|
951
|
|
952
|
@Override
|
953
|
public String getCacheByNamedArea(NamedArea namedArea) throws UndefinedTransformerMethodException {
|
954
|
NamedArea area = CdmBase.deproxy(namedArea);
|
955
|
if (area == null){
|
956
|
return null;
|
957
|
}else{
|
958
|
return this.areaCacheMap.get(getKeyByNamedArea(area));
|
959
|
}
|
960
|
}
|
961
|
|
962
|
@Override
|
963
|
public Object getKeyByNamedArea(NamedArea area) throws UndefinedTransformerMethodException {
|
964
|
NamedArea namedArea = CdmBase.deproxy(area);
|
965
|
|
966
|
if (area == null) {
|
967
|
return null;
|
968
|
//TDWG areas
|
969
|
} else if (area.getVocabulary().getUuid().equals(NamedArea.uuidTdwgAreaVocabulary)) {
|
970
|
String abbrevLabel = namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel();
|
971
|
Integer result = this.tdwgKeyMap.get(abbrevLabel);
|
972
|
if (result == null){
|
973
|
logger.warn("Unknown TDWGArea: " + area.getTitleCache());
|
974
|
}
|
975
|
return result;
|
976
|
//countries
|
977
|
}else if (namedArea.isInstanceOf(Country.class)){
|
978
|
if (namedArea.equals(Country.UKRAINE())) { return AREA_UKRAINE_INCLUDING_CRIMEA; }
|
979
|
else if (namedArea.equals(Country.AZERBAIJANREPUBLICOF())) { return AREA_AZERBAIJAN_INCLUDING_NAKHICHEVAN; }
|
980
|
else if (namedArea.equals(Country.GEORGIA())) { return AREA_GEORGIA; }
|
981
|
else if (namedArea.equals(Country.RUSSIANFEDERATION())) { return AREA_THE_RUSSIAN_FEDERATION; }
|
982
|
else if (namedArea.equals(Country.UNITEDKINGDOMOFGREATBRITAINANDNORTHERNIRELAND())) { return AREA_UNITED_KINGDOM; }
|
983
|
else if (namedArea.equals(Country.DENMARKKINGDOMOF())) { return AREA_DENMARK_COUNTRY; }
|
984
|
else if (namedArea.equals(Country.TURKEYREPUBLICOF())) { return AREA_TURKEY_COUNTRY; }
|
985
|
else {
|
986
|
logger.warn("Unknown Country: " + area.getTitleCache());
|
987
|
}
|
988
|
|
989
|
}else if (area.getVocabulary().getUuid().equals(BerlinModelTransformer.uuidVocEuroMedAreas)){
|
990
|
if (namedArea.getUuid().equals(BerlinModelTransformer.uuidEM)) {
|
991
|
// logger.warn("E+M area not available in PESI");
|
992
|
return null;
|
993
|
}
|
994
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidEUR)) { logger.warn("EUR area not available in PESI"); return null; }
|
995
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidAb)) { return AREA_AZERBAIJAN_INCLUDING_NAKHICHEVAN; }
|
996
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidAb_A)) { return AREA_AZERBAIJAN; }
|
997
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidAb_N)) { return AREA_NAKHICHEVAN; }
|
998
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidAE)) { return AREA_EAST_AEGEAN_ISLANDS; }
|
999
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidAE_G)) { return AREA_GREEK_EAST_AEGEAN_ISLANDS; }
|
1000
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidAE_T)) { return AREA_TURKISH_EAST_AEGEAN_ISLANDS; }
|
1001
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidAg)) { return AREA_ALGERIA; }
|
1002
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidAl)) { return AREA_ALBANIA; }
|
1003
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidAr)) { return AREA_ARMENIA; }
|
1004
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidAu)) { return AREA_AUSTRIA_WITH_LIECHTENSTEIN; }
|
1005
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidAu_A)) { return AREA_AUSTRIA; }
|
1006
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidAu_L)) { return AREA_LIECHTENSTEIN; }
|
1007
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidAz)) { return AREA_AZORES; }
|
1008
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidAz_C)) { return AREA_CORVO; }
|
1009
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidAz_F)) { return AREA_FAIAL; }
|
1010
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidAz_G)) { return AREA_GRACIOSA; }
|
1011
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidAz_J)) { return AREA_SAO_JORGE; }
|
1012
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidAz_L)) { return AREA_FLORES; }
|
1013
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidAz_M)) { return AREA_SAO_MIGUEL; }
|
1014
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidAz_P)) { return AREA_PICO; }
|
1015
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidAz_S)) { return AREA_SANTA_MARIA; }
|
1016
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidAz_T)) { return AREA_TERCEIRA; }
|
1017
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidBe)) { return AREA_BELGIUM_WITH_LUXEMBOURG; }
|
1018
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidBe_B)) { return AREA_BELGIUM; }
|
1019
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidBe_L)) { return AREA_LUXEMBOURG; }
|
1020
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidBH)) { return AREA_BOSNIA_HERZEGOVINA; }
|
1021
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidBl)) { return AREA_BALEARES; }
|
1022
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidBl_I)) { return AREA_IBIZA_WITH_FORMENTERA; }
|
1023
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidBl_M)) { return AREA_MALLORCA; }
|
1024
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidBl_N)) { return AREA_MENORCA; }
|
1025
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidBr)) { return AREA_GREAT_BRITAIN; }
|
1026
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidBt)) { return AREA_BALTIC_STATES_ESTONIA_LATVIA_LITHUANIA_AND_KALININGRAD_REGION; }
|
1027
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidBu)) { return AREA_BULGARIA; }
|
1028
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidBy)) { return AREA_BELARUS; }
|
1029
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidCa)) { return AREA_CANARY_ISLANDS; }
|
1030
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidCa_C)) { return AREA_GRAN_CANARIA; }
|
1031
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidCa_F)) { return AREA_FUERTEVENTURA_WITH_LOBOS; }
|
1032
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidCa_G)) { return AREA_GOMERA; }
|
1033
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidCa_H)) { return AREA_HIERRO; }
|
1034
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidCa_L)) { return AREA_LANZAROTE_WITH_GRACIOSA; }
|
1035
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidCa_P)) { return AREA_LA_PALMA; }
|
1036
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidCa_T)) { return AREA_TENERIFE; }
|
1037
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidCc)) { return AREA_CAUCASUS_REGION; }
|
1038
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidCg)) { return AREA_MONTENEGRO; }
|
1039
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidCo)) { return AREA_CORSE; }
|
1040
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidCr)) { return AREA_CRETE_WITH_KARPATHOS_KASOS_AND_GAVDHOS; }
|
1041
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidCs)) { return AREA_CZECH_REPUBLIC; }
|
1042
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidCt)) { return AREA_CROATIA; }
|
1043
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidCy)) { return AREA_CYPRUS; }
|
1044
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidCz)) { return AREA_FORMER_CZECHOSLOVAKIA; }
|
1045
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidDa)) { return AREA_DENMARK_WITH_BORNHOLM; }
|
1046
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidEg)) { return AREA_EGYPT; }
|
1047
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidEs)) { return AREA_ESTONIA; }
|
1048
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidFa)) { return AREA_FAROE_ISLANDS; }
|
1049
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidFe)) { return AREA_FINLAND_WITH_AHVENANMAA; }
|
1050
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidGa)) { return AREA_FRANCE; }
|
1051
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidGa_C)) { return AREA_CHANNEL_ISLANDS; }
|
1052
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidGa_F)) { return AREA_FRENCH_MAINLAND; }
|
1053
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidGa_M)) { return AREA_MONACO; }
|
1054
|
|
1055
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidGe)) { return AREA_GERMANY; }
|
1056
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidGg)) { return AREA_GEORGIA; }
|
1057
|
|
1058
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidGg_G)) { return AREA_GEORGIA_G; }
|
1059
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidGg_A)) { return AREA_ABKHAZIA; }
|
1060
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidGg_D)) { return AREA_ADZARIA; }
|
1061
|
|
1062
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidGr)) { return AREA_GREECE_WITH_CYCLADES_AND_MORE_ISLANDS; }
|
1063
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidHb)) { return AREA_IRELAND; }
|
1064
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidHb_E)) { return AREA_REPUBLIC_OF_IRELAND; }
|
1065
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidHb_N)) { return AREA_NORTHERN_IRELAND; }
|
1066
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidHe)) { return AREA_SWITZERLAND; }
|
1067
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidHo)) { return AREA_NETHERLANDS; }
|
1068
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidHs)) { return AREA_SPAIN; }
|
1069
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidHs_A)) { return AREA_ANDORRA; }
|
1070
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidHs_G)) { return AREA_GIBRALTAR; }
|
1071
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidHs_S)) { return AREA_KINGDOM_OF_SPAIN; }
|
1072
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidHu)) { return AREA_HUNGARY; }
|
1073
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidIJ)) { return AREA_ISRAEL_JORDAN; }
|
1074
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidIr)) { return AREA_ISRAEL; }
|
1075
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidIs)) { return AREA_ICELAND; }
|
1076
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidIt)) { return AREA_ITALY; }
|
1077
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidIt_I)) { return AREA_ITALIAN_MAINLAND; }
|
1078
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidIt_S)) { return AREA_SAN_MARINO; }
|
1079
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidJo)) { return AREA_JORDAN; }
|
1080
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidJu)) { return AREA_FORMER_JUGOSLAVIA; }
|
1081
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidKo)) { return AREA_KOSOVO; }
|
1082
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidLa)) { return AREA_LATVIA; }
|
1083
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidLe)) { return AREA_LEBANON; }
|
1084
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidLi)) { return AREA_LIBYA; }
|
1085
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidLS)) { return AREA_LEBANON_SYRIA; }
|
1086
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidLt)) { return AREA_LITHUANIA; }
|
1087
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidLu)) { return AREA_PORTUGUESE_MAINLAND; }
|
1088
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidMa)) { return AREA_MOROCCO; }
|
1089
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidMd)) { return AREA_MADEIRA_ARCHIPELAGO; }
|
1090
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidMd_D)) { return AREA_DESERTAS; }
|
1091
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidMd_M)) { return AREA_MADEIRA; }
|
1092
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidMd_P)) { return AREA_PORTO_SANTO; }
|
1093
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidMk)) { return AREA_THE_FORMER_JUGOSLAV_REPUBLIC_OF_MAKEDONIJA; }
|
1094
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidMo)) { return AREA_MOLDOVA; }
|
1095
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidNo)) { return AREA_NORWEGIAN_MAINLAND; }
|
1096
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidPo)) { return AREA_POLAND; }
|
1097
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidRf)) { return AREA_THE_RUSSIAN_FEDERATION; }
|
1098
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidRf_A)) { return AREA_NOVAYA_ZEMLYA_AND_FRANZ_JOSEPH_LAND; }
|
1099
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidRf_C)) { return AREA_CENTRAL_EUROPEAN_RUSSIA; }
|
1100
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidRf_CS)) { return AREA_NORTH_CAUCASUS; }
|
1101
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidRf_E)) { return AREA_EASTERN_EUROPEAN_RUSSIA; }
|
1102
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidRf_K)) { return AREA_KALININGRAD; }
|
1103
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidRf_N)) { return AREA_NORTHERN_EUROPEAN_RUSSIA; }
|
1104
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidRf_NW)) { return AREA_NORTHWEST_EUROPEAN_RUSSIA; }
|
1105
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidRf_S)) { return AREA_SOUTH_EUROPEAN_RUSSIA; }
|
1106
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidRm)) { return AREA_ROMANIA; }
|
1107
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidRs)) { return AREA_FORMER_USSR; }
|
1108
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidRs_B)) { return AREA_RUSSIA_BALTIC; }
|
1109
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidRs_C)) { return AREA_RUSSIA_CENTRAL; }
|
1110
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidRs_E)) { return AREA_RUSSIA_SOUTHEAST; }
|
1111
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidRs_K)) { return AREA_CRIMEA; }
|
1112
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidRs_N)) { return AREA_RUSSIA_NORTHERN; }
|
1113
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidRs_W)) { return AREA_RUSSIA_SOUTHWEST; }
|
1114
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidSa)) { return AREA_SARDEGNA; }
|
1115
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidSb)) { return AREA_SVALBARD_WITH_BJORNOYA_AND_JAN_MAYEN; }
|
1116
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidSe)) { return AREA_SERBIA; }
|
1117
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidSg)) { return AREA_SELVAGENS_ISLANDS; }
|
1118
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidSi)) { return AREA_SICILY_WITH_MALTA; }
|
1119
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidSi_M)) { return AREA_MALTA; }
|
1120
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidSi_S)) { return AREA_SICILY; }
|
1121
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidSk)) { return AREA_SLOVAKIA; }
|
1122
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidSl)) { return AREA_SLOVENIA; }
|
1123
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidSM)) { return AREA_SERBIA_WITH_MONTENEGRO; }
|
1124
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidSn)) { return AREA_SINAI; }
|
1125
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidSr)) { return AREA_SERBIA_INCLUDING_VOJVODINA_AND_WITH_KOSOVO; }
|
1126
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidSu)) { return AREA_SWEDEN; }
|
1127
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidSy)) { return AREA_SYRIA; }
|
1128
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidTcs)) { return AREA_TRANSCAUCASUS; }
|
1129
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidTn)) { return AREA_TUNISIA; }
|
1130
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidTu)) { return AREA_TURKEY; }
|
1131
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidTu_A)) { return AREA_ASIATIC_TURKEY; }
|
1132
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidTu_E)) { return AREA_EUROPEAN_TURKEY; }
|
1133
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidUk)) { return AREA_UKRAINE_INCLUDING_CRIMEA; }
|
1134
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidUk_K)) { return AREA_CRIMEA; }
|
1135
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidUk_U)) { return AREA_UKRAINE; }
|
1136
|
else {
|
1137
|
logger.warn("Unknown EuroMed distribution area: " + area.getTitleCache());
|
1138
|
}
|
1139
|
}else if (area.getVocabulary().getUuid().equals(BerlinModelTransformer.uuidVocEuroMedCommonNameAreas)){
|
1140
|
UUID uuidArea = namedArea.getUuid();
|
1141
|
if (uuidArea.equals(BerlinModelTransformer.uuidEMAreaCommonNameAlbania)) { return AREA_ALBANIA; }
|
1142
|
else if (uuidArea.equals(BerlinModelTransformer.uuidEMAreaCommonNameAndorra)) { return AREA_ANDORRA; }
|
1143
|
else if (uuidArea.equals(BerlinModelTransformer.uuidEMAreaCommonNameArmenia)) { return AREA_ARMENIA; }
|
1144
|
else if (uuidArea.equals(BerlinModelTransformer.uuidEMAreaCommonNameAustria)) { return AREA_AUSTRIA; }
|
1145
|
else if (uuidArea.equals(BerlinModelTransformer.uuidEMAreaCommonNameAzerbaijan)) { return AREA_AZERBAIJAN; }
|
1146
|
else if (uuidArea.equals(BerlinModelTransformer.uuidEMAreaCommonNameAzores)) { return AREA_AZORES; }
|
1147
|
else if (uuidArea.equals(BerlinModelTransformer.uuidEMAreaCommonNameBaleares)) { return AREA_BALEARES; }
|
1148
|
else if (uuidArea.equals(BerlinModelTransformer.uuidEMAreaCommonNameBelarus)) { return AREA_BELARUS; }
|
1149
|
else if (uuidArea.equals(BerlinModelTransformer.uuidEMAreaCommonNameBelgium)) { return AREA_BELGIUM; }
|
1150
|
else if (uuidArea.equals(BerlinModelTransformer.uuidEMAreaCommonNameBulgaria)) { return AREA_BULGARIA; }
|
1151
|
else if (uuidArea.equals(BerlinModelTransformer.uuidEMAreaCommonNameCanaryIs)) { return AREA_CANARY_ISLANDS; }
|
1152
|
else if (uuidArea.equals(BerlinModelTransformer.uuidEMAreaCommonNameCorse)) { return AREA_CORSE; }
|
1153
|
else if (uuidArea.equals(BerlinModelTransformer.uuidEMAreaCommonNameCrete)) { return AREA_CRETE; }
|
1154
|
else if (uuidArea.equals(BerlinModelTransformer.uuidEMAreaCommonNameCrimea)) { return AREA_CRIMEA; }
|
1155
|
else if (uuidArea.equals(BerlinModelTransformer.uuidEMAreaCommonNameCroatia)) { return AREA_CROATIA; }
|
1156
|
else if (uuidArea.equals(BerlinModelTransformer.uuidEMAreaCommonNameCzechRepublic)) { return AREA_CZECH_REPUBLIC; }
|
1157
|
else if (uuidArea.equals(BerlinModelTransformer.uuidEMAreaCommonNameDenmark)) { return AREA_DENMARK_COUNTRY; } //??
|
1158
|
else if (uuidArea.equals(BerlinModelTransformer.uuidEMAreaCommonNameEastAegeanIslands)) { return AREA_EAST_AEGEAN_ISLANDS; }
|
1159
|
else if (uuidArea.equals(BerlinModelTransformer.uuidEMAreaCommonNameEstonia)) { return AREA_ESTONIA; }
|
1160
|
else if (uuidArea.equals(BerlinModelTransformer.uuidEMAreaCommonNameEstonia)) { return AREA_ESTONIA; }
|
1161
|
else if (uuidArea.equals(BerlinModelTransformer.uuidEMAreaCommonNameFaroer)) { return AREA_FAROE_ISLANDS; }
|
1162
|
else if (uuidArea.equals(BerlinModelTransformer.uuidEMAreaCommonNameFinland)) { return AREA_FINLAND_WITH_AHVENANMAA; } //??
|
1163
|
else if (uuidArea.equals(BerlinModelTransformer.uuidEMAreaCommonNameFinlandWithAhvenanmaa)) { return AREA_FINLAND_WITH_AHVENANMAA; }
|
1164
|
else if (uuidArea.equals(BerlinModelTransformer.uuidEMAreaCommonNameFrance)) { return AREA_FRANCE; }
|
1165
|
else if (uuidArea.equals(BerlinModelTransformer.uuidEMAreaCommonNameGeorgia)) { return AREA_GEORGIA; }
|
1166
|
else if (uuidArea.equals(BerlinModelTransformer.uuidEMAreaCommonNameGermany)) { return AREA_GERMANY; }
|
1167
|
else if (uuidArea.equals(BerlinModelTransformer.uuidEMAreaCommonNameGreatBritain)) { return AREA_GREAT_BRITAIN; }
|
1168
|
else if (uuidArea.equals(BerlinModelTransformer.uuidEMAreaCommonNameGreece)) { return AREA_GREECE_COUNTRY; } //??
|
1169
|
else if (uuidArea.equals(BerlinModelTransformer.uuidEMAreaCommonNameHungary)) { return AREA_HUNGARY; }
|
1170
|
else if (uuidArea.equals(BerlinModelTransformer.uuidEMAreaCommonNameIbizaWithFormentera)) { return AREA_IBIZA_WITH_FORMENTERA; }
|
1171
|
else if (uuidArea.equals(BerlinModelTransformer.uuidEMAreaCommonNameIceland)) { return AREA_ICELAND; }
|
1172
|
else if (uuidArea.equals(BerlinModelTransformer.uuidEMAreaCommonNameIreland)) { return AREA_IRELAND; }
|
1173
|
else if (uuidArea.equals(BerlinModelTransformer.uuidEMAreaCommonNameIsrael)) { return AREA_ISRAEL; }
|
1174
|
else if (uuidArea.equals(BerlinModelTransformer.uuidEMAreaCommonNameItaly)) { return AREA_ITALY; }
|
1175
|
else if (uuidArea.equals(BerlinModelTransformer.uuidEMAreaCommonNameLaPalma)) { return AREA_LA_PALMA; }
|
1176
|
else if (uuidArea.equals(BerlinModelTransformer.uuidEMAreaCommonNameLativa)) { return AREA_LATVIA; }
|
1177
|
else if (uuidArea.equals(BerlinModelTransformer.uuidEMAreaCommonNameLebanon)) { return AREA_LEBANON; }
|
1178
|
else if (uuidArea.equals(BerlinModelTransformer.uuidEMAreaCommonNameLibya)) { return AREA_LIBYA; }
|
1179
|
else if (uuidArea.equals(BerlinModelTransformer.uuidEMAreaCommonNameLithuania)) { return AREA_LITHUANIA; }
|
1180
|
else if (uuidArea.equals(BerlinModelTransformer.uuidEMAreaCommonNameMadeira)) { return AREA_MADEIRA; }
|
1181
|
else if (uuidArea.equals(BerlinModelTransformer.uuidEMAreaCommonNameMallorca)) { return AREA_MALLORCA; }
|
1182
|
else if (uuidArea.equals(BerlinModelTransformer.uuidEMAreaCommonNameMalta)) { return AREA_MALTA; }
|
1183
|
else if (uuidArea.equals(BerlinModelTransformer.uuidEMAreaCommonNameMenorca)) { return AREA_MENORCA; }
|
1184
|
else if (uuidArea.equals(BerlinModelTransformer.uuidEMAreaCommonNameMoldova)) { return AREA_MOLDOVA; }
|
1185
|
else if (uuidArea.equals(BerlinModelTransformer.uuidEMAreaCommonNameMorocco)) { return AREA_MOROCCO; }
|
1186
|
else if (uuidArea.equals(BerlinModelTransformer.uuidEMAreaCommonNameNetherlands)) { return AREA_NETHERLANDS; }
|
1187
|
else if (uuidArea.equals(BerlinModelTransformer.uuidEMAreaCommonNameNorway)) { return AREA_NORWEGIAN_MAINLAND; }
|
1188
|
else if (uuidArea.equals(BerlinModelTransformer.uuidEMAreaCommonNamePoland)) { return AREA_POLAND; }
|
1189
|
else if (uuidArea.equals(BerlinModelTransformer.uuidEMAreaCommonNamePortugal)) { return AREA_PORTUGAL_COUNTRY; } //??
|
1190
|
else if (uuidArea.equals(BerlinModelTransformer.uuidEMAreaCommonNameRomania)) { return AREA_ROMANIA; }
|
1191
|
else if (uuidArea.equals(BerlinModelTransformer.uuidEMAreaCommonNameRussiaCentral)) { return AREA_RUSSIA_CENTRAL; }
|
1192
|
else if (uuidArea.equals(BerlinModelTransformer.uuidEMAreaCommonNameRussianFederation)) { return AREA_THE_RUSSIAN_FEDERATION; }
|
1193
|
else if (uuidArea.equals(BerlinModelTransformer.uuidEMAreaCommonNameSardegna)) { return AREA_SARDEGNA; }
|
1194
|
else if (uuidArea.equals(BerlinModelTransformer.uuidEMAreaCommonNameSerbiaMontenegro)) { return AREA_SERBIA_WITH_MONTENEGRO; }
|
1195
|
else if (uuidArea.equals(BerlinModelTransformer.uuidEMAreaCommonNameSlovakia)) { return AREA_SLOVAKIA; }
|
1196
|
else if (uuidArea.equals(BerlinModelTransformer.uuidEMAreaCommonNameSlovenia)) { return AREA_SLOVENIA; }
|
1197
|
else if (uuidArea.equals(BerlinModelTransformer.uuidEMAreaCommonNameSouthEuropeanRussia)) { return AREA_SOUTH_EUROPEAN_RUSSIA; }
|
1198
|
else if (uuidArea.equals(BerlinModelTransformer.uuidEMAreaCommonNameSpain)) { return AREA_SPAIN; }
|
1199
|
else if (uuidArea.equals(BerlinModelTransformer.uuidEMAreaCommonNameSweden)) { return AREA_SWEDEN; }
|
1200
|
else if (uuidArea.equals(BerlinModelTransformer.uuidEMAreaCommonNameSwitzerland)) { return AREA_SWITZERLAND; }
|
1201
|
else if (uuidArea.equals(BerlinModelTransformer.uuidEMAreaCommonNameSyria)) { return AREA_SYRIA; }
|
1202
|
else if (uuidArea.equals(BerlinModelTransformer.uuidEMAreaCommonNameTenerife)) { return AREA_TENERIFE; }
|
1203
|
else if (uuidArea.equals(BerlinModelTransformer.uuidEMAreaCommonNameTurkey)) { return AREA_TURKEY; } //??
|
1204
|
else if (uuidArea.equals(BerlinModelTransformer.uuidEMAreaCommonNameUkraine)) { return AREA_UKRAINE; } //??
|
1205
|
else if (uuidArea.equals(BerlinModelTransformer.uuidEMAreaCommonNameWales)) { return AREA_WALES; }
|
1206
|
else {
|
1207
|
logger.warn("Unknown EuroMed common name area: " + area.getTitleCache());
|
1208
|
}
|
1209
|
|
1210
|
}else if (area.getVocabulary().getUuid().equals(FaunaEuropaeaTransformer.uuidFauEuArea)){
|
1211
|
UUID uuidArea = namedArea.getUuid();
|
1212
|
if (uuidArea.equals(uuidAreaAD)) { return AREA_ANDORRA; }
|
1213
|
else if (uuidArea.equals(uuidAreaAFR)) { return AREA_AFRO_TROPICAL_REGION; }
|
1214
|
else if (uuidArea.equals(uuidAreaAL)) { return AREA_ALBANIA; }
|
1215
|
else if (uuidArea.equals(uuidAreaAT)) { return AREA_AUSTRIA; }
|
1216
|
else if (uuidArea.equals(uuidAreaAUS)) { return AREA_AUSTRALIAN_REGION; }
|
1217
|
else if (uuidArea.equals(uuidAreaBA)) { return AREA_BOSNIA_HERZEGOVINA; }
|
1218
|
else if (uuidArea.equals(uuidAreaBE)) { return AREA_BELGIUM; }
|
1219
|
else if (uuidArea.equals(uuidAreaBG)) { return AREA_BULGARIA; }
|
1220
|
else if (uuidArea.equals(uuidAreaBY)) { return AREA_BELARUS; }
|
1221
|
else if (uuidArea.equals(uuidAreaCH)) { return AREA_SWITZERLAND; }
|
1222
|
else if (uuidArea.equals(uuidAreaCY)) { return AREA_CYPRUS; }
|
1223
|
else if (uuidArea.equals(uuidAreaCZ)) { return AREA_CZECH_REPUBLIC; }
|
1224
|
else if (uuidArea.equals(uuidAreaDE)) { return AREA_GERMANY; }
|
1225
|
else if (uuidArea.equals(uuidAreaDK_DEN)) { return AREA_DENMARK_WITH_BORNHOLM; }
|
1226
|
else if (uuidArea.equals(uuidAreaDK_FOR)) { return AREA_FAROE_ISLANDS; }
|
1227
|
else if (uuidArea.equals(uuidAreaEE)) { return AREA_ESTONIA; }
|
1228
|
else if (uuidArea.equals(uuidAreaEPA)) { return AREA_EAST_PALAEARCTIC; }
|
1229
|
else if (uuidArea.equals(uuidAreaES_BAL)) { return AREA_BALEARES; }
|
1230
|
else if (uuidArea.equals(uuidAreaES_CNY)) { return AREA_CANARY_ISLANDS; }
|
1231
|
else if (uuidArea.equals(uuidAreaES_SPA)) { return AREA_KINGDOM_OF_SPAIN; }
|
1232
|
else if (uuidArea.equals(uuidAreaFI)) { return AREA_FINLAND_WITH_AHVENANMAA; }
|
1233
|
else if (uuidArea.equals(uuidAreaFR_COR)) { return AREA_CORSE; }
|
1234
|
else if (uuidArea.equals(uuidAreaFR_FRA)) { return AREA_FRENCH_MAINLAND; }
|
1235
|
else if (uuidArea.equals(uuidAreaGB_CI)) { return AREA_CHANNEL_ISLANDS; }
|
1236
|
else if (uuidArea.equals(uuidAreaGB_GI)) { return AREA_GIBRALTAR; }
|
1237
|
else if (uuidArea.equals(uuidAreaGB_GRB)) { return AREA_GREAT_BRITAIN; }
|
1238
|
else if (uuidArea.equals(uuidAreaGB_NI)) { return AREA_NORTHERN_IRELAND; }
|
1239
|
else if (uuidArea.equals(uuidAreaGR_AEG)) { return AREA_NORTH_AEGEAN_ISLANDS; }
|
1240
|
else if (uuidArea.equals(uuidAreaGR_CYC)) { return AREA_CYCLADES_ISLANDS; }
|
1241
|
else if (uuidArea.equals(uuidAreaGR_DOD)) { return AREA_DODECANESE_ISLANDS; }
|
1242
|
else if (uuidArea.equals(uuidAreaGR_KRI)) { return AREA_CRETE; }
|
1243
|
else if (uuidArea.equals(uuidAreaGR_GRC)) { return AREA_GREEK_MAINLAND; }
|
1244
|
else if (uuidArea.equals(uuidAreaHR)) { return AREA_CROATIA; }
|
1245
|
else if (uuidArea.equals(uuidAreaHU)) { return AREA_HUNGARY; }
|
1246
|
else if (uuidArea.equals(uuidAreaIE)) { return AREA_REPUBLIC_OF_IRELAND; }
|
1247
|
else if (uuidArea.equals(uuidAreaIS)) { return AREA_ICELAND; }
|
1248
|
else if (uuidArea.equals(uuidAreaIT_ITA)) { return AREA_ITALIAN_MAINLAND; }
|
1249
|
else if (uuidArea.equals(uuidAreaIT_SAR)) { return AREA_SARDEGNA; }
|
1250
|
else if (uuidArea.equals(uuidAreaIT_SI)) { return AREA_SICILY; }
|
1251
|
else if (uuidArea.equals(uuidAreaLI)) { return AREA_LIECHTENSTEIN; }
|
1252
|
else if (uuidArea.equals(uuidAreaLT)) { return AREA_LITHUANIA; }
|
1253
|
else if (uuidArea.equals(uuidAreaLU)) { return AREA_LUXEMBOURG; }
|
1254
|
else if (uuidArea.equals(uuidAreaLV)) { return AREA_LATVIA; }
|
1255
|
else if (uuidArea.equals(uuidAreaMC)) { return AREA_MONACO; }
|
1256
|
else if (uuidArea.equals(uuidAreaMD)) { return AREA_MOLDOVA; }
|
1257
|
else if (uuidArea.equals(uuidAreaMK)) { return AREA_THE_FORMER_JUGOSLAV_REPUBLIC_OF_MAKEDONIJA; }
|
1258
|
else if (uuidArea.equals(uuidAreaMT)) { return AREA_MALTA; }
|
1259
|
else if (uuidArea.equals(uuidAreaNAF)) { return AREA_NORTHERN_AFRICA; }
|
1260
|
else if (uuidArea.equals(uuidAreaNEA)) { return AREA_NEARCTIC_REGION; }
|
1261
|
else if (uuidArea.equals(uuidAreaNEO)) { return AREA_NEOTROPICAL_REGION; }
|
1262
|
else if (uuidArea.equals(uuidAreaNL)) { return AREA_NETHERLANDS; }
|
1263
|
else if (uuidArea.equals(uuidAreaNO_NOR)) { return AREA_NORWEGIAN_MAINLAND; }
|
1264
|
else if (uuidArea.equals(uuidAreaNO_SVA)) { return AREA_SVALBARD_WITH_BJORNOYA_AND_JAN_MAYEN; }
|
1265
|
else if (uuidArea.equals(uuidAreaNRE)) { return AREA_NEAR_EAST; }
|
1266
|
else if (uuidArea.equals(uuidAreaORR)) { return AREA_ORIENTAL_REGION; }
|
1267
|
else if (uuidArea.equals(uuidAreaPL)) { return AREA_POLAND; }
|
1268
|
else if (uuidArea.equals(uuidAreaPT_AZO)) { return AREA_AZORES; }
|
1269
|
else if (uuidArea.equals(uuidAreaPT_MDR)) { return AREA_MADEIRA; }
|
1270
|
else if (uuidArea.equals(uuidAreaPT_POR)) { return AREA_PORTUGUESE_MAINLAND; }
|
1271
|
else if (uuidArea.equals(uuidAreaPT_SEL)) { return AREA_SELVAGENS_ISLANDS; }
|
1272
|
else if (uuidArea.equals(uuidAreaRO)) { return AREA_ROMANIA; }
|
1273
|
else if (uuidArea.equals(uuidAreaRU_FJL)) { return AREA_FRANZ_JOSEF_LAND; }
|
1274
|
else if (uuidArea.equals(uuidAreaRU_KGD)) { return AREA_KALININGRAD; }
|
1275
|
else if (uuidArea.equals(uuidAreaRU_NOZ)) { return AREA_NOVAYA_ZEMLYA; }
|
1276
|
else if (uuidArea.equals(uuidAreaRU_RUC)) { return AREA_CENTRAL_EUROPEAN_RUSSIA; }
|
1277
|
else if (uuidArea.equals(uuidAreaRU_RUE)) { return AREA_EASTERN_EUROPEAN_RUSSIA; }
|
1278
|
else if (uuidArea.equals(uuidAreaRU_RUN)) { return AREA_NORTHERN_EUROPEAN_RUSSIA; }
|
1279
|
else if (uuidArea.equals(uuidAreaRU_RUS)) { return AREA_SOUTH_EUROPEAN_RUSSIA; }
|
1280
|
else if (uuidArea.equals(uuidAreaRU_RUW)) { return AREA_NORTHWEST_EUROPEAN_RUSSIA; }
|
1281
|
else if (uuidArea.equals(uuidAreaSE)) { return AREA_SWEDEN; }
|
1282
|
else if (uuidArea.equals(uuidAreaSI)) { return AREA_SLOVENIA; }
|
1283
|
else if (uuidArea.equals(uuidAreaSK)) { return AREA_SLOVAKIA; }
|
1284
|
else if (uuidArea.equals(uuidAreaSM)) { return AREA_SAN_MARINO; }
|
1285
|
else if (uuidArea.equals(uuidAreaTR_TUE)) { return AREA_EUROPEAN_TURKEY; }
|
1286
|
else if (uuidArea.equals(uuidAreaUA)) { return AREA_UKRAINE_INCLUDING_CRIMEA; }
|
1287
|
else if (uuidArea.equals(uuidAreaVA)) { return AREA_VATICAN_CITY; }
|
1288
|
else if (uuidArea.equals(uuidAreaYU)) { return AREA_FORMER_JUGOSLAVIA; }
|
1289
|
|
1290
|
}else if (area.getVocabulary().getUuid().equals(ErmsTransformer.uuidVocErmsAreas)){
|
1291
|
//ERMS
|
1292
|
UUID uuidArea = namedArea.getUuid();
|
1293
|
if (uuidArea.equals(ErmsTransformer.uuidEuropeanMarineWaters)) { return AREA_EUROPEAN_MARINE_WATERS; }
|
1294
|
else if (//(namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("MES") || /carefull: NPE!
|
1295
|
(uuidArea.equals(ErmsTransformer.uuidMediterraneanSea))) { return AREA_MEDITERRANEAN_SEA; } // abbreviated label missing
|
1296
|
else if (uuidArea.equals(ErmsTransformer.uuidWhiteSea)) { return AREA_WHITE_SEA; }
|
1297
|
else if (uuidArea.equals(ErmsTransformer.uuidNorthSea)) { return AREA_NORTH_SEA; }
|
1298
|
else if (uuidArea.equals(ErmsTransformer.uuidBalticSea)) { return AREA_BALTIC_SEA; }
|
1299
|
else if (//(namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("BLS") || /carefull: NPE!
|
1300
|
(uuidArea.equals(ErmsTransformer.uuidBlackSea))) { return AREA_BLACK_SEA; } // abbreviated label missing
|
1301
|
else if (uuidArea.equals(ErmsTransformer.uuidBarentszSea)) { return AREA_BARENTSZ_SEA; }
|
1302
|
else if (//(namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("CAS") || /carefull: NPE!
|
1303
|
(uuidArea.equals(ErmsTransformer.uuidCaspianSea))) { return AREA_CASPIAN_SEA; } // abbreviated label missing
|
1304
|
else if (uuidArea.equals(ErmsTransformer.uuidPortugueseExclusiveEconomicZone)) { return AREA_PORTUGUESE_EXCLUSIVE_ECONOMIC_ZONE; }
|
1305
|
else if (uuidArea.equals(ErmsTransformer.uuidBelgianExclusiveEconomicZone)) { return AREA_BELGIAN_EXCLUSIVE_ECONOMIC_ZONE; }
|
1306
|
else if (uuidArea.equals(ErmsTransformer.uuidFrenchExclusiveEconomicZone)) { return AREA_FRENCH_EXCLUSIVE_ECONOMIC_ZONE; }
|
1307
|
else if (uuidArea.equals(ErmsTransformer.uuidEnglishChannel)) { return AREA_ENGLISH_CHANNEL; }
|
1308
|
else if (uuidArea.equals(ErmsTransformer.uuidAdriaticSea)) { return AREA_ADRIATIC_SEA; }
|
1309
|
else if (uuidArea.equals(ErmsTransformer.uuidBiscayBay)) { return AREA_BISCAY_BAY; }
|
1310
|
else if (uuidArea.equals(ErmsTransformer.uuidDutchExclusiveEconomicZone)) { return AREA_DUTCH_EXCLUSIVE_ECONOMIC_ZONE; }
|
1311
|
else if (uuidArea.equals(ErmsTransformer.uuidUnitedKingdomExclusiveEconomicZone)) { return AREA_UNITED_KINGDOM_EXCLUSIVE_ECONOMIC_ZONE; }
|
1312
|
else if (uuidArea.equals(ErmsTransformer.uuidSpanishExclusiveEconomicZone)) { return AREA_SPANISH_EXCLUSIVE_ECONOMIC_ZONE; }
|
1313
|
else if (uuidArea.equals(ErmsTransformer.uuidEgyptianExclusiveEconomicZone)) { return AREA_EGYPTIAN_EXCLUSIVE_ECONOMIC_ZONE; }
|
1314
|
else if (uuidArea.equals(ErmsTransformer.uuidTirrenoSea)) { return AREA_TIRRENO_SEA; }
|
1315
|
else if (uuidArea.equals(ErmsTransformer.uuidIcelandicExclusiveEconomicZone)) { return AREA_ICELANDIC_EXCLUSIVE_ECONOMIC_ZONE; }
|
1316
|
else if (uuidArea.equals(ErmsTransformer.uuidIrishExclusiveeconomicZone)) { return AREA_IRISH_EXCLUSIVE_ECONOMIC_ZONE; }
|
1317
|
else if (uuidArea.equals(ErmsTransformer.uuidIrishSea)) { return AREA_IRISH_SEA; }
|
1318
|
else if (uuidArea.equals(ErmsTransformer.uuidIsraeliExclusiveEconomicZone)){ return 218;}
|
1319
|
else if (uuidArea.equals(ErmsTransformer.uuidItalianExclusiveEconomicZone)) { return AREA_ITALIAN_EXCLUSIVE_ECONOMIC_ZONE; }
|
1320
|
else if (uuidArea.equals(ErmsTransformer.uuidNorwegianSea)) { return AREA_NORWEGIAN_SEA; }
|
1321
|
else if (uuidArea.equals(ErmsTransformer.uuidMoroccanExclusiveEconomicZone)) { return AREA_MOROCCAN_EXCLUSIVE_ECONOMIC_ZONE; }
|
1322
|
else if (uuidArea.equals(ErmsTransformer.uuidNorwegianExclusiveEconomicZone)) { return AREA_NORWEGIAN_EXCLUSIVE_ECONOMIC_ZONE; }
|
1323
|
else if (uuidArea.equals(ErmsTransformer.uuidSkagerrak)) { return AREA_SKAGERRAK; }
|
1324
|
else if (uuidArea.equals(ErmsTransformer.uuidTunisianExclusiveEconomicZone)) { return AREA_TUNISIAN_EXCLUSIVE_ECONOMIC_ZONE; }
|
1325
|
else if (uuidArea.equals(ErmsTransformer.uuidWaddenSea)) { return AREA_WADDEN_SEA; }
|
1326
|
else if (uuidArea.equals(ErmsTransformer.uuidBaeltSea)) { return AREA_BELT_SEA; }
|
1327
|
else if (uuidArea.equals(ErmsTransformer.uuidMarmaraSea)) { return AREA_MARMARA_SEA; }
|
1328
|
else if (uuidArea.equals(ErmsTransformer.uuidSeaofAzov)) { return AREA_SEA_OF_AZOV; }
|
1329
|
else if (uuidArea.equals(ErmsTransformer.uuidAegeanSea)) { return AREA_AEGEAN_SEA; }
|
1330
|
else if (uuidArea.equals(ErmsTransformer.uuidBulgarianExclusiveEconomicZone)) { return AREA_BULGARIAN_EXCLUSIVE_ECONOMIC_ZONE; }
|
1331
|
else if (uuidArea.equals(ErmsTransformer.uuidSouthBalticproper)) { return AREA_SOUTH_BALTIC_PROPER; }
|
1332
|
else if (uuidArea.equals(ErmsTransformer.uuidBalticProper)) { return AREA_BALTIC_PROPER; }
|
1333
|
else if (uuidArea.equals(ErmsTransformer.uuidNorthBalticproper)) { return AREA_NORTH_BALTIC_PROPER; }
|
1334
|
else if (uuidArea.equals(ErmsTransformer.uuidArchipelagoSea)) { return AREA_ARCHIPELAGO_SEA; }
|
1335
|
else if (uuidArea.equals(ErmsTransformer.uuidBothnianSea)) { return AREA_BOTHNIAN_SEA; }
|
1336
|
else if (uuidArea.equals(ErmsTransformer.uuidGermanExclusiveEconomicZone)) { return AREA_GERMAN_EXCLUSIVE_ECONOMIC_ZONE; }
|
1337
|
else if (uuidArea.equals(ErmsTransformer.uuidSwedishExclusiveEconomicZone)) { return AREA_SWEDISH_EXCLUSIVE_ECONOMIC_ZONE; }
|
1338
|
else if (uuidArea.equals(ErmsTransformer.uuidUkrainianExclusiveEconomicZone)) { return AREA_UKRAINIAN_EXCLUSIVE_ECONOMIC_ZONE; }
|
1339
|
else if (uuidArea.equals(ErmsTransformer.uuidMadeiranExclusiveEconomicZone)) { return AREA_MADEIRAN_EXCLUSIVE_ECONOMIC_ZONE; }
|
1340
|
else if (uuidArea.equals(ErmsTransformer.uuidLebaneseExclusiveEconomicZone)) { return AREA_LEBANESE_EXCLUSIVE_ECONOMIC_ZONE; }
|
1341
|
else if (uuidArea.equals(ErmsTransformer.uuidSpanishExclusiveEconomicZoneMediterraneanpart)) { return AREA_SPANISH_EXCLUSIVE_ECONOMIC_ZONE_MEDITERRANEAN_PART; }
|
1342
|
else if (uuidArea.equals(ErmsTransformer.uuidEstonianExclusiveEconomicZone)) { return AREA_ESTONIAN_EXCLUSIVE_ECONOMIC_ZONE; }
|
1343
|
else if (uuidArea.equals(ErmsTransformer.uuidCroatianExclusiveEconomicZone)) { return AREA_CROATIAN_EXCLUSIVE_ECONOMIC_ZONE; }
|
1344
|
else if (uuidArea.equals(ErmsTransformer.uuidBalearSea)) { return AREA_BALEAR_SEA; }
|
1345
|
else if (uuidArea.equals(ErmsTransformer.uuidTurkishExclusiveEconomicZone)) { return AREA_TURKISH_EXCLUSIVE_ECONOMIC_ZONE; }
|
1346
|
else if (uuidArea.equals(ErmsTransformer.uuidDanishExclusiveEconomicZone)) { return AREA_DANISH_EXCLUSIVE_ECONOMIC_ZONE; }
|
1347
|
|
1348
|
else if (uuidArea.equals(ErmsTransformer.uuidAfghanistan)) { return 297; }
|
1349
|
else if (uuidArea.equals(ErmsTransformer.uuidAlboranSea)) { return 219; }
|
1350
|
else if (uuidArea.equals(ErmsTransformer.uuidAlgeria)) { return 220; }
|
1351
|
else if (uuidArea.equals(ErmsTransformer.uuidAngola)) { return 221; }
|
1352
|
else if (uuidArea.equals(ErmsTransformer.uuidArcticOcean)) { return 296; }
|
1353
|
else if (uuidArea.equals(ErmsTransformer.uuidAustralianExclusiveEconomicZone)) { return 222; }
|
1354
|
else if (uuidArea.equals(ErmsTransformer.uuidBahamas)) { return 223; }
|
1355
|
else if (uuidArea.equals(ErmsTransformer.uuidBalearicSea)) { return 224; }
|
1356
|
else if (uuidArea.equals(ErmsTransformer.uuidBelgium)) { return 225; }
|
1357
|
else if (uuidArea.equals(ErmsTransformer.uuidBelize)) { return 226; }
|
1358
|
else if (uuidArea.equals(ErmsTransformer.uuidBrazil)) { return 227; }
|
1359
|
else if (uuidArea.equals(ErmsTransformer.uuidBulgaria)) { return 228; }
|
1360
|
else if (uuidArea.equals(ErmsTransformer.uuidCanada)) { return 229; }
|
1361
|
else if (uuidArea.equals(ErmsTransformer.uuidCapeVerde)) { return 230; }
|
1362
|
else if (uuidArea.equals(ErmsTransformer.uuidCapeVerdeanExclusiveEconomicZone)) { return 231; }
|
1363
|
else if (uuidArea.equals(ErmsTransformer.uuidCaribbeanSea)) { return 210; }
|
1364
|
else if (uuidArea.equals(ErmsTransformer.uuidChile)) { return 232; }
|
1365
|
else if (uuidArea.equals(ErmsTransformer.uuidColombia)) { return 233; }
|
1366
|
else if (uuidArea.equals(ErmsTransformer.uuidCostaRica)) { return 234; }
|
1367
|
else if (uuidArea.equals(ErmsTransformer.uuidCroatia)) { return 235; }
|
1368
|
else if (uuidArea.equals(ErmsTransformer.uuidCuba)) { return 236; }
|
1369
|
else if (uuidArea.equals(ErmsTransformer.uuidDenmark)) { return 292; }
|
1370
|
else if (uuidArea.equals(ErmsTransformer.uuidEgypt)) { return 237; }
|
1371
|
else if (uuidArea.equals(ErmsTransformer.uuidEstonia)) { return 238; }
|
1372
|
else if (uuidArea.equals(ErmsTransformer.uuidFaeroeExclusiveEconomicZone)) { return 239; }
|
1373
|
else if (uuidArea.equals(ErmsTransformer.uuidFrance)) { return 240; }
|
1374
|
else if (uuidArea.equals(ErmsTransformer.uuidGhana)) { return 241; }
|
1375
|
else if (uuidArea.equals(ErmsTransformer.uuidGreece)) { return 242; }
|
1376
|
else if (uuidArea.equals(ErmsTransformer.uuidGermany)) { return 298; }
|
1377
|
else if (uuidArea.equals(ErmsTransformer.uuidGreekExclusiveEconomicZone)) { return AREA_GREEK_EXCLUSIVE_ECONOMIC_ZONE; }
|
1378
|
else if (uuidArea.equals(ErmsTransformer.uuidGulfOfBothnia)) { return 243; }
|
1379
|
else if (uuidArea.equals(ErmsTransformer.uuidGulfOfFinland)) { return 244; }
|
1380
|
else if (uuidArea.equals(ErmsTransformer.uuidGulfOfGuinea)) { return 245; }
|
1381
|
else if (uuidArea.equals(ErmsTransformer.uuidGulfOfMexico)) { return 246; }
|
1382
|
else if (uuidArea.equals(ErmsTransformer.uuidGulfOfRiga)) { return 247; }
|
1383
|
else if (uuidArea.equals(ErmsTransformer.uuidIceland)) { return 248; }
|
1384
|
else if (uuidArea.equals(ErmsTransformer.uuidIonianSea)) { return 249; }
|
1385
|
else if (uuidArea.equals(ErmsTransformer.uuidIreland)) { return 250; }
|
1386
|
else if (uuidArea.equals(ErmsTransformer.uuidItaly)) { return 251; }
|
1387
|
else if (uuidArea.equals(ErmsTransformer.uuidJamaica)) { return 252; }
|
1388
|
else if (uuidArea.equals(ErmsTransformer.uuidKattegat)) { return 253; }
|
1389
|
else if (uuidArea.equals(ErmsTransformer.uuidLevantineSea)) { return 254; }
|
1390
|
else if (uuidArea.equals(ErmsTransformer.uuidLigurianSea)) { return 255; }
|
1391
|
else if (uuidArea.equals(ErmsTransformer.uuidMalteseExclusiveEconomicZone)) { return 256; }
|
1392
|
else if (uuidArea.equals(ErmsTransformer.uuidMauritanianExclusiveEconomicZone)) { return 257; }
|
1393
|
else if (uuidArea.equals(ErmsTransformer.uuidMediterraneanSea_EasternBasin)) { return 258; }
|
1394
|
else if (uuidArea.equals(ErmsTransformer.uuidMediterraneanSea_WesternBasin)) { return 259; }
|
1395
|
else if (uuidArea.equals(ErmsTransformer.uuidMexico)) { return 260; }
|
1396
|
else if (uuidArea.equals(ErmsTransformer.uuidMongolia)) { return 299; }
|
1397
|
else if (uuidArea.equals(ErmsTransformer.uuidMorocco)) { return 261; }
|
1398
|
else if (uuidArea.equals(ErmsTransformer.uuidNetherlands)) { return 262; }
|
1399
|
else if (uuidArea.equals(ErmsTransformer.uuidNewZealand)) { return 263; }
|
1400
|
else if (uuidArea.equals(ErmsTransformer.uuidNewZealandExclusiveEconomicZone)) { return 264; }
|
1401
|
else if (uuidArea.equals(ErmsTransformer.uuidNorthAtlanticOcean)) { return 265; }
|
1402
|
else if (uuidArea.equals(ErmsTransformer.uuidNorway)) { return 266; }
|
1403
|
else if (uuidArea.equals(ErmsTransformer.uuidPanama)) { return 267; }
|
1404
|
else if (uuidArea.equals(ErmsTransformer.uuidPanamanianExclusiveEconomicZone)) { return 268; }
|
1405
|
else if (uuidArea.equals(ErmsTransformer.uuidPolishExclusiveEconomicZone)) { return 216; }
|
1406
|
else if (uuidArea.equals(ErmsTransformer.uuidPortugal)) { return 269; }
|
1407
|
else if (uuidArea.equals(ErmsTransformer.uuidPortugueseExclusiveEconomicZone_Azores)) { return 270; }
|
1408
|
else if (uuidArea.equals(ErmsTransformer.uuidPortugueseExclusiveEconomicZone_Madeira)) { return 271; }
|
1409
|
else if (uuidArea.equals(ErmsTransformer.uuidRedSea)) { return 272; }
|
1410
|
else if (uuidArea.equals(ErmsTransformer.uuidRussianExclusiveEconomicZone)) { return 217; }
|
1411
|
else if (uuidArea.equals(ErmsTransformer.uuidSeaOfMarmara)) { return 273; }
|
1412
|
else if (uuidArea.equals(ErmsTransformer.uuidSenegaleseExclusiveEconomicZone)) { return 274; }
|
1413
|
else if (uuidArea.equals(ErmsTransformer.uuidSingapore)) { return 275; }
|
1414
|
else if (uuidArea.equals(ErmsTransformer.uuidSlovenianExclusiveEconomicZone)) { return 276; }
|
1415
|
else if (uuidArea.equals(ErmsTransformer.uuidSouthAfrica)) { return 277; }
|
1416
|
else if (uuidArea.equals(ErmsTransformer.uuidSouthAfricanExclusiveEconomicZone)) { return 278; }
|
1417
|
else if (uuidArea.equals(ErmsTransformer.uuidSouthChinaSea)) { return 279; }
|
1418
|
else if (uuidArea.equals(ErmsTransformer.uuidSpain)) { return 280; }
|
1419
|
else if (uuidArea.equals(ErmsTransformer.uuidSpanishExclusiveEconomicZone_CanaryIslands)) { return 281; }
|
1420
|
else if (uuidArea.equals(ErmsTransformer.uuidSriLankanExclusiveEconomicZone)) { return 282; }
|
1421
|
else if (uuidArea.equals(ErmsTransformer.uuidStraitOfGibraltar)) { return 283; }
|
1422
|
else if (uuidArea.equals(ErmsTransformer.uuidSweden)) { return 284; }
|
1423
|
else if (uuidArea.equals(ErmsTransformer.uuidTunisia)) { return 285; }
|
1424
|
else if (uuidArea.equals(ErmsTransformer.uuidTurkey)) { return 286; }
|
1425
|
else if (uuidArea.equals(ErmsTransformer.uuidTyrrhenianSea)) { return 287; }
|
1426
|
else if (uuidArea.equals(ErmsTransformer.uuidUnitedKingdom)) { return 288; }
|
1427
|
else if (uuidArea.equals(ErmsTransformer.uuidUnitedStates)) { return 291; }
|
1428
|
else if (uuidArea.equals(ErmsTransformer.uuidUnitedStatesExclusiveEconomicZone_Alaska)) { return 289; }
|
1429
|
else if (uuidArea.equals(ErmsTransformer.uuidVenezuela)) { return 290; }
|
1430
|
|
1431
|
else {
|
1432
|
logger.warn("Unknown ERMS Area: " + area.getTitleCache());
|
1433
|
}
|
1434
|
|
1435
|
} else {
|
1436
|
logger.warn("Unknown NamedArea Area not in a known vocabulary: " + area.getTitleCache());
|
1437
|
}
|
1438
|
return null;
|
1439
|
}
|
1440
|
|
1441
|
|
1442
|
/**
|
1443
|
* Returns the PESI SourceUseId for a given CDM sourceUseId.
|
1444
|
* @param sourceUseId
|
1445
|
* @return
|
1446
|
*/
|
1447
|
public static Integer sourceUseIdSourceUseId(Integer sourceUseId) {
|
1448
|
// TODO: CDM sourceUseId and PESI sourceUseId are equal for now.
|
1449
|
Integer result = null;
|
1450
|
switch (sourceUseId) {
|
1451
|
case 3: return ADDITIONAL_SOURCE;
|
1452
|
case 4: return SOURCE_OF_SYNONYMY;
|
1453
|
case 8: return NOMENCLATURAL_REFERENCE;
|
1454
|
}
|
1455
|
return result;
|
1456
|
}
|
1457
|
|
1458
|
@Override
|
1459
|
public Object getKeyByLanguage(Language language) throws UndefinedTransformerMethodException {
|
1460
|
return language2LanguageId(language);
|
1461
|
}
|
1462
|
|
1463
|
@Override
|
1464
|
public String getCacheByLanguage(Language language) throws UndefinedTransformerMethodException {
|
1465
|
if (language == null){
|
1466
|
return null;
|
1467
|
}else{
|
1468
|
return this.languageCacheMap.get(getKeyByLanguage(language));
|
1469
|
}
|
1470
|
}
|
1471
|
|
1472
|
/**
|
1473
|
* Returns the identifier of the given Language.
|
1474
|
*/
|
1475
|
public static Integer language2LanguageId(Language language) {
|
1476
|
if (language == null ) {
|
1477
|
return null;
|
1478
|
}
|
1479
|
Integer result;
|
1480
|
if ((result = languageCodeToKeyMap.get(language.getIso639_1())) != null){
|
1481
|
return result;
|
1482
|
}else if ((result = languageCodeToKeyMap.get(language.getIdInVocabulary())) != null){
|
1483
|
return result;
|
1484
|
//Languages without ISO identifier
|
1485
|
}else if (language.getUuid().equals(BerlinModelTransformer.uuidLangValencian)){return LANG_VALENCIAN;
|
1486
|
}else if (language.getUuid().equals(BerlinModelTransformer.uuidLangHighAragonese)){return LANG_HIGH_ARAGONES;
|
1487
|
}else if (language.getUuid().equals(BerlinModelTransformer.uuidLangMajorcan)){return LANG_MAJORCAN;
|
1488
|
//FE wrong mapping in FE, Dutch_Middle should probably be Dutch
|
1489
|
}else if (language.equals(Language.DUTCH_MIDDLE())){return LANG_DUTCH;
|
1490
|
//some common names from ILDIS have no defined language
|
1491
|
}else if (language.equals(Language.UNKNOWN_LANGUAGE())){return LANG_UNKNOWN;
|
1492
|
} else {
|
1493
|
logger.warn("Unknown Language: " + language.getTitleCache());
|
1494
|
return null;
|
1495
|
}
|
1496
|
}
|
1497
|
|
1498
|
/**
|
1499
|
* Returns the NodeCategoryCache for a given TextData.
|
1500
|
*/
|
1501
|
@Override
|
1502
|
public String getCacheByFeature(Feature feature) {
|
1503
|
if (feature == null){
|
1504
|
return null;
|
1505
|
}else{
|
1506
|
return this.featureCacheMap.get(feature2NoteCategoryFk(feature));
|
1507
|
}
|
1508
|
}
|
1509
|
|
1510
|
/**
|
1511
|
* Returns the NodeCategoryFk for a given TextData.
|
1512
|
*/
|
1513
|
public static Integer feature2NoteCategoryFk(Feature feature) {
|
1514
|
if (feature == null) {
|
1515
|
return null;
|
1516
|
}
|
1517
|
|
1518
|
if (feature.equals(Feature.DESCRIPTION())) {
|
1519
|
return NoteCategory_description;
|
1520
|
} else if (feature.equals(Feature.ECOLOGY())) {
|
1521
|
return NoteCategory_ecology;
|
1522
|
} else if (feature.equals(Feature.PHENOLOGY())) {
|
1523
|
return NoteCategory_phenology;
|
1524
|
} else if (feature.equals(Feature.DIAGNOSIS())) {
|
1525
|
return NoteCategory_Diagnosis;
|
1526
|
} else if (feature.equals(Feature.COMMON_NAME())) {
|
1527
|
return NoteCategory_Common_names;
|
1528
|
} else if (feature.equals(Feature.OCCURRENCE())) {
|
1529
|
return NoteCategory_Occurrence;
|
1530
|
} else if (feature.equals(Feature.DISTRIBUTION())) {
|
1531
|
return NoteCategory_Distribution;
|
1532
|
} else if (feature.equals(Feature.ETYMOLOGY())) {
|
1533
|
return NoteCategory_Etymology;
|
1534
|
} else if (feature.getUuid().equals(ErmsTransformer.uuidAcknowledgments)){
|
1535
|
return NoteCategory_Acknowledgments;
|
1536
|
} else if (feature.getUuid().equals(ErmsTransformer.uuidAdditionalinformation)) {
|
1537
|
return NoteCategory_Additional_information;
|
1538
|
} else if (feature.getUuid().equals(ErmsTransformer.uuidAlienSpecies)) {
|
1539
|
return NoteCategory_Alien_Species;
|
1540
|
} else if (feature.getUuid().equals(ErmsTransformer.uuidAuthority)) {
|
1541
|
return NoteCategory_Authority;
|
1542
|
} else if (feature.getUuid().equals(ErmsTransformer.uuidDepthRange)) {
|
1543
|
return NoteCategory_Depth_Range;
|
1544
|
} else if (feature.getUuid().equals(ErmsTransformer.uuidBiology)) {
|
1545
|
return NoteCategory_Biology;
|
1546
|
} else if (feature.getUuid().equals(ErmsTransformer.uuidClassification)) {
|
1547
|
return NoteCategory_Classification;
|
1548
|
} else if (feature.getUuid().equals(ErmsTransformer.uuidDiet)) {
|
1549
|
return NoteCategory_Diet;
|
1550
|
} else if (feature.getUuid().equals(ErmsTransformer.uuidDimensions)) {
|
1551
|
return NoteCategory_Dimensions;
|
1552
|
} else if (feature.getUuid().equals(ErmsTransformer.uuidEditorsComment)) {
|
1553
|
return NoteCategory_Editors_Comment;
|
1554
|
} else if (feature.getUuid().equals(ErmsTransformer.uuidEnvironment)) {
|
1555
|
return NoteCategory_Environment;
|
1556
|
} else if (feature.getUuid().equals(ErmsTransformer.uuidFossilRange)) {
|
1557
|
return NoteCategory_Fossil_Range;
|
1558
|
} else if (feature.getUuid().equals(ErmsTransformer.uuidGrammaticalGender)) {
|
1559
|
return NoteCategory_Grammatical_Gender;
|
1560
|
} else if (feature.getUuid().equals(ErmsTransformer.uuidHabitat)) {
|
1561
|
return NoteCategory_Habitat;
|
1562
|
} else if (feature.getUuid().equals(ErmsTransformer.uuidHomonymy)) {
|
1563
|
return NoteCategory_Homonymy;
|
1564
|
} else if (feature.getUuid().equals(ErmsTransformer.uuidIdentification)) {
|
1565
|
return NoteCategory_Identification;
|
1566
|
} else if (feature.getUuid().equals(ErmsTransformer.uuidIntroducedSpeciesRemark)) {
|
1567
|
return NoteCategory_Introduced_Species_Remark;
|
1568
|
} else if (feature.getUuid().equals(ErmsTransformer.uuidMorphology)) {
|
1569
|
return NoteCategory_Morphology;
|
1570
|
} else if (feature.getUuid().equals(ErmsTransformer.uuidNewCombination)) {
|
1571
|
return NoteCategory_New_Combination;
|
1572
|
} else if (feature.getUuid().equals(ErmsTransformer.uuidNomenclature)) {
|
1573
|
return NoteCategory_Nomenclature;
|
1574
|
} else if (feature.getUuid().equals(ErmsTransformer.uuidNote)){
|
1575
|
return NoteCategory_Note;
|
1576
|
} else if (feature.getUuid().equals(ErmsTransformer.uuidOriginalCombination)) {
|
1577
|
return NoteCategory_Original_Combination;
|
1578
|
} else if (feature.getUuid().equals(ErmsTransformer.uuidOriginalDescription)) {
|
1579
|
return NoteCategory_Original_Description;
|
1580
|
} else if (feature.getUuid().equals(ErmsTransformer.uuidOriginalpublication)) {
|
1581
|
return NoteCategory_Original_publication;
|
1582
|
} else if (feature.getUuid().equals(ErmsTransformer.uuidPublicationdate)) {
|
1583
|
return NoteCategory_Publication_date;
|
1584
|
} else if (feature.getUuid().equals(ErmsTransformer.uuidRank)) {
|
1585
|
return NoteCategory_Rank;
|
1586
|
} else if (feature.getUuid().equals(ErmsTransformer.uuidRemark)) {
|
1587
|
return NoteCategory_Remark;
|
1588
|
} else if (feature.getUuid().equals(ErmsTransformer.uuidReproduction)) {
|
1589
|
return NoteCategory_Reproduction;
|
1590
|
} else if (feature.getUuid().equals(ErmsTransformer.uuidSpelling)) {
|
1591
|
return NoteCategory_Spelling;
|
1592
|
} else if (feature.getUuid().equals(ErmsTransformer.uuidSpecimen)) {
|
1593
|
return NoteCategory_Specimen;
|
1594
|
} else if (feature.getUuid().equals(ErmsTransformer.uuidStatus)){
|
1595
|
return NoteCategory_Status;
|
1596
|
} else if (feature.getUuid().equals(ErmsTransformer.uuidSynonymy)) {
|
1597
|
return NoteCategory_Synonymy;
|
1598
|
} else if (feature.getUuid().equals(ErmsTransformer.uuidSyntype)) {
|
1599
|
return NoteCategory_Syntype;
|
1600
|
} else if (feature.getUuid().equals(ErmsTransformer.uuidSystematics)) {
|
1601
|
return NoteCategory_Systematics;
|
1602
|
} else if (feature.getUuid().equals(ErmsTransformer.uuidTaxonomicRemarks)) {
|
1603
|
return NoteCategory_Taxonomic_Remarks;
|
1604
|
} else if (feature.getUuid().equals(ErmsTransformer.uuidTaxonomy)) {
|
1605
|
return NoteCategory_Taxonomy;
|
1606
|
} else if (feature.getUuid().equals(ErmsTransformer.uuidTaxonomicstatus)) {
|
1607
|
return NoteCategory_Taxonomic_status;
|
1608
|
} else if (feature.getUuid().equals(ErmsTransformer.uuidTypelocality)) {
|
1609
|
return NoteCategory_Type_locality;
|
1610
|
} else if (feature.getUuid().equals(ErmsTransformer.uuidTypeMaterial)) {
|
1611
|
return NoteCategory_Type_Material;
|
1612
|
} else if (feature.getUuid().equals(ErmsTransformer.uuidTypeSpecimen)) {
|
1613
|
return NoteCategory_Type_Specimen;
|
1614
|
} else if (feature.getUuid().equals(ErmsTransformer.uuidTypespecies)) {
|
1615
|
return NoteCategory_Type_species;
|
1616
|
} else if (feature.getUuid().equals(ErmsTransformer.uuidTaxonomicRemark)) {
|
1617
|
return NoteCategory_Taxonomic_Remark;
|
1618
|
} else if (feature.getUuid().equals(ErmsTransformer.uuidValidity)) {
|
1619
|
return NoteCategory_Validity;
|
1620
|
|
1621
|
// } else if (feature.getUuid().equals(ErmsTransformer.uuidSourceOfSynonymy)) {
|
1622
|
// logger.debug("Source of synonymy not yet handled");
|
1623
|
// return null;
|
1624
|
} else if (feature.equals(Feature.CITATION())) {
|
1625
|
return null; //citations are handled differently
|
1626
|
} else if (feature.getUuid().equals(BerlinModelTransformer.uuidFeatureMaps)){
|
1627
|
return NoteCategory_Link_to_maps;
|
1628
|
} else if (feature.getUuid().equals(BerlinModelTransformer.uuidFeatureUse)){
|
1629
|
return NoteCategory_Use;
|
1630
|
} else if (feature.getUuid().equals(BerlinModelTransformer.uuidFeatureComments)){
|
1631
|
return NoteCategory_Comments;
|
1632
|
} else if (feature.getUuid().equals(BerlinModelTransformer.uuidFeatureConservationStatus)){
|
1633
|
return NoteCategory_Conservation_Status;
|
1634
|
|
1635
|
//E+M
|
1636
|
} else if (feature.getUuid().equals(BerlinModelTransformer.uuidFeatureDistrEM)){
|
1637
|
return NoteCategory_general_distribution_euromed;
|
1638
|
} else if (feature.getUuid().equals(BerlinModelTransformer.uuidFeatureDistrWorld)){
|
1639
|
return NoteCategory_general_distribution_world;
|
1640
|
} else if (feature.getUuid().equals(BerlinModelTransformer.uuidFeatureEditorBrackets)){
|
1641
|
return NoteCategory_Editor_Brackets;
|
1642
|
} else if (feature.getUuid().equals(BerlinModelTransformer.uuidFeatureEditorParenthesis)){
|
1643
|
return NoteCategory_Editor_Parenthesis;
|
1644
|
} else if (feature.getUuid().equals(BerlinModelTransformer.uuidFeatureInedited)){
|
1645
|
return NoteCategory_Inedited;
|
1646
|
} else if (feature.getUuid().equals(BerlinModelTransformer.uuidFeatureCommentsEditing)){
|
1647
|
return NoteCategory_Comments_on_editing_process;
|
1648
|
|
1649
|
}else{
|
1650
|
logger.warn("Unhandled Feature: " + feature.getTitleCache());
|
1651
|
return null;
|
1652
|
}
|
1653
|
}
|
1654
|
|
1655
|
/**
|
1656
|
* Returns the string representation for a given rank.
|
1657
|
*/
|
1658
|
public String getCacheByRankAndKingdom(Rank rank, Integer pesiKingdomId) {
|
1659
|
if (rank == null){
|
1660
|
return null;
|
1661
|
}else if (pesiKingdomId == null && rank.equals(Rank.DOMAIN())){ //might be Superdomain in future
|
1662
|
return this.rankCacheMap.get(0).get(0);
|
1663
|
}else{
|
1664
|
Map<Integer, String> rankMap = this.rankCacheMap.get(pesiKingdomId);
|
1665
|
if (rankMap != null){
|
1666
|
return rankMap.get(rank2RankId(rank, pesiKingdomId));
|
1667
|
}else{
|
1668
|
logger.warn("RankCacheMap is null for " + pesiKingdomId);
|
1669
|
return null;
|
1670
|
}
|
1671
|
}
|
1672
|
}
|
1673
|
|
1674
|
/**
|
1675
|
* Returns the identifier of a PESI specific kingdom for a given CDM nomenclatural code.
|
1676
|
* @param nomenclaturalCode
|
1677
|
* @return KINGDOM_ANIMALIA for NomenclaturalCode.ICZN, KINGDOM_PLANTAE for NomenclaturalCode.ICNAFP
|
1678
|
*/
|
1679
|
public static Integer nomenclaturalCode2Kingdom(NomenclaturalCode nomenclaturalCode) {
|
1680
|
Integer result = null;
|
1681
|
// TODO: This needs to be refined. For now we differentiate between animalia, plantae and bacteria only.
|
1682
|
if (nomenclaturalCode.equals(NomenclaturalCode.ICZN)) {
|
1683
|
result = KINGDOM_ANIMALIA;
|
1684
|
} else if (nomenclaturalCode.equals(NomenclaturalCode.ICNAFP)) {
|
1685
|
result = KINGDOM_PLANTAE;
|
1686
|
} else if (nomenclaturalCode.equals(NomenclaturalCode.ICNB)) {
|
1687
|
result = KINGDOM_BACTERIA;
|
1688
|
// } else if (nomenclaturalCode.equals(NomenclaturalCode.)) { // Biota
|
1689
|
// result =
|
1690
|
} else {
|
1691
|
logger.error("NomenclaturalCode not yet considered: " + nomenclaturalCode.getUuid() + " (" + nomenclaturalCode.getTitleCache() + ")");
|
1692
|
}
|
1693
|
return result;
|
1694
|
}
|
1695
|
|
1696
|
/**
|
1697
|
* Returns the RankId for a Rank.
|
1698
|
* @param rank
|
1699
|
* @return
|
1700
|
*/
|
1701
|
public static Integer rank2RankId (Rank rank, Integer pesiKingdomId) {
|
1702
|
Integer result = null;
|
1703
|
if (rank == null) {
|
1704
|
return null;
|
1705
|
}else if (rank.equals(Rank.DOMAIN())){
|
1706
|
return KINGDOM_NULL;
|
1707
|
}else if (rank.equals(Rank.KINGDOM())) {
|
1708
|
result = Kingdom;
|
1709
|
}else if (rank.equals(Rank.SUBKINGDOM())) {
|
1710
|
result = Subkingdom;
|
1711
|
} else if (rank.equals(Rank.PHYLUM())) {
|
1712
|
result = Phylum;
|
1713
|
}else if (rank.equals(Rank.DIVISION())) { //same as Phylum
|
1714
|
result = Division;
|
1715
|
}else if (rank.equals(Rank.SUBPHYLUM())) {
|
1716
|
result = Subphylum;
|
1717
|
}else if (rank.equals(Rank.SUBDIVISION())) { //same as Subphylum
|
1718
|
result = Subdivision;
|
1719
|
}else if (rank.equals(Rank.CLASS())) {
|
1720
|
result = Class;
|
1721
|
} else if (rank.equals(Rank.SUBCLASS())) {
|
1722
|
result = Subclass;
|
1723
|
} else if (rank.equals(Rank.ORDER())) {
|
1724
|
result = Order;
|
1725
|
} else if (rank.equals(Rank.SUBORDER())) {
|
1726
|
result = Suborder;
|
1727
|
} else if (rank.equals(Rank.FAMILY())) {
|
1728
|
result = Family;
|
1729
|
} else if (rank.equals(Rank.SUBFAMILY())) {
|
1730
|
result = Subfamily;
|
1731
|
} else if (rank.equals(Rank.TRIBE())) {
|
1732
|
result = Tribe;
|
1733
|
} else if (rank.equals(Rank.SUBTRIBE())) {
|
1734
|
result = Subtribe;
|
1735
|
} else if (rank.equals(Rank.GENUS())) {
|
1736
|
result = Genus;
|
1737
|
} else if (rank.equals(Rank.SUBGENUS())) {
|
1738
|
result = Subgenus;
|
1739
|
} else if (rank.equals(Rank.SPECIES())) {
|
1740
|
result = Species;
|
1741
|
} else if (rank.equals(Rank.SUBSPECIES())) {
|
1742
|
result = Subspecies;
|
1743
|
} else if (rank.equals(Rank.VARIETY())) {
|
1744
|
result = Variety;
|
1745
|
} else if (rank.equals(Rank.FORM())) {
|
1746
|
result = Forma;
|
1747
|
} else
|
1748
|
|
1749
|
// We differentiate between Animalia and Plantae only for now.
|
1750
|
if (pesiKingdomId != null && pesiKingdomId.intValue() == KINGDOM_ANIMALIA) {
|
1751
|
if (rank.equals(Rank.INFRAKINGDOM())) {result = Infrakingdom;
|
1752
|
} else if (rank.equals(Rank.SUPERPHYLUM())) {result = Superphylum;
|
1753
|
} else if (rank.equals(Rank.INFRAPHYLUM())) {result = Infraphylum;
|
1754
|
} else if (rank.equals(Rank.SUPERCLASS())) {result = Superclass;
|
1755
|
} else if (rank.equals(Rank.INFRACLASS())) {result = Infraclass;
|
1756
|
} else if (rank.getUuid().equals(ErmsTransformer.uuidRankSubterclass)) {result = Subterclass;
|
1757
|
} else if (rank.equals(Rank.SUPERORDER())) {result = Superorder;
|
1758
|
} else if (rank.equals(Rank.INFRAORDER())) {result = Infraorder;
|
1759
|
} else if (rank.getUuid().equals(ErmsTransformer.uuidRankParvorder)) {result = Parvorder;
|
1760
|
} else if (rank.equals(Rank.SECTION_ZOOLOGY())) {result = Animalia_Section;
|
1761
|
} else if (rank.equals(Rank.SUBSECTION_ZOOLOGY())) {result = Animalia_Subsection;
|
1762
|
} else if (rank.equals(Rank.SUPERFAMILY())) {result = Superfamily;
|
1763
|
} else if (rank.equals(Rank.NATIO())) {result = Natio;
|
1764
|
} else if (rank.equals(Rank.SUBVARIETY())) {result = Subvariety;
|
1765
|
} else if (rank.equals(Rank.SUBFORM())) {result = Subform;
|
1766
|
} else {
|
1767
|
//TODO Exception
|
1768
|
logger.warn("Rank for Kingdom Animalia not yet supported in CDM: "+ rank.getLabel());
|
1769
|
return null;
|
1770
|
}
|
1771
|
} else if (pesiKingdomId != null && pesiKingdomId.intValue() == KINGDOM_PLANTAE) {
|
1772
|
if (rank.equals(Rank.INFRAKINGDOM())) {result = Infrakingdom;
|
1773
|
} else if (rank.equals(Rank.SUPERORDER())) {result = Superorder;
|
1774
|
} else if (rank.equals(Rank.SECTION_BOTANY())) {result = Bot_Section;
|
1775
|
} else if (rank.equals(Rank.SUBSECTION_BOTANY())) {result = Bot_Subsection;
|
1776
|
} else if (rank.equals(Rank.SERIES())) {result = Series;
|
1777
|
} else if (rank.equals(Rank.SUBSERIES())) {result = Subseries;
|
1778
|
} else if (rank.equals(Rank.SPECIESAGGREGATE() )) {result = Aggregate;
|
1779
|
} else if (rank.equals(Rank.SPECIESGROUP())) {
|
1780
|
logger.warn("Rank Species Group not yet implemented");
|
1781
|
result = null;
|
1782
|
} else if (rank.getUuid().equals(Rank.uuidCollSpecies)) {result = Coll_Species;
|
1783
|
} else if (rank.equals(Rank.GREX())) {result = Grex;
|
1784
|
} else if (rank.getUuid().equals(Rank.uuidProles) ) {result = Proles;
|
1785
|
} else if (rank.getUuid().equals(Rank.uuidRace)) {result = Race;
|
1786
|
} else if (rank.equals(Rank.CONVAR())) {result = Convarietas;
|
1787
|
} else if (rank.equals(Rank.SUBVARIETY())) {result = Subvariety;
|
1788
|
} else if (rank.equals(Rank.SUBFORM())) {result = Subform;
|
1789
|
} else if (rank.equals(Rank.SPECIALFORM())) {result = Forma_spec;
|
1790
|
} else if (rank.equals(Rank.INFRAGENERICTAXON())) {result = Taxa_infragen;
|
1791
|
} else if (rank.equals(Rank.INFRASPECIFICTAXON())) {result = Taxa_infraspec;
|
1792
|
} else {
|
1793
|
//TODO Exception
|
1794
|
logger.warn("Rank for Kingdom Plantae not yet supported in CDM: "+ rank.getLabel());
|
1795
|
return null;
|
1796
|
}
|
1797
|
} else if (pesiKingdomId != null && pesiKingdomId.intValue() == KINGDOM_FUNGI) {
|
1798
|
if (rank.equals(Rank.SECTION_BOTANY())) { result = Bot_Section;
|
1799
|
} else if (rank.equals(Rank.SUBSECTION_BOTANY())) { result = Bot_Subsection;
|
1800
|
} else if (rank.equals(Rank.SUBVARIETY())) { result = Subvariety;
|
1801
|
} else if (rank.equals(Rank.SUBFORM())) { result = Subform;
|
1802
|
} else if (rank.equals(Rank.SPECIALFORM())) {result = Forma_spec;
|
1803
|
} else {
|
1804
|
//TODO Exception
|
1805
|
logger.warn("Rank for Kingdom Fungi not yet supported in CDM: "+ rank.getLabel());
|
1806
|
return null;
|
1807
|
}
|
1808
|
}else if (pesiKingdomId != null && pesiKingdomId.intValue() == KINGDOM_PROTOZOA) {
|
1809
|
if (rank.equals(Rank.INFRAKINGDOM())) { result = Infrakingdom;
|
1810
|
} else if (rank.equals(Rank.SUPERCLASS())) { result = Superclass;
|
1811
|
} else if (rank.equals(Rank.INFRACLASS())) { result = Infraclass;
|
1812
|
} else if (rank.equals(Rank.SUPERORDER())) { result = Superorder;
|
1813
|
} else if (rank.equals(Rank.INFRAORDER())) { result = Infraorder;
|
1814
|
} else if (rank.equals(Rank.SUPERFAMILY())) { result = Superfamily;
|
1815
|
} else if (rank.equals(Rank.SPECIALFORM())) {result = Forma_spec;
|
1816
|
} else {
|
1817
|
//TODO Exception
|
1818
|
logger.warn("Rank for Kingdom Protozoa not yet supported in CDM: "+ rank.getLabel());
|
1819
|
return null;
|
1820
|
}
|
1821
|
} else if (pesiKingdomId != null && pesiKingdomId.intValue() == KINGDOM_BACTERIA) {
|
1822
|
if (rank.equals(Rank.SUPERCLASS())) { result = Superclass;
|
1823
|
} else if (rank.equals(Rank.INFRACLASS())) { result = Infraclass;
|
1824
|
} else if (rank.equals(Rank.SUPERORDER())) { result = Superorder;
|
1825
|
} else if (rank.equals(Rank.INFRAORDER())) { result = Infraorder;
|
1826
|
} else if (rank.equals(Rank.SUPERFAMILY())) { result = Superfamily;
|
1827
|
} else {
|
1828
|
//TODO Exception
|
1829
|
logger.warn("Rank for Kingdom Bacteria not yet supported in CDM: "+ rank.getLabel());
|
1830
|
return null;
|
1831
|
}
|
1832
|
}else if (pesiKingdomId != null && pesiKingdomId.intValue() == KINGDOM_CHROMISTA) {
|
1833
|
if (rank.equals(Rank.INFRAKINGDOM())) { result = Infrakingdom;
|
1834
|
} else if (rank.equals(Rank.INFRAPHYLUM())) { result = Infraphylum;
|
1835
|
} else if (rank.equals(Rank.SUPERCLASS())) { result = Superclass;
|
1836
|
} else if (rank.equals(Rank.INFRACLASS())) { result = Infraclass;
|
1837
|
} else if (rank.equals(Rank.SUPERORDER())) { result = Superorder;
|
1838
|
} else if (rank.equals(Rank.INFRAORDER())) { result = Infraorder;
|
1839
|
} else if (rank.equals(Rank.SUPERFAMILY())) { result = Superfamily;
|
1840
|
} else if (rank.equals(Rank.SECTION_BOTANY())) { result = Bot_Section;
|
1841
|
} else if (rank.equals(Rank.SUBSECTION_BOTANY())) { result = Bot_Subsection;
|
1842
|
} else if (rank.equals(Rank.SUBVARIETY())) { result = Subvariety;
|
1843
|
} else if (rank.equals(Rank.SPECIALFORM())) {result = Forma_spec;
|
1844
|
} else {
|
1845
|
//TODO Exception
|
1846
|
logger.warn("Rank for Kingdom Chromista not yet supported in CDM: "+ rank.getLabel());
|
1847
|
return null;
|
1848
|
}
|
1849
|
}else{
|
1850
|
//TODO Exception
|
1851
|
logger.warn("Kingdom not yet supported in CDM: "+ pesiKingdomId);
|
1852
|
return null;
|
1853
|
}
|
1854
|
return result;
|
1855
|
}
|
1856
|
|
1857
|
public static Integer nameTypeDesignationStatus2TypeDesignationStatusId(NameTypeDesignationStatus nameTypeDesignationStatus) {
|
1858
|
if (nameTypeDesignationStatus == null) {
|
1859
|
return null;
|
1860
|
}
|
1861
|
if (nameTypeDesignationStatus.equals(NameTypeDesignationStatus.ORIGINAL_DESIGNATION())) {
|
1862
|
return TYPE_BY_ORIGINAL_DESIGNATION;
|
1863
|
} else if (nameTypeDesignationStatus.equals(NameTypeDesignationStatus.SUBSEQUENT_DESIGNATION())) {
|
1864
|
return TYPE_BY_SUBSEQUENT_DESIGNATION;
|
1865
|
} else if (nameTypeDesignationStatus.equals(NameTypeDesignationStatus.MONOTYPY())) {
|
1866
|
return TYPE_BY_MONOTYPY;
|
1867
|
} else {
|
1868
|
//TODO Figure out a way to handle this gracefully.
|
1869
|
logger.warn("Name Type Designation Status not yet supported in PESI: "+ nameTypeDesignationStatus.getLabel());
|
1870
|
return null;
|
1871
|
}
|
1872
|
|
1873
|
}
|
1874
|
|
1875
|
public static String nameTypeDesignationStatus2TypeDesignationStatusCache(NameTypeDesignationStatus nameTypeDesignationStatus) {
|
1876
|
if (nameTypeDesignationStatus == null) {
|
1877
|
return null;
|
1878
|
}
|
1879
|
if (nameTypeDesignationStatus.equals(NameTypeDesignationStatus.ORIGINAL_DESIGNATION())) {
|
1880
|
return TYPE_STR_BY_ORIGINAL_DESIGNATION;
|
1881
|
} else if (nameTypeDesignationStatus.equals(NameTypeDesignationStatus.SUBSEQUENT_DESIGNATION())) {
|
1882
|
return TYPE_STR_BY_SUBSEQUENT_DESIGNATION;
|
1883
|
} else if (nameTypeDesignationStatus.equals(NameTypeDesignationStatus.MONOTYPY())) {
|
1884
|
return TYPE_STR_BY_MONOTYPY;
|
1885
|
} else {
|
1886
|
//TODO Figure out a way to handle this gracefully.
|
1887
|
logger.warn("Name Type Designation Status not yet supported in PESI: "+ nameTypeDesignationStatus.getLabel());
|
1888
|
return null;
|
1889
|
}
|
1890
|
}
|
1891
|
|
1892
|
/**
|
1893
|
* @see PesiTaxonExport#doPhaseUpdates(PesiExportState) for further transformation
|
1894
|
* @param taxonBase
|
1895
|
* @return
|
1896
|
*/
|
1897
|
public static Integer taxonBase2statusFk (TaxonBase<?> taxonBase){
|
1898
|
if (taxonBase == null){
|
1899
|
return null;
|
1900
|
}
|
1901
|
if (taxonBase.isInstanceOf(Taxon.class)){
|
1902
|
Taxon taxon = CdmBase.deproxy(taxonBase, Taxon.class);
|
1903
|
Set<TaxonRelationship> rels = taxon.getRelationsFromThisTaxon();
|
1904
|
Set<TaxonNode> nodes = taxon.getTaxonNodes();
|
1905
|
if (!rels.isEmpty() && !nodes.isEmpty()){
|
1906
|
logger.warn("Taxon has relations and parent. This is not expected in E+M, but maybe possible in ERMS. Check if taxon status is correct.");
|
1907
|
}else if (rels.isEmpty() && nodes.isEmpty()){
|
1908
|
logger.warn("Taxon has neither relations nor parent. This is not expected. Check if taxon status is correct.");
|
1909
|
}
|
1910
|
if (!rels.isEmpty()){
|
1911
|
//we expect all rels to have same type, maybe not true
|
1912
|
UUID relTypeUuid = rels.iterator().next().getType().getUuid();
|
1913
|
//E+M
|
1914
|
if (TaxonRelationshipType.proParteUuids().contains(relTypeUuid)){
|
1915
|
return T_STATUS_PRO_PARTE_SYN;
|
1916
|
}else if (TaxonRelationshipType.partialUuids().contains(relTypeUuid)){
|
1917
|
return T_STATUS_PARTIAL_SYN;
|
1918
|
}else if (TaxonRelationshipType.misappliedNameUuids().contains(relTypeUuid)){
|
1919
|
return T_STATUS_SYNONYM; //no explicit MAN status exists in PESI
|
1920
|
}
|
1921
|
//ERMS
|
1922
|
else if (TaxonRelationshipType.pseudoTaxonUuids().contains(relTypeUuid)){
|
1923
|
return T_STATUS_SYNONYM;
|
1924
|
}
|
1925
|
}
|
1926
|
if (!nodes.isEmpty()){
|
1927
|
TaxonNode parentNode = nodes.iterator().next().getParent();
|
1928
|
if (parentNode.getTaxon() != null && !parentNode.getTaxon().isPublish()){
|
1929
|
if (parentNode.getTaxon().getUuid().equals(uuidTaxonValuelessEuroMed) ){
|
1930
|
return T_STATUS_NOT_ACCEPTED_VALUELESS;
|
1931
|
}
|
1932
|
}else{
|
1933
|
return T_STATUS_ACCEPTED;
|
1934
|
}
|
1935
|
}
|
1936
|
logger.error("Taxon status could not be defined. This should not happen: " + taxonBase.getTitleCache() );
|
1937
|
return T_STATUS_UNRESOLVED;
|
1938
|
}else if (taxonBase.isInstanceOf(Synonym.class)){
|
1939
|
Synonym synonym = CdmBase.deproxy(taxonBase, Synonym.class);
|
1940
|
if (taxonBase2statusFk(synonym.getAcceptedTaxon())== T_STATUS_NOT_ACCEPTED_VALUELESS ){
|
1941
|
return T_STATUS_NOT_ACCEPTED_VALUELESS;
|
1942
|
}else{
|
1943
|
return T_STATUS_SYNONYM;
|
1944
|
}
|
1945
|
}else{
|
1946
|
logger.warn("Unresolved taxon status.");
|
1947
|
return T_STATUS_UNRESOLVED;
|
1948
|
}
|
1949
|
//TODO
|
1950
|
// public static int T_STATUS_UNRESOLVED = 5;
|
1951
|
// public static int T_STATUS_ORPHANED = 6;
|
1952
|
}
|
1953
|
|
1954
|
// /**
|
1955
|
// *
|
1956
|
// * @param taxonBase
|
1957
|
// * @return
|
1958
|
// */
|
1959
|
// public static String taxonBase2statusCache (TaxonBase<?> taxonBase){
|
1960
|
// if (taxonBase == null){return null;}
|
1961
|
// if (taxonBase.isInstanceOf(Taxon.class)){
|
1962
|
// Taxon taxon = CdmBase.deproxy(taxonBase, Taxon.class);
|
1963
|
// if (taxon.getTaxonNodes().size() == 0){
|
1964
|
// return T_STATUS_STR_NOT_ACCEPTED;
|
1965
|
// }else{
|
1966
|
// return T_STATUS_STR_ACCEPTED;
|
1967
|
// }
|
1968
|
// }else if (taxonBase.isInstanceOf(Synonym.class)){
|
1969
|
// return T_STATUS_STR_SYNONYM;
|
1970
|
// }else{
|
1971
|
// logger.warn("Unknown ");
|
1972
|
// return T_STATUS_STR_UNRESOLVED;
|
1973
|
// }
|
1974
|
// //TODO
|
1975
|
// public static int T_STATUS_STR_PARTIAL_SYN = 3;
|
1976
|
// public static int T_STATUS_STR_PRO_PARTE_SYN = 4;
|
1977
|
// public static int T_STATUS_STR_UNRESOLVED = 5;
|
1978
|
// public static int T_STATUS_STR_ORPHANED = 6;
|
1979
|
// }
|
1980
|
|
1981
|
/**
|
1982
|
* Returns the {@link SourceCategory SourceCategory} representation of the given {@link ReferenceType ReferenceType} in PESI.
|
1983
|
* @param reference The {@link Reference Reference}.
|
1984
|
* @return The {@link SourceCategory SourceCategory} representation in PESI.
|
1985
|
*/
|
1986
|
public static Integer reference2SourceCategoryFK(Reference reference) {
|
1987
|
if (reference == null){
|
1988
|
return null;
|
1989
|
} else if (reference.getType().equals(ReferenceType.Article)) {
|
1990
|
return REF_ARTICLE_IN_PERIODICAL;
|
1991
|
} else if (reference.getType().equals(ReferenceType.Book)) {
|
1992
|
return REF_BOOK;
|
1993
|
} else if (reference.getType().equals(ReferenceType.BookSection)) {
|
1994
|
return REF_PART_OF_OTHER;
|
1995
|
} else if (reference.getType().equals(ReferenceType.Section)) {
|
1996
|
return REF_PART_OF_OTHER;
|
1997
|
} else if (reference.getType().equals(ReferenceType.Database)) {
|
1998
|
return REF_DATABASE;
|
1999
|
} else if (reference.getType().equals(ReferenceType.WebPage)) {
|
2000
|
return REF_WEBSITE;
|
2001
|
} else if (reference.getType().equals(ReferenceType.CdDvd)) {
|
2002
|
return REF_NOT_APPLICABLE;
|
2003
|
} else if (reference.getType().equals(ReferenceType.Journal)) {
|
2004
|
return REF_JOURNAL;
|
2005
|
} else if (reference.getType().equals(ReferenceType.PrintSeries)) {
|
2006
|
return REF_PUBLICATION; //?
|
2007
|
} else if (reference.getType().equals(ReferenceType.Proceedings)) {
|
2008
|
return REF_PUBLICATION; //?
|
2009
|
} else if (reference.getType().equals(ReferenceType.Patent)) {
|
2010
|
return REF_NOT_APPLICABLE;
|
2011
|
} else if (reference.getType().equals(ReferenceType.PersonalCommunication)) {
|
2012
|
return REF_INFORMAL;
|
2013
|
} else if (reference.getType().equals(ReferenceType.Report)) {
|
2014
|
return REF_NOT_APPLICABLE;
|
2015
|
} else if (reference.getType().equals(ReferenceType.Thesis)) {
|
2016
|
return REF_NOT_APPLICABLE;
|
2017
|
} else if (reference.getType().equals(ReferenceType.Generic)) {
|
2018
|
if(reference.hasMarker(ErmsTransformer.uuidMarkerRefPublication, true)){
|
2019
|
return REF_PUBLICATION;
|
2020
|
}else if(reference.hasMarker(ErmsTransformer.uuidMarkerRefInformal, true)){
|
2021
|
return REF_INFORMAL;
|
2022
|
}else if(reference.hasMarker(ErmsTransformer.uuidMarkerRefTypeI, true)){
|
2023
|
logger.warn("ERMS ref type 'i' is not yet correctly matched to PESI");
|
2024
|
return REF_INFORMAL;
|
2025
|
}else{
|
2026
|
return REF_UNRESOLVED;
|
2027
|
}
|
2028
|
} else {
|
2029
|
logger.warn("Reference type not yet supported in PESI: "+ reference.getType());
|
2030
|
return null;
|
2031
|
}
|
2032
|
}
|
2033
|
|
2034
|
/**
|
2035
|
* Returns the {@link SourceCategoryCache SourceCategoryCache}.
|
2036
|
* @param reference The {@link Reference Reference}.
|
2037
|
* @return The {@link SourceCategoryCache SourceCategoryCache}.
|
2038
|
*/
|
2039
|
public String getCacheByReference(Reference reference) {
|
2040
|
if (reference == null){
|
2041
|
return null;
|
2042
|
}else{
|
2043
|
return this.sourceCategoryCacheMap.get(reference2SourceCategoryFK(reference));
|
2044
|
}
|
2045
|
}
|
2046
|
|
2047
|
@Override
|
2048
|
public String getCacheByNomStatus(NomenclaturalStatusType status) {
|
2049
|
if (status == null){
|
2050
|
return null;
|
2051
|
}else{
|
2052
|
return this.nameStatusCacheMap.get(nomStatus2nomStatusFk(status));
|
2053
|
}
|
2054
|
}
|
2055
|
|
2056
|
public static Integer nomStatus2nomStatusFk (NomenclaturalStatusType status){
|
2057
|
if (status == null){
|
2058
|
return null;
|
2059
|
}
|
2060
|
if (status.equals(NomenclaturalStatusType.INVALID())) {return NAME_ST_NOM_INVAL;
|
2061
|
}else if (status.equals(NomenclaturalStatusType.ILLEGITIMATE())) {return NAME_ST_NOM_ILLEG;
|
2062
|
}else if (status.equals(NomenclaturalStatusType.NUDUM())) {return NAME_ST_NOM_NUD;
|
2063
|
}else if (status.equals(NomenclaturalStatusType.REJECTED())) {return NAME_ST_NOM_REJ;
|
2064
|
}else if (status.equals(NomenclaturalStatusType.REJECTED_PROP())) {return NAME_ST_NOM_REJ_PROP;
|
2065
|
}else if (status.equals(NomenclaturalStatusType.UTIQUE_REJECTED())) {return NAME_ST_NOM_UTIQUE_REJ;
|
2066
|
}else if (status.equals(NomenclaturalStatusType.UTIQUE_REJECTED_PROP())) {return NAME_ST_NOM_UTIQUE_REJ_PROP;
|
2067
|
}else if (status.equals(NomenclaturalStatusType.CONSERVED())) {return NAME_ST_NOM_CONS;
|
2068
|
|
2069
|
}else if (status.equals(NomenclaturalStatusType.CONSERVED_PROP())) {return NAME_ST_NOM_CONS_PROP;
|
2070
|
}else if (status.equals(NomenclaturalStatusType.ORTHOGRAPHY_CONSERVED())) {return NAME_ST_ORTH_CONS;
|
2071
|
}else if (status.equals(NomenclaturalStatusType.ORTHOGRAPHY_CONSERVED_PROP())) {return NAME_ST_ORTH_CONS_PROP;
|
2072
|
}else if (status.equals(NomenclaturalStatusType.SUPERFLUOUS())) {return NAME_ST_NOM_SUPERFL;
|
2073
|
}else if (status.equals(NomenclaturalStatusType.AMBIGUOUS())) {return NAME_ST_NOM_AMBIG;
|
2074
|
}else if (status.equals(NomenclaturalStatusType.PROVISIONAL())) {return NAME_ST_NOM_PROVIS;
|
2075
|
}else if (status.equals(NomenclaturalStatusType.DOUBTFUL())) {return NAME_ST_NOM_DUB;
|
2076
|
}else if (status.equals(NomenclaturalStatusType.NOVUM())) {return NAME_ST_NOM_NOV;
|
2077
|
|
2078
|
}else if (status.equals(NomenclaturalStatusType.CONFUSUM())) {return NAME_ST_NOM_CONFUS;
|
2079
|
}else if (status.equals(NomenclaturalStatusType.ALTERNATIVE())) {return NAME_ST_NOM_ALTERN;
|
2080
|
}else if (status.equals(NomenclaturalStatusType.COMBINATION_INVALID())) {return NAME_ST_COMB_INVAL;
|
2081
|
}else if (status.equals(NomenclaturalStatusType.LEGITIMATE())) {return NAME_ST_LEGITIMATE;
|
2082
|
|
2083
|
}else if (status.getUuid().equals(BerlinModelTransformer.uuidNomStatusCombIned)||
|
2084
|
//FIXME deduplicate COMB_NOV
|
2085
|
status.equals(NomenclaturalStatusType.COMB_NOV())) {return NAME_ST_COMB_INED;
|
2086
|
}else if (status.getUuid().equals(BerlinModelTransformer.uuidNomStatusNomOrthCons)) {return NAME_ST_NOM_AND_ORTH_CONS;
|
2087
|
}else if (status.getUuid().equals(BerlinModelTransformer.uuidNomStatusSpNovIned)) {return NAME_ST_SP_NOV_INED;
|
2088
|
|
2089
|
|
2090
|
// The following are non-existent in CDM
|
2091
|
// }else if (status.equals(NomenclaturalStatusType.)) {return NAME_ST_COMB_AND_STAT_INED;
|
2092
|
// }else if (status.equals(NomenclaturalStatusType.)) {return NAME_ST_NOM_NOV_INED;
|
2093
|
}else if (status.getUuid().equals(ErmsTransformer.uuidNomStatusAlternateRepresentation)) {return NAME_ST_ALTERNATE_REPRESENTATION;
|
2094
|
}else if (status.getUuid().equals(uuidNomStatusTemporaryName)) {return NAME_ST_TEMPORARY_NAME;
|
2095
|
}else if (status.getUuid().equals(ErmsTransformer.uuidNomStatusSpeciesInquirenda)) {return NAME_ST_SPECIES_INQUIRENDA;
|
2096
|
|
2097
|
//TODO
|
2098
|
}else {
|
2099
|
//TODO Exception
|
2100
|
logger.warn("NomStatus type not yet supported by PESI export: "+ status);
|
2101
|
return null;
|
2102
|
}
|
2103
|
}
|
2104
|
|
2105
|
/**
|
2106
|
* Returns the RelTaxonQualifierCache for a given taxonRelation.
|
2107
|
* @param relation
|
2108
|
* @return
|
2109
|
*/
|
2110
|
public String getCacheByRelationshipType(RelationshipBase relation, NomenclaturalCode code){
|
2111
|
if (relation == null){
|
2112
|
return null;
|
2113
|
}else{
|
2114
|
String result;
|
2115
|
Integer key = taxonRelation2RelTaxonQualifierFk(relation);
|
2116
|
if (code.equals(NomenclaturalCode.ICZN)){
|
2117
|
result = this.taxRelZooQualifierCacheMap.get(key);
|
2118
|
if (result == null){
|
2119
|
result = this.taxRelQualifierCacheMap.get(key);
|
2120
|
}
|
2121
|
}else{
|
2122
|
result = this.taxRelQualifierCacheMap.get(key);
|
2123
|
}
|
2124
|
return result;
|
2125
|
}
|
2126
|
}
|
2127
|
|
2128
|
public String getCacheBySynonymType(Synonym synonym, NomenclaturalCode code){
|
2129
|
if (synonym == null){
|
2130
|
return null;
|
2131
|
}else{
|
2132
|
String result;
|
2133
|
Integer key = synonym2RelTaxonQualifierFk(synonym);
|
2134
|
if (code.equals(NomenclaturalCode.ICZN)){
|
2135
|
result = this.taxRelZooQualifierCacheMap.get(key);
|
2136
|
if (result == null){
|
2137
|
result = this.taxRelQualifierCacheMap.get(key);
|
2138
|
}
|
2139
|
}else{
|
2140
|
result = this.taxRelQualifierCacheMap.get(key);
|
2141
|
}
|
2142
|
return result;
|
2143
|
}
|
2144
|
}
|
2145
|
|
2146
|
public static Integer synonym2RelTaxonQualifierFk(Synonym synonym) {
|
2147
|
if (synonym == null || synonym.getType() == null){
|
2148
|
return null;
|
2149
|
}
|
2150
|
SynonymType type = synonym.getType();
|
2151
|
if (type.equals(SynonymType.SYNONYM_OF())) {return IS_SYNONYM_OF;
|
2152
|
}else if (type.equals(SynonymType.HOMOTYPIC_SYNONYM_OF())) {return IS_HOMOTYPIC_SYNONYM_OF;
|
2153
|
}else if (type.equals(SynonymType.HETEROTYPIC_SYNONYM_OF())) {return IS_HETEROTYPIC_SYNONYM_OF;
|
2154
|
}else if (type.equals(SynonymType.INFERRED_EPITHET_OF())) {return IS_INFERRED_EPITHET_FOR;
|
2155
|
}else if (type.equals(SynonymType.INFERRED_GENUS_OF())) {return IS_INFERRED_GENUS_FOR;
|
2156
|
}else if (type.equals(SynonymType.POTENTIAL_COMBINATION_OF())) {return IS_POTENTIAL_COMBINATION_FOR;
|
2157
|
}else if (type.equals(SynonymType.INFERRED_SYNONYM_OF())) {
|
2158
|
logger.warn("Inferred synonynm type not yet implemented. Should it realy exist?");
|
2159
|
return null;
|
2160
|
}else{
|
2161
|
logger.warn("Unhandled synonym type: " + type.getTitleCache());
|
2162
|
return null;
|
2163
|
}
|
2164
|
// return IS_PRO_PARTE_SYNONYM_OF;
|
2165
|
// return IS_PARTIAL_SYNONYM_OF;
|
2166
|
// return IS_PRO_PARTE_AND_HOMOTYPIC_SYNONYM_OF;
|
2167
|
// return IS_PARTIAL_AND_HOMOTYPIC_SYNONYM_OF;
|
2168
|
// return IS_PRO_PARTE_AND_HETEROTYPIC_SYNONYM_OF;
|
2169
|
// return IS_PARTIAL_AND_HETEROTYPIC_SYNONYM_OF;
|
2170
|
}
|
2171
|
|
2172
|
|
2173
|
/**
|
2174
|
* Returns the RelTaxonQualifierFk for a TaxonRelation.
|
2175
|
* @param relation
|
2176
|
* @return
|
2177
|
*/
|
2178
|
public static Integer taxonRelation2RelTaxonQualifierFk(RelationshipBase<?,?,?> relation) {
|
2179
|
if (relation == null || relation.getType() == null) {
|
2180
|
return null;
|
2181
|
}
|
2182
|
RelationshipTermBase<?> type = relation.getType();
|
2183
|
if (type.equals(TaxonRelationshipType.MISAPPLIED_NAME_FOR())) {
|
2184
|
return IS_MISAPPLIED_NAME_FOR;
|
2185
|
} else if (type.equals(TaxonRelationshipType.PRO_PARTE_MISAPPLIED_NAME_FOR())) {
|
2186
|
return IS_PRO_PARTE_MISAPPLIED_NAME_FOR;
|
2187
|
} else if (type.equals(TaxonRelationshipType.PRO_PARTE_SYNONYM_FOR())) {
|
2188
|
return IS_PRO_PARTE_SYNONYM_OF;
|
2189
|
} else if (type.equals(TaxonRelationshipType.PARTIAL_SYNONYM_FOR())) {
|
2190
|
return IS_PARTIAL_SYNONYM_OF;
|
2191
|
} else if (type.equals(NameRelationshipType.BASIONYM())) {
|
2192
|
return IS_BASIONYM_FOR;
|
2193
|
} else if (type.equals(NameRelationshipType.LATER_HOMONYM())) {
|
2194
|
return IS_LATER_HOMONYM_OF;
|
2195
|
} else if (type.equals(NameRelationshipType.REPLACED_SYNONYM())) {
|
2196
|
return IS_REPLACED_SYNONYM_FOR;
|
2197
|
} else if (type.equals(NameRelationshipType.VALIDATED_BY_NAME())) {
|
2198
|
return IS_VALIDATION_OF;
|
2199
|
} else if (type.equals(NameRelationshipType.LATER_VALIDATED_BY_NAME())) {
|
2200
|
return IS_LATER_VALIDATION_OF;
|
2201
|
} else if (type.equals(NameRelationshipType.CONSERVED_AGAINST())) {
|
2202
|
return IS_CONSERVED_AGAINST;
|
2203
|
} else if (type.equals(NameRelationshipType.TREATED_AS_LATER_HOMONYM())) {
|
2204
|
return IS_TREATED_AS_LATER_HOMONYM_OF;
|
2205
|
} else if (type.equals(NameRelationshipType.ORTHOGRAPHIC_VARIANT())) {
|
2206
|
return IS_ORTHOGRAPHIC_VARIANT_OF;
|
2207
|
} else if (type.equals(NameRelationshipType.ORIGINAL_SPELLING())) {
|
2208
|
return IS_ORIGINAL_SPELLING_FOR;
|
2209
|
} else if (type.equals(NameRelationshipType.BLOCKING_NAME_FOR())) {
|
2210
|
return IS_BLOCKING_NAME_FOR;
|
2211
|
} else if (type.equals(NameRelationshipType.ALTERNATIVE_NAME())) {
|
2212
|
return IS_ALTERNATIVE_NAME_FOR;
|
2213
|
} else if (type.equals(HybridRelationshipType.FEMALE_PARENT())) {
|
2214
|
return IS_FEMALE_PARENT_OF;
|
2215
|
} else if (type.equals(HybridRelationshipType.MALE_PARENT())) {
|
2216
|
return IS_MALE_PARENT_OF;
|
2217
|
} else if (type.equals(HybridRelationshipType.FIRST_PARENT())) {
|
2218
|
return IS_FIRST_PARENT_OF;
|
2219
|
} else if (type.equals(HybridRelationshipType.SECOND_PARENT())) {
|
2220
|
return IS_SECOND_PARENT_OF;
|
2221
|
} else if (type.getUuid().equals(TaxonRelationshipType.uuidSynonymOfTaxonRelationship)) {
|
2222
|
return IS_SYNONYM_OF;
|
2223
|
} else if (type.getUuid().equals(TaxonRelationshipType.uuidHeterotypicSynonymTaxonRelationship)) {
|
2224
|
return IS_HETEROTYPIC_SYNONYM_OF;
|
2225
|
} else if (type.getUuid().equals(TaxonRelationshipType.uuidHomotypicSynonymTaxonRelationship)) {
|
2226
|
return IS_HOMOTYPIC_SYNONYM_OF;
|
2227
|
} else {
|
2228
|
logger.warn("No equivalent RelationshipType found in datawarehouse for: " + type.getTitleCache());
|
2229
|
}
|
2230
|
|
2231
|
// The following have no equivalent attribute in CDM
|
2232
|
// IS_TYPE_OF
|
2233
|
// IS_CONSERVED_TYPE_OF
|
2234
|
// IS_REJECTED_TYPE_OF
|
2235
|
// IS_REJECTED_IN_FAVOUR_OF
|
2236
|
// HAS_SAME_TYPE_AS
|
2237
|
// IS_LECTOTYPE_OF
|
2238
|
// TYPE_NOT_DESIGNATED
|
2239
|
|
2240
|
|
2241
|
return null;
|
2242
|
}
|
2243
|
/**
|
2244
|
* FIXME still needed?
|
2245
|
* Returns the RelTaxonQualifierFk for a TaxonRelation.
|
2246
|
* @param relation
|
2247
|
* @return
|
2248
|
*/
|
2249
|
public static Integer synonymrelation2RelTaxonQualifierFk(Synonym syn) {
|
2250
|
if (syn.getAcceptedTaxon() == null) {
|
2251
|
return null;
|
2252
|
}
|
2253
|
if (syn.getType().equals(SynonymType.HETEROTYPIC_SYNONYM_OF())){
|
2254
|
return IS_HETEROTYPIC_SYNONYM_OF;
|
2255
|
} else if (syn.getType().equals(SynonymType.HOMOTYPIC_SYNONYM_OF())){
|
2256
|
return IS_HOMOTYPIC_SYNONYM_OF;
|
2257
|
}else if (syn.getType().equals(SynonymType.INFERRED_EPITHET_OF())) {
|
2258
|
return IS_INFERRED_EPITHET_FOR;
|
2259
|
} else if (syn.getType().equals(SynonymType.INFERRED_GENUS_OF())) {
|
2260
|
return IS_INFERRED_GENUS_FOR;
|
2261
|
} else if (syn.getType().equals(SynonymType.POTENTIAL_COMBINATION_OF())) {
|
2262
|
return IS_POTENTIAL_COMBINATION_FOR;
|
2263
|
}
|
2264
|
return IS_SYNONYM_OF;
|
2265
|
|
2266
|
}
|
2267
|
|
2268
|
/**
|
2269
|
* Returns the StatusFk for a given StatusCache.
|
2270
|
* @param StatusCache
|
2271
|
* @return
|
2272
|
*/
|
2273
|
public Integer statusCache2StatusFk(String StatusCache) {
|
2274
|
Integer result = null;
|
2275
|
if (StatusCache.equalsIgnoreCase("Checked by Taxonomic Editor: included in ERMS 1.1")) {
|
2276
|
return 0;
|
2277
|
} else if (StatusCache.equalsIgnoreCase("Added by Database Management Team")) {
|
2278
|
return 2;
|
2279
|
} else if (StatusCache.equalsIgnoreCase("Checked by Taxonomic Editor")) {
|
2280
|
return 3;
|
2281
|
} else if (StatusCache.equalsIgnoreCase("Edited by Database Management Team")) {
|
2282
|
return 4;
|
2283
|
} else {
|
2284
|
logger.error("StatusFk could not be determined. StatusCache unknown: " + StatusCache);
|
2285
|
}
|
2286
|
|
2287
|
return result;
|
2288
|
}
|
2289
|
|
2290
|
/**
|
2291
|
* Returns the FossilStatusFk for a given FossilStatusCache.
|
2292
|
* @param fossilStatusCache
|
2293
|
* @return
|
2294
|
*/
|
2295
|
public Integer fossilStatusCache2FossilStatusFk(String fossilStatusCache) {
|
2296
|
Integer result = null;
|
2297
|
if (fossilStatusCache.equalsIgnoreCase("recent only")) {
|
2298
|
return 1;
|
2299
|
} else if (fossilStatusCache.equalsIgnoreCase("fossil only")) {
|
2300
|
return 2;
|
2301
|
} else if (fossilStatusCache.equalsIgnoreCase("recent + fossil")) {
|
2302
|
return 3;
|
2303
|
} else {
|
2304
|
logger.error("FossilStatusFk could not be determined. FossilStatusCache unknown: " + fossilStatusCache);
|
2305
|
}
|
2306
|
|
2307
|
return result;
|
2308
|
}
|
2309
|
|
2310
|
/**
|
2311
|
* Returns the NoteCategoryFk for a given UUID representing an ExtensionType.
|
2312
|
* @param uuid
|
2313
|
* @return
|
2314
|
*/
|
2315
|
public static Integer getNoteCategoryFk(UUID uuid) {
|
2316
|
Integer result = null;
|
2317
|
if (uuid.equals(uuidExtTaxComment)) {
|
2318
|
result = 270;
|
2319
|
} else if (uuid.equals(uuidExtFauComment)) {
|
2320
|
result = 281;
|
2321
|
} else if (uuid.equals(uuidExtFauExtraCodes)) {
|
2322
|
result = 278;
|
2323
|
}
|
2324
|
return result;
|
2325
|
}
|
2326
|
|
2327
|
/**
|
2328
|
* Returns the NoteCategoryCache for a given UUID representing an ExtensionType.
|
2329
|
* @param uuid
|
2330
|
* @return
|
2331
|
*/
|
2332
|
public static String getNoteCategoryCache(UUID uuid) {
|
2333
|
String result = null;
|
2334
|
if (uuid.equals(uuidExtTaxComment)) {
|
2335
|
result = "Taxonomy";
|
2336
|
} else if (uuid.equals(uuidExtFauComment)) {
|
2337
|
result = "Biology";
|
2338
|
} else if (uuid.equals(uuidExtFauExtraCodes)) {
|
2339
|
result = "Distribution";
|
2340
|
}
|
2341
|
return result;
|
2342
|
}
|
2343
|
|
2344
|
public static Integer getQualityStatusKeyBySource(EnumSet<PesiSource> sources, TaxonName taxonName) {
|
2345
|
if (sources.contains(PesiSource.EM)){
|
2346
|
return QUALITY_STATUS_ADD_BY_DBMT;
|
2347
|
}else if (sources.contains(PesiSource.ERMS)){
|
2348
|
Set<String> statusSet = getAllQualityStatus(taxonName);
|
2349
|
if (statusSet.size() > 1){
|
2350
|
logger.warn("ERMS TaxonName has more than 1 quality status: " + taxonName.getTitleCache() + "; lisd=" + taxonName.getLsid());
|
2351
|
}
|
2352
|
if (statusSet.contains("Checked by Taxonomic Editor: included in ERMS 1.1")){
|
2353
|
return QUALITY_STATUS_CHECKED_EDITOR_ERMS_1_1;
|
2354
|
}else if (statusSet.contains("Added by Database Management Team")){
|
2355
|
return QUALITY_STATUS_ADD_BY_DBMT;
|
2356
|
}else if (statusSet.contains("Checked by Taxonomic Editor")){
|
2357
|
return QUALITY_STATUS_CHECKED_EDITOR;
|
2358
|
}else if (statusSet.contains("Edited by Database Management Team")){
|
2359
|
return QUALITY_STATUS_EDITED_BY_DBMT;
|
2360
|
}else{
|
2361
|
logger.warn("Unknown ERMS quality status: " + statusSet.iterator().next() + " for taxon name " + taxonName.getTitleCache());
|
2362
|
return null;
|
2363
|
}
|
2364
|
}else{
|
2365
|
return null; // TODO needs to be implemented for others
|
2366
|
}
|
2367
|
}
|
2368
|
|
2369
|
|
2370
|
private static Set<String> getAllQualityStatus(TaxonName taxonName) {
|
2371
|
Set<String> result = new HashSet<>();
|
2372
|
for (TaxonBase<?> taxonBase : taxonName.getTaxonBases()){
|
2373
|
result.addAll(taxonBase.getExtensions(ErmsTransformer.uuidExtQualityStatus));
|
2374
|
}
|
2375
|
return result;
|
2376
|
}
|
2377
|
|
2378
|
@Override
|
2379
|
public String getQualityStatusCacheByKey(Integer qualityStatusId) throws UndefinedTransformerMethodException {
|
2380
|
if (qualityStatusId == null){
|
2381
|
return null;
|
2382
|
}else{
|
2383
|
return this.qualityStatusCacheMap.get(qualityStatusId);
|
2384
|
}
|
2385
|
}
|
2386
|
|
2387
|
|
2388
|
public Object getSourceUseCacheByKey(Integer sourceUseFk) {
|
2389
|
if (sourceUseFk == null){
|
2390
|
return null;
|
2391
|
}else{
|
2392
|
return this.sourceUseCacheMap.get(sourceUseFk);
|
2393
|
}
|
2394
|
}
|
2395
|
|
2396
|
//TODO create a reverse map
|
2397
|
public Integer getSourceUseKeyCacheByCache(String sourceUseCache) {
|
2398
|
if (sourceUseCache == null){
|
2399
|
return null;
|
2400
|
}else{
|
2401
|
for (Integer key: sourceUseCacheMap.keySet()){
|
2402
|
if (sourceUseCacheMap.get(key).equalsIgnoreCase(sourceUseCache)){
|
2403
|
return key;
|
2404
|
}
|
2405
|
}
|
2406
|
}
|
2407
|
return null;
|
2408
|
}
|
2409
|
|
2410
|
@Override
|
2411
|
public String getTaxonStatusCacheByKey(Integer taxonStatusId) throws UndefinedTransformerMethodException {
|
2412
|
if (taxonStatusId == null){
|
2413
|
return null;
|
2414
|
}else{
|
2415
|
return this.taxonStatusCacheMap.get(taxonStatusId);
|
2416
|
}
|
2417
|
}
|
2418
|
|
2419
|
public static String getOriginalDbBySources(EnumSet<PesiSource> sources) {
|
2420
|
String result = "";
|
2421
|
if (sources.contains(PesiSource.EM)){
|
2422
|
result = CdmUtils.concat(",", result, SOURCE_STR_EM);
|
2423
|
}
|
2424
|
if (sources.contains(PesiSource.FE)){
|
2425
|
result = CdmUtils.concat(",", result, SOURCE_STR_FE);
|
2426
|
}
|
2427
|
if (sources.contains(PesiSource.IF)){
|
2428
|
result = CdmUtils.concat(",", result, SOURCE_STR_IF);
|
2429
|
}
|
2430
|
if (sources.contains(PesiSource.ERMS)){
|
2431
|
result = CdmUtils.concat(",", result, SOURCE_STR_ERMS);
|
2432
|
}
|
2433
|
|
2434
|
return result;
|
2435
|
}
|
2436
|
|
2437
|
public static Integer pesiKingdomId(String str) {
|
2438
|
return pesiKingdomMap.get(str);
|
2439
|
}
|
2440
|
}
|