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