1
|
// $Id$
|
2
|
/**
|
3
|
* Copyright (C) 2009 EDIT
|
4
|
* European Distributed Institute of Taxonomy
|
5
|
* http://www.e-taxonomy.eu
|
6
|
*
|
7
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
8
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
9
|
*/
|
10
|
package eu.etaxonomy.cdm.io.pesi.out;
|
11
|
|
12
|
import java.sql.ResultSet;
|
13
|
import java.sql.SQLException;
|
14
|
import java.util.BitSet;
|
15
|
import java.util.HashMap;
|
16
|
import java.util.HashSet;
|
17
|
import java.util.Map;
|
18
|
import java.util.Set;
|
19
|
import java.util.UUID;
|
20
|
|
21
|
import org.apache.commons.lang.StringUtils;
|
22
|
import org.apache.log4j.Logger;
|
23
|
|
24
|
import eu.etaxonomy.cdm.common.CdmUtils;
|
25
|
import eu.etaxonomy.cdm.io.berlinModel.BerlinModelTransformer;
|
26
|
import eu.etaxonomy.cdm.io.common.Source;
|
27
|
import eu.etaxonomy.cdm.io.common.mapping.UndefinedTransformerMethodException;
|
28
|
import eu.etaxonomy.cdm.io.common.mapping.out.ExportTransformerBase;
|
29
|
import eu.etaxonomy.cdm.io.common.mapping.out.IExportTransformer;
|
30
|
import eu.etaxonomy.cdm.io.pesi.erms.ErmsTransformer;
|
31
|
import eu.etaxonomy.cdm.io.pesi.faunaEuropaea.FaunaEuropaeaTransformer;
|
32
|
import eu.etaxonomy.cdm.model.common.CdmBase;
|
33
|
import eu.etaxonomy.cdm.model.common.Language;
|
34
|
import eu.etaxonomy.cdm.model.common.RelationshipBase;
|
35
|
import eu.etaxonomy.cdm.model.common.RelationshipTermBase;
|
36
|
import eu.etaxonomy.cdm.model.description.AbsenceTerm;
|
37
|
import eu.etaxonomy.cdm.model.description.Feature;
|
38
|
import eu.etaxonomy.cdm.model.description.PresenceAbsenceTermBase;
|
39
|
import eu.etaxonomy.cdm.model.description.PresenceTerm;
|
40
|
import eu.etaxonomy.cdm.model.location.NamedArea;
|
41
|
import eu.etaxonomy.cdm.model.location.Country;
|
42
|
import eu.etaxonomy.cdm.model.name.HybridRelationshipType;
|
43
|
import eu.etaxonomy.cdm.model.name.NameRelationshipType;
|
44
|
import eu.etaxonomy.cdm.model.name.NameTypeDesignationStatus;
|
45
|
import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
|
46
|
import eu.etaxonomy.cdm.model.name.NomenclaturalStatusType;
|
47
|
import eu.etaxonomy.cdm.model.name.Rank;
|
48
|
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
|
49
|
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
|
50
|
import eu.etaxonomy.cdm.model.reference.Reference;
|
51
|
import eu.etaxonomy.cdm.model.reference.ReferenceType;
|
52
|
import eu.etaxonomy.cdm.model.taxon.Synonym;
|
53
|
import eu.etaxonomy.cdm.model.taxon.SynonymRelationship;
|
54
|
import eu.etaxonomy.cdm.model.taxon.SynonymRelationshipType;
|
55
|
import eu.etaxonomy.cdm.model.taxon.Taxon;
|
56
|
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
|
57
|
import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
|
58
|
import eu.etaxonomy.cdm.strategy.exceptions.UnknownCdmTypeException;
|
59
|
|
60
|
/**
|
61
|
* @author e.-m.lee
|
62
|
* @author a.mueller (update)
|
63
|
* @date 16.02.2010
|
64
|
*
|
65
|
*/
|
66
|
public final class PesiTransformer extends ExportTransformerBase implements IExportTransformer{
|
67
|
private static final Logger logger = Logger.getLogger(PesiTransformer.class);
|
68
|
|
69
|
public static final String AUCT_STRING = "auct.";
|
70
|
|
71
|
|
72
|
//source identifiers
|
73
|
public static final int SOURCE_EM = 1;
|
74
|
public static final int SOURCE_FE = 2;
|
75
|
public static final int SOURCE_IF = 3;
|
76
|
public static final int SOURCE_ERMS = 4;
|
77
|
|
78
|
//sourceRefUUIDs
|
79
|
public static final UUID uuidSourceRefEuroMed = UUID.fromString("0603a84a-f024-4454-ab92-9e2ac0139126");
|
80
|
public static final UUID uuidSourceRefFaunaEuropaea = UUID.fromString("6786d863-75d4-4796-b916-c1c3dff4cb70");
|
81
|
public static final UUID uuidSourceRefErms = UUID.fromString("7744bc26-f914-42c4-b54a-dd2a030a8bb7");
|
82
|
public static final UUID uuidSourceRefIndexFungorum = UUID.fromString("8de25d27-7d40-47f4-af3b-59d64935a843");
|
83
|
public static final UUID uuidSourceRefAuct = UUID.fromString("5f79f96c-c100-4cd8-b78e-2b2dacf09a23");
|
84
|
|
85
|
public static final String SOURCE_STR_EM = "E+M";
|
86
|
public static final String SOURCE_STR_FE = "FaEu";
|
87
|
public static final String SOURCE_STR_IF = "IF";
|
88
|
public static final String SOURCE_STR_ERMS = "ERMS";
|
89
|
|
90
|
// status keys
|
91
|
public static int QUALITY_STATUS_CHECKED_EDITOR_ERMS_1_1 = 0;
|
92
|
public static int QUALITY_STATUS_ADD_BY_DBMT= 2;
|
93
|
public static int QUALITY_STATUS_CHECKED_EDITOR = 3;
|
94
|
public static int QUALITY_STATUS_EDITED_BY_DBMT = 4;
|
95
|
|
96
|
// marker type
|
97
|
public static final UUID uuidMarkerGuidIsMissing = UUID.fromString("24e70843-05e2-44db-954b-84df0d23ea20");
|
98
|
public static final UUID uuidMarkerTypeHasNoLastAction = UUID.fromString("99652d5a-bc92-4251-b57d-0fec4d258ab7");
|
99
|
// public static final UUID uuidMarkerFossil = UUID.fromString("761ce108-031a-4e07-b444-f8d757070312");
|
100
|
|
101
|
|
102
|
//extension type uuids
|
103
|
public static final UUID cacheCitationUuid = UUID.fromString("29656168-32d6-4301-9067-d57c63be5c67");
|
104
|
//public static final UUID expertUserIdUuid = UUID.fromString("e25813d3-c67c-4585-9aa0-970fafde50b4");
|
105
|
//public static final UUID speciesExpertUserIdUuid = UUID.fromString("6d42abd8-8894-4980-ae07-e918affd4172");
|
106
|
public static final UUID expertNameUuid = BerlinModelTransformer.uuidExpertName;
|
107
|
public static final UUID speciesExpertNameUuid = BerlinModelTransformer.uuidSpeciesExpertName;
|
108
|
public static final UUID lastActionDateUuid = UUID.fromString("8d0a7d81-bb83-4576-84c3-8c906ef039b2");
|
109
|
public static final UUID lastActionUuid = UUID.fromString("bc20d5bc-6161-4279-9499-89ea26ce5f6a");
|
110
|
public static final UUID taxCommentUuid = UUID.fromString("8041a752-0479-4626-ab1b-b266b751f816");
|
111
|
public static final UUID fauCommentUuid = UUID.fromString("054f773a-41c8-4ad5-83e3-981320c1c126");
|
112
|
public static final UUID fauExtraCodesUuid = UUID.fromString("b8c7e77d-9869-4787-bed6-b4b302dbc5f5");
|
113
|
|
114
|
// References
|
115
|
public static int REF_ARTICLE_IN_PERIODICAL = 1;
|
116
|
public static int REF_PART_OF_OTHER = 2;
|
117
|
public static int REF_BOOK = 3;
|
118
|
public static int REF_DATABASE = 4;
|
119
|
public static int REF_INFORMAL = 5;
|
120
|
public static int REF_NOT_APPLICABLE = 6;
|
121
|
public static int REF_WEBSITE = 7;
|
122
|
public static int REF_PUBLISHED = 8;
|
123
|
public static int REF_JOURNAL = 9;
|
124
|
public static int REF_UNRESOLVED = 10;
|
125
|
public static int REF_PUBLICATION = 11;
|
126
|
public static String REF_STR_UNRESOLVED = "unresolved";
|
127
|
|
128
|
// NameStatus
|
129
|
public static int NAME_ST_NOM_INVAL = 1;
|
130
|
public static int NAME_ST_NOM_ILLEG = 2;
|
131
|
public static int NAME_ST_NOM_NUD = 3;
|
132
|
public static int NAME_ST_NOM_REJ = 4;
|
133
|
public static int NAME_ST_NOM_REJ_PROP = 5;
|
134
|
public static int NAME_ST_NOM_UTIQUE_REJ = 6;
|
135
|
public static int NAME_ST_NOM_UTIQUE_REJ_PROP = 7;
|
136
|
public static int NAME_ST_NOM_CONS = 8;
|
137
|
public static int NAME_ST_NOM_CONS_PROP = 9;
|
138
|
public static int NAME_ST_ORTH_CONS = 10;
|
139
|
public static int NAME_ST_ORTH_CONS_PROP = 11;
|
140
|
public static int NAME_ST_NOM_SUPERFL = 12;
|
141
|
public static int NAME_ST_NOM_AMBIG = 13;
|
142
|
public static int NAME_ST_NOM_PROVIS = 14;
|
143
|
public static int NAME_ST_NOM_DUB = 15;
|
144
|
public static int NAME_ST_NOM_NOV = 16;
|
145
|
public static int NAME_ST_NOM_CONFUS = 17;
|
146
|
public static int NAME_ST_NOM_ALTERN = 18;
|
147
|
public static int NAME_ST_COMB_INVAL = 19;
|
148
|
public static int NAME_ST_LEGITIMATE = 20; // PESI specific from here
|
149
|
public static int NAME_ST_COMB_INED = 21;
|
150
|
public static int NAME_ST_COMB_AND_STAT_INED = 22;
|
151
|
public static int NAME_ST_NOM_AND_ORTH_CONS = 23;
|
152
|
public static int NAME_ST_NOM_NOV_INED = 24;
|
153
|
public static int NAME_ST_SP_NOV_INED = 25;
|
154
|
public static int NAME_ST_ALTERNATE_REPRESENTATION = 26;
|
155
|
public static int NAME_ST_TEMPORARY_NAME = 27;
|
156
|
public static int NAME_ST_SPECIES_INQUIRENDA = 28;
|
157
|
|
158
|
// TaxonStatus
|
159
|
public static int T_STATUS_ACCEPTED = 1;
|
160
|
public static int T_STATUS_SYNONYM = 2;
|
161
|
public static int T_STATUS_PARTIAL_SYN = 3;
|
162
|
public static int T_STATUS_PRO_PARTE_SYN = 4;
|
163
|
public static int T_STATUS_UNRESOLVED = 5;
|
164
|
public static int T_STATUS_ORPHANED = 6;
|
165
|
public static int T_STATUS_UNACCEPTED = 7;
|
166
|
public static int T_STATUS_NOT_ACCEPTED = 8;
|
167
|
|
168
|
// TypeDesginationStatus // -> not a table anymore
|
169
|
public static int TYPE_BY_ORIGINAL_DESIGNATION = 1;
|
170
|
public static int TYPE_BY_SUBSEQUENT_DESIGNATION = 2;
|
171
|
public static int TYPE_BY_MONOTYPY = 3;
|
172
|
public static String TYPE_STR_BY_ORIGINAL_DESIGNATION = "Type by original designation";
|
173
|
public static String TYPE_STR_BY_SUBSEQUENT_DESIGNATION = "Type by subsequent designation";
|
174
|
public static String TYPE_STR_BY_MONOTYPY = "Type by monotypy";
|
175
|
|
176
|
// RelTaxonQualifier
|
177
|
public static int IS_BASIONYM_FOR = 1;
|
178
|
public static int IS_LATER_HOMONYM_OF = 2;
|
179
|
public static int IS_REPLACED_SYNONYM_FOR = 3;
|
180
|
public static int IS_VALIDATION_OF = 4;
|
181
|
public static int IS_LATER_VALIDATION_OF = 5;
|
182
|
public static int IS_TYPE_OF = 6;
|
183
|
public static int IS_CONSERVED_TYPE_OF = 7;
|
184
|
public static int IS_REJECTED_TYPE_OF = 8;
|
185
|
public static int IS_FIRST_PARENT_OF = 9;
|
186
|
public static int IS_SECOND_PARENT_OF = 10;
|
187
|
public static int IS_FEMALE_PARENT_OF = 11;
|
188
|
public static int IS_MALE_PARENT_OF = 12;
|
189
|
public static int IS_CONSERVED_AGAINST = 13;
|
190
|
public static int IS_REJECTED_IN_FAVOUR_OF = 14;
|
191
|
public static int IS_TREATED_AS_LATER_HOMONYM_OF = 15;
|
192
|
public static int IS_ORTHOGRAPHIC_VARIANT_OF = 16;
|
193
|
public static int IS_ALTERNATIVE_NAME_FOR = 17;
|
194
|
public static int HAS_SAME_TYPE_AS = 18;
|
195
|
public static int IS_LECTOTYPE_OF = 61;
|
196
|
public static int TYPE_NOT_DESIGNATED = 62;
|
197
|
public static int IS_TAXONOMICALLY_INCLUDED_IN = 101;
|
198
|
public static int IS_SYNONYM_OF = 102;
|
199
|
public static int IS_MISAPPLIED_NAME_FOR = 103;
|
200
|
public static int IS_PRO_PARTE_SYNONYM_OF = 104;
|
201
|
public static int IS_PARTIAL_SYNONYM_OF = 105;
|
202
|
public static int IS_HETEROTYPIC_SYNONYM_OF = 106;
|
203
|
public static int IS_HOMOTYPIC_SYNONYM_OF = 107;
|
204
|
public static int IS_PRO_PARTE_AND_HOMOTYPIC_SYNONYM_OF = 201;
|
205
|
public static int IS_PRO_PARTE_AND_HETEROTYPIC_SYNONYM_OF = 202;
|
206
|
public static int IS_PARTIAL_AND_HOMOTYPIC_SYNONYM_OF = 203;
|
207
|
public static int IS_PARTIAL_AND_HETEROTYPIC_SYNONYM_OF = 204;
|
208
|
public static int IS_INFERRED_EPITHET_FOR = 301;
|
209
|
public static int IS_INFERRED_GENUS_FOR = 302;
|
210
|
public static int IS_POTENTIAL_COMBINATION_FOR = 303;
|
211
|
|
212
|
|
213
|
//namespaces
|
214
|
public static String STR_NAMESPACE_NOMINAL_TAXON = "Nominal taxon from TAX_ID:";
|
215
|
public static String STR_NAMESPACE_INFERRED_EPITHET = "Inferred epithet from TAX_ID:";
|
216
|
public static String STR_NAMESPACE_INFERRED_GENUS = "Inferred genus from TAX_ID:";
|
217
|
public static String STR_NAMESPACE_POTENTIAL_COMBINATION = "Potential combination from TAX_ID:";
|
218
|
|
219
|
|
220
|
// Kingdoms
|
221
|
public static int KINGDOM_NULL = 0;
|
222
|
public static int KINGDOM_ANIMALIA = 2;
|
223
|
public static int KINGDOM_PLANTAE = 3;
|
224
|
public static int KINGDOM_FUNGI = 4;
|
225
|
public static int KINGDOM_PROTOZOA = 5;
|
226
|
public static int KINGDOM_BACTERIA = 6;
|
227
|
public static int KINGDOM_CHROMISTA = 7;
|
228
|
|
229
|
// Animalia Ranks
|
230
|
public static int Animalia_Kingdom = 10;
|
231
|
public static int Animalia_Subkingdom = 20;
|
232
|
public static int Animalia_Superphylum = 23;
|
233
|
public static int Animalia_Phylum = 30;
|
234
|
public static int Animalia_Subphylum = 40;
|
235
|
public static int Animalia_Infraphylum = 45;
|
236
|
public static int Animalia_Superclass = 50;
|
237
|
public static int Animalia_Class = 60;
|
238
|
public static int Animalia_Subclass = 70;
|
239
|
public static int Animalia_Infraclass = 80;
|
240
|
public static int Animalia_Superorder = 90;
|
241
|
public static int Animalia_Order = 100;
|
242
|
public static int Animalia_Suborder = 110;
|
243
|
public static int Animalia_Infraorder = 120;
|
244
|
public static int Animalia_Section = 121;
|
245
|
public static int Animalia_Subsection = 122;
|
246
|
public static int Animalia_Superfamily = 130;
|
247
|
public static int Animalia_Family = 140;
|
248
|
public static int Animalia_Subfamily = 150;
|
249
|
public static int Animalia_Tribe = 160;
|
250
|
public static int Animalia_Subtribe = 170;
|
251
|
public static int Animalia_Genus = 180;
|
252
|
public static int Animalia_Subgenus = 190;
|
253
|
public static int Animalia_Species =220;
|
254
|
public static int Animalia_Subspecies = 230;
|
255
|
public static int Animalia_Natio = 235;
|
256
|
public static int Animalia_Variety = 240;
|
257
|
public static int Animalia_Subvariety = 250;
|
258
|
public static int Animalia_Forma = 260;
|
259
|
|
260
|
// Plantae Ranks
|
261
|
public static int Plantae_Kingdom = 10;
|
262
|
public static int Plantae_Subkingdom = 20;
|
263
|
public static int Plantae_Division = 30;
|
264
|
public static int Plantae_Subdivision = 40;
|
265
|
public static int Plantae_Class = 60;
|
266
|
public static int Plantae_Subclass = 70;
|
267
|
public static int Plantae_Order = 100;
|
268
|
public static int Plantae_Suborder = 110;
|
269
|
public static int Plantae_Family = 140;
|
270
|
public static int Plantae_Subfamily = 150;
|
271
|
public static int Plantae_Tribe = 160;
|
272
|
public static int Plantae_Subtribe = 170;
|
273
|
public static int Plantae_Genus = 180;
|
274
|
public static int Plantae_Subgenus = 190;
|
275
|
public static int Plantae_Section = 200;
|
276
|
public static int Plantae_Subsection = 210;
|
277
|
public static int Plantae_Series = 212;
|
278
|
public static int Plantae_Subseries = 214;
|
279
|
public static int Plantae_Aggregate = 216;
|
280
|
public static int Plantae_Coll_Species = 218;
|
281
|
public static int Plantae_Species = 220;
|
282
|
public static int Plantae_Grex = 225;
|
283
|
public static int Plantae_Subspecies = 230;
|
284
|
public static int Plantae_Proles = 232;
|
285
|
public static int Plantae_Race = 234;
|
286
|
public static int Plantae_Convarietas = 236;
|
287
|
public static int Plantae_Variety = 240;
|
288
|
public static int Plantae_Subvariety = 250;
|
289
|
public static int Plantae_Forma = 260;
|
290
|
public static int Plantae_Subforma = 270;
|
291
|
public static int Plantae_Forma_spec = 275;
|
292
|
public static int Plantae_Taxa_infragen = 280;
|
293
|
public static int Plantae_Taxa_infraspec = 285;
|
294
|
|
295
|
// Fungi Ranks
|
296
|
public static int Fungi_Kingdom = 10;
|
297
|
public static int Fungi_Subkingdom = 20;
|
298
|
public static int Fungi_Division = 30;
|
299
|
public static int Fungi_Subdivision = 40;
|
300
|
public static int Fungi_Class = 60;
|
301
|
public static int Fungi_Subclass = 70;
|
302
|
public static int Fungi_Order = 100;
|
303
|
public static int Fungi_Suborder = 110;
|
304
|
public static int Fungi_Family = 140;
|
305
|
public static int Fungi_Subfamily = 150;
|
306
|
public static int Fungi_Tribe = 160;
|
307
|
public static int Fungi_Subtribe = 170;
|
308
|
public static int Fungi_Genus = 180;
|
309
|
public static int Fungi_Subgenus = 190;
|
310
|
public static int Fungi_Section = 200;
|
311
|
public static int Fungi_Subsection = 210;
|
312
|
public static int Fungi_Species = 220;
|
313
|
public static int Fungi_Subspecies = 230;
|
314
|
public static int Fungi_Variety = 240;
|
315
|
public static int Fungi_Subvariety = 250;
|
316
|
public static int Fungi_Forma = 260;
|
317
|
public static int Fungi_Subforma = 270;
|
318
|
|
319
|
//Protozoa Ranks
|
320
|
public static int Protozoa_Kingdom = 10;
|
321
|
public static int Protozoa_Subkingdom = 20;
|
322
|
public static int Protozoa_Phylum = 30;
|
323
|
public static int Protozoa_Subphylum = 40;
|
324
|
public static int Protozoa_Superclass = 50;
|
325
|
public static int Protozoa_Class = 60;
|
326
|
public static int Protozoa_Subclass = 70;
|
327
|
public static int Protozoa_Infraclass = 80;
|
328
|
public static int Protozoa_Superorder = 90;
|
329
|
public static int Protozoa_Order = 100;
|
330
|
public static int Protozoa_Suborder = 110;
|
331
|
public static int Protozoa_Infraorder = 120;
|
332
|
public static int Protozoa_Superfamily = 130;
|
333
|
public static int Protozoa_Family = 140;
|
334
|
public static int Protozoa_Subfamily = 150;
|
335
|
public static int Protozoa_Tribe = 160;
|
336
|
public static int Protozoa_Subtribe = 170;
|
337
|
public static int Protozoa_Genus = 180;
|
338
|
public static int Protozoa_Subgenus = 190;
|
339
|
public static int Protozoa_Species = 220;
|
340
|
public static int Protozoa_Subspecies = 230;
|
341
|
public static int Protozoa_Variety = 240;
|
342
|
public static int Protozoa_Forma = 260;
|
343
|
|
344
|
// Bacteria Ranks
|
345
|
public static int Bacteria_Kingdom = 10;
|
346
|
public static int Bacteria_Subkingdom = 20;
|
347
|
public static int Bacteria_Phylum = 30;
|
348
|
public static int Bacteria_Subphylum = 40;
|
349
|
public static int Bacteria_Superclass = 50;
|
350
|
public static int Bacteria_Class = 60;
|
351
|
public static int Bacteria_Subclass = 70;
|
352
|
public static int Bacteria_Infraclass = 80;
|
353
|
public static int Bacteria_Superorder = 90;
|
354
|
public static int Bacteria_Order = 100;
|
355
|
public static int Bacteria_Suborder = 110;
|
356
|
public static int Bacteria_Infraorder = 120;
|
357
|
public static int Bacteria_Superfamily = 130;
|
358
|
public static int Bacteria_Family = 140;
|
359
|
public static int Bacteria_Subfamily = 150;
|
360
|
public static int Bacteria_Tribe = 160;
|
361
|
public static int Bacteria_Subtribe = 170;
|
362
|
public static int Bacteria_Genus = 180;
|
363
|
public static int Bacteria_Subgenus = 190;
|
364
|
public static int Bacteria_Species = 220;
|
365
|
public static int Bacteria_Subspecies = 230;
|
366
|
public static int Bacteria_Variety = 240;
|
367
|
public static int Bacteria_Forma = 260;
|
368
|
|
369
|
// Chromista Ranks
|
370
|
public static int Chromista_Kingdom = 10;
|
371
|
public static int Chromista_Subkingdom = 20;
|
372
|
public static int Chromista_Infrakingdom = 25;
|
373
|
public static int Chromista_Phylum = 30;
|
374
|
public static int Chromista_Subphylum = 40;
|
375
|
public static int Chromista_Superclass = 50;
|
376
|
public static int Chromista_Class = 60;
|
377
|
public static int Chromista_Subclass = 70;
|
378
|
public static int Chromista_Infraclass = 80;
|
379
|
public static int Chromista_Superorder = 90;
|
380
|
public static int Chromista_Order = 100;
|
381
|
public static int Chromista_Suborder = 110;
|
382
|
public static int Chromista_Infraorder = 120;
|
383
|
public static int Chromista_Superfamily = 130;
|
384
|
public static int Chromista_Family = 140;
|
385
|
public static int Chromista_Subfamily = 150;
|
386
|
public static int Chromista_Tribe = 160;
|
387
|
public static int Chromista_Subtribe = 170;
|
388
|
public static int Chromista_Genus = 180;
|
389
|
public static int Chromista_Subgenus = 190;
|
390
|
public static int Chromista_Section = 200;
|
391
|
public static int Chromista_Subsection = 210;
|
392
|
public static int Chromista_Species = 220;
|
393
|
public static int Chromista_Subspecies = 230;
|
394
|
public static int Chromista_Variety = 240;
|
395
|
public static int Chromista_Subvariety = 250;
|
396
|
public static int Chromista_Forma = 260;
|
397
|
|
398
|
// NoteCategory
|
399
|
public static int NoteCategory_description = 1;
|
400
|
public static int NoteCategory_ecology = 4;
|
401
|
public static int NoteCategory_phenology = 5;
|
402
|
public static int NoteCategory_general_distribution_euromed = 10;
|
403
|
public static int NoteCategory_general_distribution_world = 11;
|
404
|
public static int NoteCategory_Common_names = 12;
|
405
|
public static int NoteCategory_Occurrence = 13;
|
406
|
public static int NoteCategory_Maps =14;
|
407
|
public static int NoteCategory_Link_to_maps = 20;
|
408
|
public static int NoteCategory_Link_to_images = 21;
|
409
|
public static int NoteCategory_Link_to_taxonomy = 22;
|
410
|
public static int NoteCategory_Link_to_general_information = 23;
|
411
|
public static int NoteCategory_undefined_link = 24;
|
412
|
public static int NoteCategory_Editor_Braces = 249;
|
413
|
public static int NoteCategory_Editor_Brackets = 250;
|
414
|
public static int NoteCategory_Editor_Parenthesis = 251;
|
415
|
public static int NoteCategory_Inedited = 252;
|
416
|
public static int NoteCategory_Comments_on_editing_process = 253;
|
417
|
public static int NoteCategory_Publication_date = 254;
|
418
|
public static int NoteCategory_Morphology = 255;
|
419
|
public static int NoteCategory_Acknowledgments = 257;
|
420
|
public static int NoteCategory_Original_publication = 258;
|
421
|
public static int NoteCategory_Type_locality = 259;
|
422
|
public static int NoteCategory_Environment = 260;
|
423
|
public static int NoteCategory_Spelling = 261;
|
424
|
public static int NoteCategory_Systematics = 262;
|
425
|
public static int NoteCategory_Remark = 263;
|
426
|
public static int NoteCategory_Date_of_publication = 264;
|
427
|
public static int NoteCategory_Additional_information = 266;
|
428
|
public static int NoteCategory_Status = 267;
|
429
|
public static int NoteCategory_Nomenclature = 268;
|
430
|
public static int NoteCategory_Homonymy = 269;
|
431
|
public static int NoteCategory_Taxonomy = 270;
|
432
|
public static int NoteCategory_Taxonomic_status = 272;
|
433
|
public static int NoteCategory_Authority = 273;
|
434
|
public static int NoteCategory_Identification = 274;
|
435
|
public static int NoteCategory_Validity = 275;
|
436
|
public static int NoteCategory_Classification = 276;
|
437
|
public static int NoteCategory_Distribution = 278;
|
438
|
public static int NoteCategory_Synonymy = 279;
|
439
|
public static int NoteCategory_Habitat = 280;
|
440
|
public static int NoteCategory_Biology = 281;
|
441
|
public static int NoteCategory_Diagnosis = 282;
|
442
|
public static int NoteCategory_Host = 283;
|
443
|
public static int NoteCategory_Note = 284;
|
444
|
public static int NoteCategory_Rank = 285;
|
445
|
public static int NoteCategory_Taxonomic_Remark = 286;
|
446
|
public static int NoteCategory_Taxonomic_Remarks = 287;
|
447
|
|
448
|
public static int NoteCategory_Conservation_Status= 301;
|
449
|
public static int NoteCategory_Use = 302;
|
450
|
public static int NoteCategory_Comments = 303;
|
451
|
|
452
|
|
453
|
// Language
|
454
|
public static int Language_Albanian = 1;
|
455
|
public static int Language_Arabic = 2;
|
456
|
public static int Language_Armenian = 3;
|
457
|
public static int Language_Azerbaijan = 4;
|
458
|
public static int Language_Belarusian = 5;
|
459
|
public static int Language_Bulgarian = 6;
|
460
|
public static int Language_Catalan = 7;
|
461
|
public static int Language_Croat = 8;
|
462
|
public static int Language_Czech = 9;
|
463
|
public static int Language_Danish = 10;
|
464
|
public static int Language_Dutch = 11;
|
465
|
public static int Language_English = 12;
|
466
|
public static int Language_Euskera = 13;
|
467
|
public static int Language_Estonian = 14;
|
468
|
public static int Language_Finnish = 15;
|
469
|
public static int Language_French = 16;
|
470
|
public static int Language_Georgian = 17;
|
471
|
public static int Language_German = 18;
|
472
|
public static int Language_Greek = 19;
|
473
|
public static int Language_Hungarian = 20;
|
474
|
public static int Language_Icelandic = 21;
|
475
|
public static int Language_Irish_Gaelic = 22;
|
476
|
public static int Language_Israel_Hebrew = 23;
|
477
|
public static int Language_Italian = 24;
|
478
|
public static int Language_Latvian = 25;
|
479
|
public static int Language_Lithuanian = 26;
|
480
|
public static int Language_Macedonian = 27;
|
481
|
public static int Language_Maltese = 28;
|
482
|
public static int Language_Moldovian = 29;
|
483
|
public static int Language_Norwegian = 30;
|
484
|
public static int Language_Polish = 31;
|
485
|
public static int Language_Portuguese = 32;
|
486
|
public static int Language_Roumanian = 33;
|
487
|
public static int Language_Russian = 34;
|
488
|
public static int Language_Russian_Caucasian = 35;
|
489
|
public static int Language_Russian_Altaic_kalmyk_oirat = 36;
|
490
|
public static int Language_Russian_Altaic_karachay_balkar = 37;
|
491
|
public static int Language_Russian_Altaic_kumyk = 38;
|
492
|
public static int Language_Russian_Altaic_nogai = 39;
|
493
|
public static int Language_Russian_Altaic_north_azerbaijani = 40;
|
494
|
public static int Language_Russian_Indo_european_russian = 41;
|
495
|
public static int Language_Russian_Indo_european_kalmyk_oirat = 42;
|
496
|
public static int Language_Russian_Indo_european_osetin = 43;
|
497
|
public static int Language_Russian_North_caucasian_abaza = 44;
|
498
|
public static int Language_Russian_North_caucasian_adyghe = 45;
|
499
|
public static int Language_Russian_North_caucasian_chechen = 46;
|
500
|
public static int Language_Russian_North_caucasian_kabardian = 47;
|
501
|
public static int Language_Russian_North_caucasian_lak = 48;
|
502
|
public static int Language_Russian_North_caucasian_avar = 49;
|
503
|
public static int Language_Russian_North_caucasian_in = 50;
|
504
|
public static int Language_Russian_Uralic_chuvash = 51;
|
505
|
public static int Language_Russian_Uralic_udmurt = 52;
|
506
|
public static int Language_Serbian = 53;
|
507
|
public static int Language_Slovak = 54;
|
508
|
public static int Language_Slovene = 55;
|
509
|
public static int Language_Spanish_Castillian = 56;
|
510
|
public static int Language_Swedish = 57;
|
511
|
public static int Language_Turkish = 58;
|
512
|
public static int Language_Ukraine = 59;
|
513
|
public static int Language_Welsh = 60;
|
514
|
public static int Language_Corsican = 61;
|
515
|
|
516
|
// FossilStatus
|
517
|
public static int FOSSILSTATUS_RECENT_ONLY = 1;
|
518
|
public static int FOSSILSTATUS_FOSSIL_ONLY = 2;
|
519
|
public static int FOSSILSTATUS_RECENT_FOSSIL = 3;
|
520
|
public static String STR_FOSSIL_ONLY = "fossil only"; //still used for Index Fungorum
|
521
|
|
522
|
// SourceUse
|
523
|
public static int ORIGINAL_DESCRIPTION = 1;
|
524
|
public static int BASIS_OF_RECORD = 2;
|
525
|
public static int ADDITIONAL_SOURCE = 3;
|
526
|
public static int SOURCE_OF_SYNONYMY = 4;
|
527
|
public static int REDESCRIPTION = 5;
|
528
|
public static int NEW_COMBINATION_REFERENCE = 6;
|
529
|
public static int STATUS_SOURCE = 7;
|
530
|
public static int NOMENCLATURAL_REFERENCE = 8;
|
531
|
public static String STR_NOMENCLATURAL_REFERENCE = "nomenclatural reference";
|
532
|
|
533
|
// Area
|
534
|
public static int AREA_EAST_AEGEAN_ISLANDS = 1;
|
535
|
public static int AREA_GREEK_EAST_AEGEAN_ISLANDS = 2;
|
536
|
public static int AREA_TURKISH_EAST_AEGEAN_ISLANDS = 3;
|
537
|
public static int AREA_ALBANIA = 4;
|
538
|
public static int AREA_AUSTRIA_WITH_LIECHTENSTEIN = 5;
|
539
|
public static int AREA_AUSTRIA = 6;
|
540
|
public static int AREA_LIECHTENSTEIN = 7;
|
541
|
public static int AREA_AZORES = 8;
|
542
|
public static int AREA_CORVO = 9;
|
543
|
public static int AREA_FAIAL = 10;
|
544
|
public static int AREA_GRACIOSA = 11;
|
545
|
public static int AREA_SAO_JORGE = 12;
|
546
|
public static int AREA_FLORES = 13;
|
547
|
public static int AREA_SAO_MIGUEL = 14;
|
548
|
public static int AREA_PICO = 15;
|
549
|
public static int AREA_SANTA_MARIA = 16;
|
550
|
public static int AREA_TERCEIRA = 17;
|
551
|
public static int AREA_BELGIUM_WITH_LUXEMBOURG = 18;
|
552
|
public static int AREA_BELGIUM = 19;
|
553
|
public static int AREA_LUXEMBOURG = 20;
|
554
|
public static int AREA_BOSNIA_HERZEGOVINA = 21;
|
555
|
public static int AREA_BALEARES = 22;
|
556
|
public static int AREA_IBIZA_WITH_FORMENTERA = 23;
|
557
|
public static int AREA_MALLORCA = 24;
|
558
|
public static int AREA_MENORCA = 25;
|
559
|
public static int AREA_GREAT_BRITAIN = 26;
|
560
|
public static int AREA_BALTIC_STATES_ESTONIA_LATVIA_LITHUANIA_AND_KALININGRAD_REGION = 27;
|
561
|
public static int AREA_BULGARIA = 28;
|
562
|
public static int AREA_BELARUS = 29;
|
563
|
public static int AREA_CANARY_ISLANDS = 30;
|
564
|
public static int AREA_GRAN_CANARIA = 31;
|
565
|
public static int AREA_FUERTEVENTURA_WITH_LOBOS = 32;
|
566
|
public static int AREA_GOMERA = 33;
|
567
|
public static int AREA_HIERRO = 34;
|
568
|
public static int AREA_LANZAROTE_WITH_GRACIOSA = 35;
|
569
|
public static int AREA_LA_PALMA = 36;
|
570
|
public static int AREA_TENERIFE = 37;
|
571
|
public static int AREA_MONTENEGRO = 38;
|
572
|
public static int AREA_CORSE = 39;
|
573
|
public static int AREA_CRETE_WITH_KARPATHOS_KASOS_AND_GAVDHOS = 40;
|
574
|
public static int AREA_CZECH_REPUBLIC = 41;
|
575
|
public static int AREA_CROATIA = 42;
|
576
|
public static int AREA_CYPRUS = 43;
|
577
|
public static int AREA_FORMER_CZECHOSLOVAKIA = 44;
|
578
|
public static int AREA_DENMARK_WITH_BORNHOLM = 45;
|
579
|
public static int AREA_ESTONIA = 46;
|
580
|
public static int AREA_FAROE_ISLANDS = 47;
|
581
|
public static int AREA_FINLAND_WITH_AHVENANMAA = 48;
|
582
|
public static int AREA_FRANCE = 49;
|
583
|
public static int AREA_CHANNEL_ISLANDS = 50;
|
584
|
public static int AREA_FRENCH_MAINLAND = 51;
|
585
|
public static int AREA_MONACO = 52;
|
586
|
public static int AREA_GERMANY = 53;
|
587
|
public static int AREA_GREECE_WITH_CYCLADES_AND_MORE_ISLANDS = 54;
|
588
|
public static int AREA_IRELAND = 55;
|
589
|
public static int AREA_REPUBLIC_OF_IRELAND = 56;
|
590
|
public static int AREA_NORTHERN_IRELAND = 57;
|
591
|
public static int AREA_SWITZERLAND = 58;
|
592
|
public static int AREA_NETHERLANDS = 59;
|
593
|
public static int AREA_SPAIN = 60;
|
594
|
public static int AREA_ANDORRA = 61;
|
595
|
public static int AREA_GIBRALTAR = 62;
|
596
|
public static int AREA_KINGDOM_OF_SPAIN = 63;
|
597
|
public static int AREA_HUNGARY = 64;
|
598
|
public static int AREA_ICELAND = 65;
|
599
|
public static int AREA_ITALY = 66;
|
600
|
public static int AREA_ITALIAN_MAINLAND = 67;
|
601
|
public static int AREA_SAN_MARINO = 68;
|
602
|
public static int AREA_FORMER_JUGOSLAVIA = 69;
|
603
|
public static int AREA_LATVIA = 70;
|
604
|
public static int AREA_LITHUANIA = 71;
|
605
|
public static int AREA_PORTUGUESE_MAINLAND = 72;
|
606
|
public static int AREA_MADEIRA_ARCHIPELAGO = 73;
|
607
|
public static int AREA_DESERTAS = 74;
|
608
|
public static int AREA_MADEIRA = 75;
|
609
|
public static int AREA_PORTO_SANTO = 76;
|
610
|
public static int AREA_THE_FORMER_JUGOSLAV_REPUBLIC_OF_MAKEDONIJA = 77;
|
611
|
public static int AREA_MOLDOVA = 78;
|
612
|
public static int AREA_NORWEGIAN_MAINLAND = 79;
|
613
|
public static int AREA_POLAND = 80;
|
614
|
public static int AREA_THE_RUSSIAN_FEDERATION = 81;
|
615
|
public static int AREA_NOVAYA_ZEMLYA_AND_FRANZ_JOSEPH_LAND = 82;
|
616
|
public static int AREA_CENTRAL_EUROPEAN_RUSSIA = 83;
|
617
|
public static int AREA_EASTERN_EUROPEAN_RUSSIA = 84;
|
618
|
public static int AREA_KALININGRAD = 85;
|
619
|
public static int AREA_NORTHERN_EUROPEAN_RUSSIA = 86;
|
620
|
public static int AREA_NORTHWEST_EUROPEAN_RUSSIA = 87;
|
621
|
public static int AREA_SOUTH_EUROPEAN_RUSSIA = 88;
|
622
|
public static int AREA_ROMANIA = 89;
|
623
|
public static int AREA_FORMER_USSR = 90;
|
624
|
public static int AREA_RUSSIA_BALTIC = 91;
|
625
|
public static int AREA_RUSSIA_CENTRAL = 92;
|
626
|
public static int AREA_RUSSIA_SOUTHEAST = 93;
|
627
|
public static int AREA_RUSSIA_NORTHERN = 94;
|
628
|
public static int AREA_RUSSIA_SOUTHWEST = 95;
|
629
|
public static int AREA_SARDEGNA = 96;
|
630
|
public static int AREA_SVALBARD_WITH_BJORNOYA_AND_JAN_MAYEN = 97;
|
631
|
public static int AREA_SELVAGENS_ISLANDS = 98;
|
632
|
public static int AREA_SICILY_WITH_MALTA = 99;
|
633
|
public static int AREA_MALTA = 100;
|
634
|
public static int AREA_SICILY = 101;
|
635
|
public static int AREA_SLOVAKIA = 102;
|
636
|
public static int AREA_SLOVENIA = 103;
|
637
|
public static int AREA_SERBIA_WITH_MONTENEGRO = 104;
|
638
|
public static int AREA_SERBIA_INCLUDING_VOJVODINA_AND_WITH_KOSOVO = 105;
|
639
|
public static int AREA_SWEDEN = 106;
|
640
|
public static int AREA_EUROPEAN_TURKEY = 107;
|
641
|
public static int AREA_UKRAINE_INCLUDING_CRIMEA = 108;
|
642
|
public static int AREA_CRIMEA = 109;
|
643
|
public static int AREA_UKRAINE = 110;
|
644
|
public static int AREA_GREEK_MAINLAND = 111;
|
645
|
public static int AREA_CRETE = 112;
|
646
|
public static int AREA_DODECANESE_ISLANDS = 113;
|
647
|
public static int AREA_CYCLADES_ISLANDS = 114;
|
648
|
public static int AREA_NORTH_AEGEAN_ISLANDS = 115;
|
649
|
public static int AREA_VATICAN_CITY = 116;
|
650
|
public static int AREA_FRANZ_JOSEF_LAND = 117;
|
651
|
public static int AREA_NOVAYA_ZEMLYA = 118;
|
652
|
public static int AREA_AZERBAIJAN_INCLUDING_NAKHICHEVAN = 119;
|
653
|
public static int AREA_AZERBAIJAN = 120;
|
654
|
public static int AREA_NAKHICHEVAN = 121;
|
655
|
public static int AREA_ALGERIA = 122;
|
656
|
public static int AREA_ARMENIA = 123;
|
657
|
public static int AREA_CAUCASUS_REGION = 124;
|
658
|
public static int AREA_EGYPT = 125;
|
659
|
public static int AREA_GEORGIA = 126;
|
660
|
public static int AREA_ISRAEL_JORDAN = 127;
|
661
|
public static int AREA_ISRAEL = 128;
|
662
|
public static int AREA_JORDAN = 129;
|
663
|
public static int AREA_LEBANON = 130;
|
664
|
public static int AREA_LIBYA = 131;
|
665
|
public static int AREA_LEBANON_SYRIA = 132;
|
666
|
public static int AREA_MOROCCO = 133;
|
667
|
public static int AREA_NORTH_CAUCASUS = 134;
|
668
|
public static int AREA_SINAI = 135;
|
669
|
public static int AREA_SYRIA = 136;
|
670
|
public static int AREA_TUNISIA = 137;
|
671
|
public static int AREA_ASIATIC_TURKEY = 138;
|
672
|
public static int AREA_TURKEY = 139;
|
673
|
public static int AREA_NORTHERN_AFRICA = 140;
|
674
|
public static int AREA_AFRO_TROPICAL_REGION = 141;
|
675
|
public static int AREA_AUSTRALIAN_REGION = 142;
|
676
|
public static int AREA_EAST_PALAEARCTIC = 143;
|
677
|
public static int AREA_NEARCTIC_REGION = 144;
|
678
|
public static int AREA_NEOTROPICAL_REGION = 145;
|
679
|
public static int AREA_NEAR_EAST = 146;
|
680
|
public static int AREA_ORIENTAL_REGION = 147;
|
681
|
public static int AREA_EUROPEAN_MARINE_WATERS = 148;
|
682
|
public static int AREA_MEDITERRANEAN_SEA = 149;
|
683
|
public static int AREA_WHITE_SEA = 150;
|
684
|
public static int AREA_NORTH_SEA = 151;
|
685
|
public static int AREA_BALTIC_SEA = 152;
|
686
|
public static int AREA_BLACK_SEA = 153;
|
687
|
public static int AREA_BARENTS_SEA = 154;
|
688
|
public static int AREA_CASPIAN_SEA = 155;
|
689
|
public static int AREA_PORTUGUESE_EXCLUSIVE_ECONOMIC_ZONE = 156;
|
690
|
public static int AREA_BELGIAN_EXCLUSIVE_ECONOMIC_ZONE = 157;
|
691
|
public static int AREA_FRENCH_EXCLUSIVE_ECONOMIC_ZONE = 158;
|
692
|
public static int AREA_ENGLISH_CHANNEL = 159;
|
693
|
public static int AREA_ADRIATIC_SEA = 160;
|
694
|
public static int AREA_BISCAY_BAY = 161;
|
695
|
public static int AREA_DUTCH_EXCLUSIVE_ECONOMIC_ZONE = 162;
|
696
|
public static int AREA_UNITED_KINGDOM_EXCLUSIVE_ECONOMIC_ZONE = 163;
|
697
|
public static int AREA_SPANISH_EXCLUSIVE_ECONOMIC_ZONE = 164;
|
698
|
public static int AREA_EGYPTIAN_EXCLUSIVE_ECONOMIC_ZONE = 165;
|
699
|
public static int AREA_GRECIAN_EXCLUSIVE_ECONOMIC_ZONE = 166;
|
700
|
public static int AREA_TIRRENO_SEA = 167;
|
701
|
public static int AREA_ICELANDIC_EXCLUSIVE_ECONOMIC_ZONE = 168;
|
702
|
public static int AREA_IRISH_EXCLUSIVE_ECONOMIC_ZONE = 169;
|
703
|
public static int AREA_IRISH_SEA = 170;
|
704
|
public static int AREA_ITALIAN_EXCLUSIVE_ECONOMIC_ZONE = 171;
|
705
|
public static int AREA_NORWEGIAN_SEA = 172;
|
706
|
public static int AREA_MOROCCAN_EXCLUSIVE_ECONOMIC_ZONE = 173;
|
707
|
public static int AREA_NORWEGIAN_EXCLUSIVE_ECONOMIC_ZONE = 174;
|
708
|
public static int AREA_SKAGERRAK = 175;
|
709
|
public static int AREA_TUNISIAN_EXCLUSIVE_ECONOMIC_ZONE = 176;
|
710
|
public static int AREA_WADDEN_SEA = 177;
|
711
|
public static int AREA_BELT_SEA = 178;
|
712
|
public static int AREA_MARMARA_SEA = 179;
|
713
|
public static int AREA_SEA_OF_AZOV = 180;
|
714
|
public static int AREA_AEGEAN_SEA = 181;
|
715
|
public static int AREA_BULGARIAN_EXCLUSIVE_ECONOMIC_ZONE = 182;
|
716
|
public static int AREA_SOUTH_BALTIC_PROPER = 183;
|
717
|
public static int AREA_BALTIC_PROPER = 184;
|
718
|
public static int AREA_NORTH_BALTIC_PROPER = 185;
|
719
|
public static int AREA_ARCHIPELAGO_SEA = 186;
|
720
|
public static int AREA_BOTHNIAN_SEA = 187;
|
721
|
public static int AREA_GERMAN_EXCLUSIVE_ECONOMIC_ZONE = 188;
|
722
|
public static int AREA_SWEDISH_EXCLUSIVE_ECONOMIC_ZONE = 189;
|
723
|
public static int AREA_UKRAINIAN_EXCLUSIVE_ECONOMIC_ZONE = 190;
|
724
|
public static int AREA_MADEIRAN_EXCLUSIVE_ECONOMIC_ZONE = 191;
|
725
|
public static int AREA_LEBANESE_EXCLUSIVE_ECONOMIC_ZONE = 192;
|
726
|
public static int AREA_SPANISH_EXCLUSIVE_ECONOMIC_ZONE_MEDITERRANEAN_PART = 193;
|
727
|
public static int AREA_ESTONIAN_EXCLUSIVE_ECONOMIC_ZONE = 194;
|
728
|
public static int AREA_CROATIAN_EXCLUSIVE_ECONOMIC_ZONE = 195;
|
729
|
public static int AREA_BALEAR_SEA = 196;
|
730
|
public static int AREA_TURKISH_EXCLUSIVE_ECONOMIC_ZONE = 197;
|
731
|
public static int AREA_DANISH_EXCLUSIVE_ECONOMIC_ZONE = 198;
|
732
|
public static int AREA_TRANSCAUCASUS = 199;
|
733
|
|
734
|
public static int AREA_UNITED_KINGDOM = 203;
|
735
|
public static int AREA_DENMARK_COUNTRY = 204;
|
736
|
public static int AREA_TURKEY_COUNTRY = 205;
|
737
|
public static int AREA_SPAIN_COUNTRY = 206;
|
738
|
public static int AREA_GREECE_COUNTRY = 207;
|
739
|
public static int AREA_PORTUGAL_COUNTRY = 208;
|
740
|
|
741
|
// OccurrenceStatus
|
742
|
public static int STATUS_PRESENT = 1;
|
743
|
public static int STATUS_ABSENT = 2;
|
744
|
public static int STATUS_NATIVE = 3;
|
745
|
public static int STATUS_INTRODUCED = 4;
|
746
|
public static int STATUS_NATURALISED = 5;
|
747
|
public static int STATUS_INVASIVE = 6;
|
748
|
public static int STATUS_MANAGED = 7;
|
749
|
public static int STATUS_DOUBTFUL = 8;
|
750
|
|
751
|
private Map<String, Integer> tdwgKeyMap = new HashMap<String, Integer>();
|
752
|
private Map<Integer, String> areaCacheMap = new HashMap<Integer, String>();
|
753
|
private Map<Integer, String> languageCacheMap = new HashMap<Integer, String>();
|
754
|
private Map<Integer, String> featureCacheMap = new HashMap<Integer, String>();
|
755
|
private Map<Integer, String> nameStatusCacheMap = new HashMap<Integer, String>();
|
756
|
private Map<Integer, String> qualityStatusCacheMap = new HashMap<Integer, String>();
|
757
|
private Map<Integer, String> taxonStatusCacheMap = new HashMap<Integer, String>();
|
758
|
private Map<Integer, String> taxRelQualifierCacheMap = new HashMap<Integer, String>();
|
759
|
private Map<Integer, String> taxRelZooQualifierCacheMap = new HashMap<Integer, String>();
|
760
|
private Map<Integer, String> sourceUseCacheMap = new HashMap<Integer, String>();
|
761
|
private Map<Integer, String> fossilStatusCacheMap = new HashMap<Integer, String>();
|
762
|
private Map<Integer, String> typeDesigStatusCacheMap = new HashMap<Integer, String>();
|
763
|
private Map<Integer, String> sourceCategoryCacheMap = new HashMap<Integer, String>();
|
764
|
private Map<Integer, String> occurrenceStatusCacheMap = new HashMap<Integer, String>();
|
765
|
private Map<Integer, Map<Integer, String>> rankCacheMap = new HashMap<Integer, Map<Integer, String>>();
|
766
|
private Map<Integer, Map<Integer, String>> rankAbbrevCacheMap = new HashMap<Integer, Map<Integer, String>>();
|
767
|
|
768
|
|
769
|
private Source destination;
|
770
|
|
771
|
public PesiTransformer(Source destination) {
|
772
|
super();
|
773
|
this.destination = destination;
|
774
|
fillMaps();
|
775
|
}
|
776
|
|
777
|
private void fillMaps() {
|
778
|
//TDWG
|
779
|
try {
|
780
|
String sql = " SELECT AreaId, AreaName, AreaTdwgCode, AreaEmCode, AreaFaEuCode FROM Area";
|
781
|
ResultSet rs = destination.getResultSet(sql);
|
782
|
while (rs.next()){
|
783
|
String tdwg = rs.getString("AreaTdwgCode");
|
784
|
Integer id = rs.getInt("AreaId");
|
785
|
String label = rs.getString("AreaName");
|
786
|
|
787
|
if (StringUtils.isNotBlank(tdwg)){
|
788
|
this.tdwgKeyMap.put(tdwg, id);
|
789
|
}
|
790
|
this.areaCacheMap.put(id, label);
|
791
|
}
|
792
|
|
793
|
//rankCache
|
794
|
sql = " SELECT KingdomId, RankId, Rank, RankAbbrev FROM Rank";
|
795
|
rs = destination.getResultSet(sql);
|
796
|
while (rs.next()){
|
797
|
String rank = rs.getString("Rank");
|
798
|
String abbrev = rs.getString("RankAbbrev");
|
799
|
Integer rankId = rs.getInt("RankId");
|
800
|
Integer kingdomId = rs.getInt("KingdomId");
|
801
|
|
802
|
//rank str
|
803
|
Map<Integer, String> kingdomMap = rankCacheMap.get(kingdomId);
|
804
|
if (kingdomMap == null){
|
805
|
kingdomMap = new HashMap<Integer, String>();
|
806
|
rankCacheMap.put(kingdomId, kingdomMap);
|
807
|
}
|
808
|
kingdomMap.put(rankId, rank);
|
809
|
|
810
|
//rank abbrev
|
811
|
Map<Integer, String> kingdomAbbrevMap = rankAbbrevCacheMap.get(kingdomId);
|
812
|
if (kingdomAbbrevMap == null){
|
813
|
kingdomAbbrevMap = new HashMap<Integer, String>();
|
814
|
rankAbbrevCacheMap.put(kingdomId, kingdomAbbrevMap);
|
815
|
}
|
816
|
if (StringUtils.isNotBlank(abbrev)){
|
817
|
kingdomAbbrevMap.put(rankId, abbrev);
|
818
|
}
|
819
|
|
820
|
}
|
821
|
|
822
|
//languageCache
|
823
|
fillSingleMap(languageCacheMap,"Language");
|
824
|
|
825
|
//feature / note category
|
826
|
fillSingleMap(featureCacheMap,"NoteCategory");
|
827
|
|
828
|
//nameStatusCache
|
829
|
fillSingleMap(nameStatusCacheMap,"NameStatus", "NomStatus");
|
830
|
|
831
|
//qualityStatusCache
|
832
|
fillSingleMap(qualityStatusCacheMap,"QualityStatus");
|
833
|
|
834
|
//taxonStatusCache
|
835
|
fillSingleMap(taxonStatusCacheMap,"TaxonStatus", "Status");
|
836
|
|
837
|
//sourceUse
|
838
|
fillSingleMap(sourceUseCacheMap,"SourceUse");
|
839
|
|
840
|
//fossil status
|
841
|
fillSingleMap(fossilStatusCacheMap,"FossilStatus");
|
842
|
|
843
|
//fossil status
|
844
|
fillSingleMap(typeDesigStatusCacheMap,"FossilStatus");
|
845
|
|
846
|
//fossil status
|
847
|
fillSingleMap(occurrenceStatusCacheMap,"OccurrenceStatus");
|
848
|
|
849
|
//source category
|
850
|
fillSingleMap(sourceCategoryCacheMap,"SourceCategory", "Category", "SourceCategoryId");
|
851
|
|
852
|
//RelTaxonQualifier
|
853
|
sql = " SELECT QualifierId, Qualifier, ZoologQualifier FROM RelTaxonQualifier ";
|
854
|
rs = destination.getResultSet(sql);
|
855
|
while (rs.next()){
|
856
|
Integer key = rs.getInt("QualifierId");
|
857
|
String cache = rs.getString("Qualifier");
|
858
|
if (StringUtils.isNotBlank(cache)){
|
859
|
this.taxRelQualifierCacheMap.put(key, cache);
|
860
|
}
|
861
|
String zoologCache = rs.getString("ZoologQualifier");
|
862
|
if (StringUtils.isNotBlank(zoologCache)){
|
863
|
this.taxRelZooQualifierCacheMap.put(key, zoologCache);
|
864
|
}
|
865
|
}
|
866
|
|
867
|
} catch (SQLException e) {
|
868
|
logger.error("SQLException when trying to read area map", e);
|
869
|
e.printStackTrace();
|
870
|
}
|
871
|
|
872
|
}
|
873
|
|
874
|
private void fillSingleMap(Map<Integer, String> map, String tableName) throws SQLException {
|
875
|
fillSingleMap(map, tableName, tableName, tableName + "Id");
|
876
|
}
|
877
|
|
878
|
private void fillSingleMap(Map<Integer, String> map, String tableName, String attr) throws SQLException {
|
879
|
fillSingleMap(map, tableName, attr, attr + "Id");
|
880
|
}
|
881
|
|
882
|
private void fillSingleMap(Map<Integer, String> map, String tableName, String attr, String idAttr) throws SQLException {
|
883
|
String sql;
|
884
|
ResultSet rs;
|
885
|
sql = " SELECT %s, %s FROM %s ";
|
886
|
sql = String.format(sql, idAttr, attr, tableName);
|
887
|
rs = destination.getResultSet(sql);
|
888
|
while (rs.next()){
|
889
|
Integer key = rs.getInt(idAttr);
|
890
|
String cache = rs.getString(attr);
|
891
|
if (StringUtils.isNotBlank(cache)){
|
892
|
map.put(key, cache);
|
893
|
}
|
894
|
}
|
895
|
}
|
896
|
|
897
|
/**
|
898
|
* Converts the databaseString to its abbreviation if its known.
|
899
|
* Otherwise the databaseString is returned.
|
900
|
* @param databaseString
|
901
|
* @return
|
902
|
*/
|
903
|
public static String databaseString2Abbreviation(String databaseString) {
|
904
|
String result = databaseString;
|
905
|
if (databaseString.equals("Fauna Europaea database")) {
|
906
|
result = "FaEu";
|
907
|
}
|
908
|
return result;
|
909
|
}
|
910
|
|
911
|
|
912
|
/**
|
913
|
* Returns the OccurrenceStatusId for a given PresenceAbsenceTerm.
|
914
|
* @param term
|
915
|
* @return
|
916
|
* @throws UnknownCdmTypeException
|
917
|
*/
|
918
|
public static Integer presenceAbsenceTerm2OccurrenceStatusId(PresenceAbsenceTermBase<?> term) {
|
919
|
Integer result = null;
|
920
|
if (term == null){
|
921
|
return null;
|
922
|
//present
|
923
|
}else if (term.isInstanceOf(PresenceTerm.class)) {
|
924
|
PresenceTerm presenceTerm = CdmBase.deproxy(term, PresenceTerm.class);
|
925
|
if (presenceTerm.equals(PresenceTerm.PRESENT()) ||
|
926
|
presenceTerm.equals(PresenceTerm.INTRODUCED_DOUBTFULLY_INTRODUCED()) ||
|
927
|
presenceTerm.equals(PresenceTerm.NATIVE_DOUBTFULLY_NATIVE())) {
|
928
|
result = STATUS_PRESENT;
|
929
|
} else if (presenceTerm.equals(PresenceTerm.NATIVE())) {
|
930
|
result = STATUS_NATIVE;
|
931
|
} else if (presenceTerm.equals(PresenceTerm.INTRODUCED()) ||
|
932
|
presenceTerm.equals(PresenceTerm.INTRODUCED_ADVENTITIOUS()) ||
|
933
|
presenceTerm.equals(PresenceTerm.INTRODUCED_UNCERTAIN_DEGREE_OF_NATURALISATION())) {
|
934
|
result = STATUS_INTRODUCED;
|
935
|
} else if (presenceTerm.equals(PresenceTerm.NATURALISED())
|
936
|
|| presenceTerm.equals(PresenceTerm.INTRODUCED_NATURALIZED())) {
|
937
|
result = STATUS_NATURALISED;
|
938
|
} else if (presenceTerm.equals(PresenceTerm.INVASIVE())) {
|
939
|
result = STATUS_INVASIVE;
|
940
|
} else if (presenceTerm.equals(PresenceTerm.CULTIVATED())) {
|
941
|
result = STATUS_MANAGED;
|
942
|
} else if (presenceTerm.equals(PresenceTerm.PRESENT_DOUBTFULLY())||
|
943
|
presenceTerm.equals(PresenceTerm.INTRODUCED_PRESENCE_QUESTIONABLE()) ||
|
944
|
presenceTerm.equals(PresenceTerm.NATIVE_PRESENCE_QUESTIONABLE() )) {
|
945
|
result = STATUS_DOUBTFUL;
|
946
|
} else {
|
947
|
logger.error("PresenceTerm could not be translated to datawarehouse occurrence status id: " + presenceTerm.getLabel());
|
948
|
}
|
949
|
//absent
|
950
|
} else if (term.isInstanceOf(AbsenceTerm.class)) {
|
951
|
AbsenceTerm absenceTerm = CdmBase.deproxy(term, AbsenceTerm.class);
|
952
|
if (absenceTerm.equals(AbsenceTerm.ABSENT()) || absenceTerm.equals(AbsenceTerm.NATIVE_FORMERLY_NATIVE()) ||
|
953
|
absenceTerm.equals(AbsenceTerm.CULTIVATED_REPORTED_IN_ERROR()) || absenceTerm.equals(AbsenceTerm.INTRODUCED_REPORTED_IN_ERROR()) ||
|
954
|
absenceTerm.equals(AbsenceTerm.INTRODUCED_FORMERLY_INTRODUCED()) || absenceTerm.equals(AbsenceTerm.NATIVE_REPORTED_IN_ERROR() ) ) {
|
955
|
result = STATUS_ABSENT;
|
956
|
} else {
|
957
|
logger.error("AbsenceTerm could not be translated to datawarehouse occurrence status id: " + absenceTerm.getLabel());
|
958
|
}
|
959
|
}
|
960
|
return result;
|
961
|
}
|
962
|
|
963
|
|
964
|
@Override
|
965
|
public String getCacheByPresenceAbsenceTerm(PresenceAbsenceTermBase status) throws UndefinedTransformerMethodException {
|
966
|
if (status == null){
|
967
|
return null;
|
968
|
}else{
|
969
|
return this.occurrenceStatusCacheMap.get(getKeyByPresenceAbsenceTerm(status));
|
970
|
}
|
971
|
}
|
972
|
|
973
|
@Override
|
974
|
public Object getKeyByPresenceAbsenceTerm(PresenceAbsenceTermBase status) throws UndefinedTransformerMethodException {
|
975
|
return presenceAbsenceTerm2OccurrenceStatusId(status);
|
976
|
}
|
977
|
|
978
|
|
979
|
|
980
|
@Override
|
981
|
public String getCacheByNamedArea(NamedArea namedArea) throws UndefinedTransformerMethodException {
|
982
|
NamedArea area = CdmBase.deproxy(namedArea, NamedArea.class);
|
983
|
if (area == null){
|
984
|
return null;
|
985
|
}else{
|
986
|
return this.areaCacheMap.get(getKeyByNamedArea(area));
|
987
|
}
|
988
|
}
|
989
|
|
990
|
|
991
|
@Override
|
992
|
public Object getKeyByNamedArea(NamedArea area) throws UndefinedTransformerMethodException {
|
993
|
NamedArea namedArea = CdmBase.deproxy(area, NamedArea.class);
|
994
|
|
995
|
if (area == null) {
|
996
|
return null;
|
997
|
//TDWG areas
|
998
|
} else if (area.getVocabulary().getUuid().equals(NamedArea.uuidTdwgAreaVocabulary)) {
|
999
|
String abbrevLabel = namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel();
|
1000
|
Integer result = this.tdwgKeyMap.get(abbrevLabel);
|
1001
|
if (result == null){
|
1002
|
logger.warn("Unknown TDWGArea: " + area.getTitleCache());
|
1003
|
}
|
1004
|
return result;
|
1005
|
//countries
|
1006
|
}else if (namedArea.isInstanceOf(Country.class)){
|
1007
|
if (namedArea.equals(Country.UKRAINE())) { return AREA_UKRAINE_INCLUDING_CRIMEA; }
|
1008
|
else if (namedArea.equals(Country.AZERBAIJANREPUBLICOF())) { return AREA_AZERBAIJAN_INCLUDING_NAKHICHEVAN; }
|
1009
|
else if (namedArea.equals(Country.GEORGIA())) { return AREA_GEORGIA; }
|
1010
|
else if (namedArea.equals(Country.RUSSIANFEDERATION())) { return AREA_THE_RUSSIAN_FEDERATION; }
|
1011
|
else if (namedArea.equals(Country.UNITEDKINGDOMOFGREATBRITAINANDNORTHERNIRELAND())) { return AREA_UNITED_KINGDOM; }
|
1012
|
else if (namedArea.equals(Country.DENMARKKINGDOMOF())) { return AREA_DENMARK_COUNTRY; }
|
1013
|
else if (namedArea.equals(Country.TURKEYREPUBLICOF())) { return AREA_TURKEY_COUNTRY; }
|
1014
|
else {
|
1015
|
logger.warn("Unknown Country: " + area.getTitleCache());
|
1016
|
}
|
1017
|
}else{ //Non TDWG, non country
|
1018
|
//EM
|
1019
|
if ( namedArea.getUuid().equals(BerlinModelTransformer.uuidMadeira)){ return AREA_MADEIRA; }
|
1020
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidDesertas)) { return AREA_DESERTAS; }
|
1021
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidPortoSanto)) { return AREA_PORTO_SANTO; }
|
1022
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidFlores)) { return AREA_FLORES; }
|
1023
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidCorvo)) { return AREA_CORVO; }
|
1024
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidFaial)) { return AREA_FAIAL; }
|
1025
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidGraciosa)) { return AREA_GRACIOSA; }
|
1026
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidSaoJorge)) { return AREA_SAO_JORGE; }
|
1027
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidSaoMiguel)) { return AREA_SAO_MIGUEL; }
|
1028
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidPico)) { return AREA_PICO; }
|
1029
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidSantaMaria)) { return AREA_SANTA_MARIA; }
|
1030
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidTerceira)) { return AREA_TERCEIRA; }
|
1031
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidGranCanaria)) { return AREA_GRAN_CANARIA; }
|
1032
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidFuerteventura)) { return AREA_FUERTEVENTURA_WITH_LOBOS; }
|
1033
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidGomera)) { return AREA_GOMERA; }
|
1034
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidHierro)) { return AREA_HIERRO; }
|
1035
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidLanzaroteWithGraciosa)) { return AREA_LANZAROTE_WITH_GRACIOSA; }
|
1036
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidLaPalma)) { return AREA_LA_PALMA; }
|
1037
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidTenerife)) { return AREA_TENERIFE; }
|
1038
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidIbizaWithFormentera)) { return AREA_IBIZA_WITH_FORMENTERA; }
|
1039
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidMallorca)) { return AREA_MALLORCA; }
|
1040
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidMenorca)) { return AREA_MENORCA; }
|
1041
|
|
1042
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidUssr)) { return AREA_FORMER_USSR; }
|
1043
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidRussiaBaltic)) { return AREA_RUSSIA_BALTIC; }
|
1044
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidRussiaSouthEast)) { return AREA_RUSSIA_SOUTHEAST; }
|
1045
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidRussiaSouthWest)) { return AREA_RUSSIA_SOUTHWEST; }
|
1046
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidRussiaCentral)) { return AREA_RUSSIA_CENTRAL; }
|
1047
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidRussiaNorthern)) { return AREA_RUSSIA_NORTHERN; }
|
1048
|
|
1049
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidTurkey)) { return AREA_TURKEY; }
|
1050
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidEastAegeanIslands)) { return AREA_EAST_AEGEAN_ISLANDS; }
|
1051
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidTurkishEastAegeanIslands)) { return AREA_TURKISH_EAST_AEGEAN_ISLANDS; }
|
1052
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidSerbiaMontenegro)) { return AREA_SERBIA_WITH_MONTENEGRO; }
|
1053
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidSerbia)) { return AREA_SERBIA_INCLUDING_VOJVODINA_AND_WITH_KOSOVO; }
|
1054
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidCaucasia)) { return AREA_CAUCASUS_REGION; }
|
1055
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidUkraineAndCrimea)) { return AREA_UKRAINE_INCLUDING_CRIMEA; }
|
1056
|
else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidAzerbaijanNakhichevan)) { return AREA_AZERBAIJAN_INCLUDING_NAKHICHEVAN; }
|
1057
|
|
1058
|
//FE
|
1059
|
else if (namedArea.getUuid().equals(FaunaEuropaeaTransformer.uuidAreaAFR)) { return AREA_AFRO_TROPICAL_REGION; }
|
1060
|
else if (namedArea.getUuid().equals(FaunaEuropaeaTransformer.uuidAreaAUS)) { return AREA_AUSTRALIAN_REGION; }
|
1061
|
else if (namedArea.getUuid().equals(FaunaEuropaeaTransformer.uuidAreaEPA)) { return AREA_EAST_PALAEARCTIC; }
|
1062
|
else if (namedArea.getUuid().equals(FaunaEuropaeaTransformer.uuidAreaGR_AEG)) { return AREA_NORTH_AEGEAN_ISLANDS; }
|
1063
|
else if (namedArea.getUuid().equals(FaunaEuropaeaTransformer.uuidAreaGR_CYC)) { return AREA_CYCLADES_ISLANDS; }
|
1064
|
else if (namedArea.getUuid().equals(FaunaEuropaeaTransformer.uuidAreaGR_DOD)) { return AREA_DODECANESE_ISLANDS; }
|
1065
|
else if (namedArea.getUuid().equals(FaunaEuropaeaTransformer.uuidAreaGR_CR)) { return AREA_CRETE; }
|
1066
|
else if (namedArea.getUuid().equals(FaunaEuropaeaTransformer.uuidAreaGR_GRC)) { return AREA_GREEK_MAINLAND; }
|
1067
|
else if (namedArea.getUuid().equals(FaunaEuropaeaTransformer.uuidAreaNAF)) { return AREA_NORTHERN_AFRICA; }
|
1068
|
else if (namedArea.getUuid().equals(FaunaEuropaeaTransformer.uuidAreaNEA)) { return AREA_NEARCTIC_REGION; }
|
1069
|
else if (namedArea.getUuid().equals(FaunaEuropaeaTransformer.uuidAreaNEO)) { return AREA_NEOTROPICAL_REGION; }
|
1070
|
else if (namedArea.getUuid().equals(FaunaEuropaeaTransformer.uuidAreaNRE)) { return AREA_NEAR_EAST; }
|
1071
|
else if (namedArea.getUuid().equals(FaunaEuropaeaTransformer.uuidAreaORR)) { return AREA_ORIENTAL_REGION; }
|
1072
|
else if (namedArea.getUuid().equals(FaunaEuropaeaTransformer.uuidAreaUA)) { return AREA_UKRAINE_INCLUDING_CRIMEA; }
|
1073
|
else if (namedArea.getUuid().equals(FaunaEuropaeaTransformer.uuidAreaRU_FJL)) { return AREA_FRANZ_JOSEF_LAND; }
|
1074
|
else if (namedArea.getUuid().equals(FaunaEuropaeaTransformer.uuidAreaRU_NOZ)) { return AREA_NOVAYA_ZEMLYA; }
|
1075
|
|
1076
|
|
1077
|
//ERMS
|
1078
|
else if (namedArea.getUuid().equals(ErmsTransformer.uuidEuropeanMarineWaters)) { return AREA_EUROPEAN_MARINE_WATERS; }
|
1079
|
else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("MES") ||
|
1080
|
(namedArea.getUuid().equals(ErmsTransformer.uuidMediterraneanSea))) { return AREA_MEDITERRANEAN_SEA; } // abbreviated label missing
|
1081
|
else if (namedArea.getUuid().equals(ErmsTransformer.uuidWhiteSea)) { return AREA_WHITE_SEA; }
|
1082
|
else if (namedArea.getUuid().equals(ErmsTransformer.uuidNorthSea)) { return AREA_NORTH_SEA; }
|
1083
|
else if (namedArea.getUuid().equals(ErmsTransformer.uuidBalticSea)) { return AREA_BALTIC_SEA; }
|
1084
|
else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("BLS") ||
|
1085
|
(namedArea.getUuid().equals(ErmsTransformer.uuidBlackSea))) { return AREA_BLACK_SEA; } // abbreviated label missing
|
1086
|
else if (namedArea.getUuid().equals(ErmsTransformer.uuidBarentsSea)) { return AREA_BARENTS_SEA; }
|
1087
|
else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("CAS") ||
|
1088
|
(namedArea.getUuid().equals(ErmsTransformer.uuidCaspianSea))) { return AREA_CASPIAN_SEA; } // abbreviated label missingelse if (namedArea.getUuid().equals(ErmsTransformer.uuidPortugueseExclusiveEconomicZone)) { return AREA_PORTUGUESE_EXCLUSIVE_ECONOMIC_ZONE; }
|
1089
|
else if (namedArea.getUuid().equals(ErmsTransformer.uuidBelgianExclusiveEconomicZone)) { return AREA_BELGIAN_EXCLUSIVE_ECONOMIC_ZONE; }
|
1090
|
else if (namedArea.getUuid().equals(ErmsTransformer.uuidFrenchExclusiveEconomicZone)) { return AREA_FRENCH_EXCLUSIVE_ECONOMIC_ZONE; }
|
1091
|
else if (namedArea.getUuid().equals(ErmsTransformer.uuidEnglishChannel)) { return AREA_ENGLISH_CHANNEL; }
|
1092
|
else if (namedArea.getUuid().equals(ErmsTransformer.uuidAdriaticSea)) { return AREA_ADRIATIC_SEA; }
|
1093
|
else if (namedArea.getUuid().equals(ErmsTransformer.uuidBiscayBay)) { return AREA_BISCAY_BAY; }
|
1094
|
else if (namedArea.getUuid().equals(ErmsTransformer.uuidDutchExclusiveEconomicZone)) { return AREA_DUTCH_EXCLUSIVE_ECONOMIC_ZONE; }
|
1095
|
else if (namedArea.getUuid().equals(ErmsTransformer.uuidUnitedKingdomExclusiveEconomicZone)) { return AREA_UNITED_KINGDOM_EXCLUSIVE_ECONOMIC_ZONE; }
|
1096
|
else if (namedArea.getUuid().equals(ErmsTransformer.uuidSpanishExclusiveEconomicZone)) { return AREA_SPANISH_EXCLUSIVE_ECONOMIC_ZONE; }
|
1097
|
else if (namedArea.getUuid().equals(ErmsTransformer.uuidEgyptianExclusiveEconomicZone)) { return AREA_EGYPTIAN_EXCLUSIVE_ECONOMIC_ZONE; }
|
1098
|
else if (namedArea.getUuid().equals(ErmsTransformer.uuidGrecianExclusiveEconomicZone)) { return AREA_GRECIAN_EXCLUSIVE_ECONOMIC_ZONE; }
|
1099
|
else if (namedArea.getUuid().equals(ErmsTransformer.uuidTirrenoSea)) { return AREA_TIRRENO_SEA; }
|
1100
|
else if (namedArea.getUuid().equals(ErmsTransformer.uuidIcelandicExclusiveEconomicZone)) { return AREA_ICELANDIC_EXCLUSIVE_ECONOMIC_ZONE; }
|
1101
|
else if (namedArea.getUuid().equals(ErmsTransformer.uuidIrishExclusiveeconomicZone)) { return AREA_IRISH_EXCLUSIVE_ECONOMIC_ZONE; }
|
1102
|
else if (namedArea.getUuid().equals(ErmsTransformer.uuidIrishSea)) { return AREA_IRISH_SEA; }
|
1103
|
else if (namedArea.getUuid().equals(ErmsTransformer.uuidItalianExclusiveEconomicZone)) { return AREA_ITALIAN_EXCLUSIVE_ECONOMIC_ZONE; }
|
1104
|
else if (namedArea.getUuid().equals(ErmsTransformer.uuidNorwegianSea)) { return AREA_NORWEGIAN_SEA; }
|
1105
|
else if (namedArea.getUuid().equals(ErmsTransformer.uuidMoroccanExclusiveEconomicZone)) { return AREA_MOROCCAN_EXCLUSIVE_ECONOMIC_ZONE; }
|
1106
|
else if (namedArea.getUuid().equals(ErmsTransformer.uuidNorwegianExclusiveEconomicZone)) { return AREA_NORWEGIAN_EXCLUSIVE_ECONOMIC_ZONE; }
|
1107
|
else if (namedArea.getUuid().equals(ErmsTransformer.uuidSkagerrak)) { return AREA_SKAGERRAK; }
|
1108
|
else if (namedArea.getUuid().equals(ErmsTransformer.uuidTunisianExclusiveEconomicZone)) { return AREA_TUNISIAN_EXCLUSIVE_ECONOMIC_ZONE; }
|
1109
|
else if (namedArea.getUuid().equals(ErmsTransformer.uuidWaddenSea)) { return AREA_WADDEN_SEA; }
|
1110
|
else if (namedArea.getUuid().equals(ErmsTransformer.uuidBeltSea)) { return AREA_BELT_SEA; }
|
1111
|
else if (namedArea.getUuid().equals(ErmsTransformer.uuidMarmaraSea)) { return AREA_MARMARA_SEA; }
|
1112
|
else if (namedArea.getUuid().equals(ErmsTransformer.uuidSeaofAzov)) { return AREA_SEA_OF_AZOV; }
|
1113
|
else if (namedArea.getUuid().equals(ErmsTransformer.uuidAegeanSea)) { return AREA_AEGEAN_SEA; }
|
1114
|
else if (namedArea.getUuid().equals(ErmsTransformer.uuidBulgarianExclusiveEconomicZone)) { return AREA_BULGARIAN_EXCLUSIVE_ECONOMIC_ZONE; }
|
1115
|
else if (namedArea.getUuid().equals(ErmsTransformer.uuidSouthBalticproper)) { return AREA_SOUTH_BALTIC_PROPER; }
|
1116
|
else if (namedArea.getUuid().equals(ErmsTransformer.uuidBalticProper)) { return AREA_BALTIC_PROPER; }
|
1117
|
else if (namedArea.getUuid().equals(ErmsTransformer.uuidNorthBalticproper)) { return AREA_NORTH_BALTIC_PROPER; }
|
1118
|
else if (namedArea.getUuid().equals(ErmsTransformer.uuidArchipelagoSea)) { return AREA_ARCHIPELAGO_SEA; }
|
1119
|
else if (namedArea.getUuid().equals(ErmsTransformer.uuidBothnianSea)) { return AREA_BOTHNIAN_SEA; }
|
1120
|
else if (namedArea.getUuid().equals(ErmsTransformer.uuidGermanExclusiveEconomicZone)) { return AREA_GERMAN_EXCLUSIVE_ECONOMIC_ZONE; }
|
1121
|
else if (namedArea.getUuid().equals(ErmsTransformer.uuidSwedishExclusiveEconomicZone)) { return AREA_SWEDISH_EXCLUSIVE_ECONOMIC_ZONE; }
|
1122
|
else if (namedArea.getUuid().equals(ErmsTransformer.uuidUkrainianExclusiveEconomicZone)) { return AREA_UKRAINIAN_EXCLUSIVE_ECONOMIC_ZONE; }
|
1123
|
else if (namedArea.getUuid().equals(ErmsTransformer.uuidMadeiranExclusiveEconomicZone)) { return AREA_MADEIRAN_EXCLUSIVE_ECONOMIC_ZONE; }
|
1124
|
else if (namedArea.getUuid().equals(ErmsTransformer.uuidLebaneseExclusiveEconomicZone)) { return AREA_LEBANESE_EXCLUSIVE_ECONOMIC_ZONE; }
|
1125
|
else if (namedArea.getUuid().equals(ErmsTransformer.uuidSpanishExclusiveEconomicZoneMediterraneanpart)) { return AREA_SPANISH_EXCLUSIVE_ECONOMIC_ZONE_MEDITERRANEAN_PART; }
|
1126
|
else if (namedArea.getUuid().equals(ErmsTransformer.uuidEstonianExclusiveEconomicZone)) { return AREA_ESTONIAN_EXCLUSIVE_ECONOMIC_ZONE; }
|
1127
|
else if (namedArea.getUuid().equals(ErmsTransformer.uuidCroatianExclusiveEconomicZone)) { return AREA_CROATIAN_EXCLUSIVE_ECONOMIC_ZONE; }
|
1128
|
else if (namedArea.getUuid().equals(ErmsTransformer.uuidBalearSea)) { return AREA_BALEAR_SEA; }
|
1129
|
else if (namedArea.getUuid().equals(ErmsTransformer.uuidTurkishExclusiveEconomicZone)) { return AREA_TURKISH_EXCLUSIVE_ECONOMIC_ZONE; }
|
1130
|
else if (namedArea.getUuid().equals(ErmsTransformer.uuidDanishExclusiveEconomicZone)) { return AREA_DANISH_EXCLUSIVE_ECONOMIC_ZONE; }
|
1131
|
|
1132
|
|
1133
|
else {
|
1134
|
logger.warn("Unknown NamedArea Area: " + area.getTitleCache());
|
1135
|
}
|
1136
|
|
1137
|
}
|
1138
|
return null;
|
1139
|
}
|
1140
|
|
1141
|
|
1142
|
/**
|
1143
|
* Returns the PESI SourceUseId for a given CDM sourceUseId.
|
1144
|
* @param sourceUseId
|
1145
|
* @return
|
1146
|
*/
|
1147
|
public static Integer sourceUseIdSourceUseId(Integer sourceUseId) {
|
1148
|
// TODO: CDM sourceUseId and PESI sourceUseId are equal for now.
|
1149
|
Integer result = null;
|
1150
|
switch (sourceUseId) {
|
1151
|
case 3: return ADDITIONAL_SOURCE;
|
1152
|
case 4: return SOURCE_OF_SYNONYMY;
|
1153
|
case 8: return NOMENCLATURAL_REFERENCE;
|
1154
|
}
|
1155
|
return result;
|
1156
|
}
|
1157
|
|
1158
|
|
1159
|
/**
|
1160
|
* Returns the FossilStatusCache to a given Fossil.
|
1161
|
* @param fossil
|
1162
|
* @return
|
1163
|
*/
|
1164
|
public static String fossil2FossilStatusCache(DerivedUnit fossil) {
|
1165
|
String result = null;
|
1166
|
return result;
|
1167
|
}
|
1168
|
|
1169
|
/**
|
1170
|
* Returns the FossilStatusId to a given Fossil.
|
1171
|
* @param fossil
|
1172
|
* @return
|
1173
|
*/
|
1174
|
public static Integer fossil2FossilStatusId(DerivedUnit fossil) {
|
1175
|
Integer result = null;
|
1176
|
return result;
|
1177
|
}
|
1178
|
|
1179
|
|
1180
|
|
1181
|
@Override
|
1182
|
public Object getKeyByLanguage(Language language) throws UndefinedTransformerMethodException {
|
1183
|
return language2LanguageId(language);
|
1184
|
}
|
1185
|
|
1186
|
@Override
|
1187
|
public String getCacheByLanguage(Language language) throws UndefinedTransformerMethodException {
|
1188
|
if (language == null){
|
1189
|
return null;
|
1190
|
}else{
|
1191
|
return this.languageCacheMap.get(getKeyByLanguage(language));
|
1192
|
}
|
1193
|
}
|
1194
|
|
1195
|
|
1196
|
/**
|
1197
|
* Returns the identifier of the given Language.
|
1198
|
* @param language
|
1199
|
* @return
|
1200
|
*/
|
1201
|
public static Integer language2LanguageId(Language language) {
|
1202
|
if (language == null ) {
|
1203
|
return null;
|
1204
|
}
|
1205
|
if (language.equals(Language.ALBANIAN())) {
|
1206
|
return Language_Albanian;
|
1207
|
} else if (language.equals(Language.ARABIC())) {
|
1208
|
return Language_Arabic;
|
1209
|
} else if (language.equals(Language.ARMENIAN())) {
|
1210
|
return Language_Armenian;
|
1211
|
} else if (language.equals(Language.AZERBAIJANI())) {
|
1212
|
return Language_Azerbaijan;
|
1213
|
} else if (language.equals(Language.BELORUSSIAN())) {
|
1214
|
return Language_Belarusian;
|
1215
|
} else if (language.equals(Language.BULGARIAN())) {
|
1216
|
return Language_Bulgarian;
|
1217
|
} else if (language.equals(Language.CATALAN_VALENCIAN())) {
|
1218
|
return Language_Catalan;
|
1219
|
} else if (language.equals(Language.CROATIAN())) {
|
1220
|
return Language_Croat;
|
1221
|
} else if (language.equals(Language.CZECH())) {
|
1222
|
return Language_Czech;
|
1223
|
} else if (language.equals(Language.DANISH())) {
|
1224
|
return Language_Danish;
|
1225
|
} else if (language.equals(Language.DUTCH_MIDDLE())) {
|
1226
|
return Language_Dutch;
|
1227
|
} else if (language.equals(Language.ENGLISH())) {
|
1228
|
return Language_English;
|
1229
|
// } else if (language.equals(Language.)) {
|
1230
|
// return Language_Euskera;
|
1231
|
} else if (language.equals(Language.ESTONIAN())) {
|
1232
|
return Language_Estonian;
|
1233
|
} else if (language.equals(Language.FINNISH())) {
|
1234
|
return Language_Finnish;
|
1235
|
} else if (language.equals(Language.FRENCH())) {
|
1236
|
return Language_French;
|
1237
|
} else if (language.equals(Language.GEORGIAN())) {
|
1238
|
return Language_Georgian;
|
1239
|
} else if (language.equals(Language.GERMAN())) {
|
1240
|
return Language_German;
|
1241
|
} else if (language.equals(Language.GREEK_MODERN())) {
|
1242
|
return Language_Greek;
|
1243
|
} else if (language.equals(Language.HUNGARIAN())) {
|
1244
|
return Language_Hungarian;
|
1245
|
} else if (language.equals(Language.ICELANDIC())) {
|
1246
|
return Language_Icelandic;
|
1247
|
} else if (language.equals(Language.IRISH())) {
|
1248
|
return Language_Irish_Gaelic;
|
1249
|
} else if (language.equals(Language.HEBREW())) {
|
1250
|
return Language_Israel_Hebrew;
|
1251
|
} else if (language.equals(Language.ITALIAN())) {
|
1252
|
return Language_Italian;
|
1253
|
} else if (language.equals(Language.LATVIAN())) {
|
1254
|
return Language_Latvian;
|
1255
|
} else if (language.equals(Language.LITHUANIAN())) {
|
1256
|
return Language_Lithuanian;
|
1257
|
} else if (language.equals(Language.MACEDONIAN())) {
|
1258
|
return Language_Macedonian;
|
1259
|
} else if (language.equals(Language.MALTESE())) {
|
1260
|
return Language_Maltese;
|
1261
|
} else if (language.equals(Language.MOLDAVIAN())) {
|
1262
|
return Language_Moldovian;
|
1263
|
} else if (language.equals(Language.NORWEGIAN())) {
|
1264
|
return Language_Norwegian;
|
1265
|
} else if (language.equals(Language.POLISH())) {
|
1266
|
return Language_Polish;
|
1267
|
} else if (language.equals(Language.PORTUGUESE())) {
|
1268
|
return Language_Portuguese;
|
1269
|
} else if (language.equals(Language.ROMANIAN())) {
|
1270
|
return Language_Roumanian;
|
1271
|
} else if (language.equals(Language.RUSSIAN())) {
|
1272
|
return Language_Russian;
|
1273
|
// } else if (language.equals(Language.)) {
|
1274
|
// return Language_Russian_Caucasian;
|
1275
|
// } else if (language.equals(Language.)) {
|
1276
|
// return Language_Russian_Altaic_kalmyk_oirat;
|
1277
|
// } else if (language.equals(Language.)) {
|
1278
|
// return Language_Russian_Altaic_karachay_balkar;
|
1279
|
// } else if (language.equals(Language.)) {
|
1280
|
// return Language_Russian_Altaic_kumyk;
|
1281
|
// } else if (language.equals(Language.)) {
|
1282
|
// return Language_Russian_Altaic_nogai;
|
1283
|
// } else if (language.equals(Language.)) {
|
1284
|
// return Language_Russian_Altaic_north_azerbaijani;
|
1285
|
// } else if (language.equals(Language.)) {
|
1286
|
// return Language_Russian_Indo_european_russian;
|
1287
|
// } else if (language.equals(Language.)) {
|
1288
|
// return Language_Russian_Indo_european_kalmyk_oirat;
|
1289
|
// } else if (language.equals(Language.)) {
|
1290
|
// return Language_Russian_Indo_european_osetin;
|
1291
|
// } else if (language.equals(Language.)) {
|
1292
|
// return Language_Russian_North_caucasian_abaza;
|
1293
|
// } else if (language.equals(Language.)) {
|
1294
|
// return Language_Russian_North_caucasian_adyghe;
|
1295
|
// } else if (language.equals(Language.)) {
|
1296
|
// return Language_Russian_North_caucasian_chechen;
|
1297
|
// } else if (language.equals(Language.)) {
|
1298
|
// return Language_Russian_North_caucasian_kabardian;
|
1299
|
// } else if (language.equals(Language.)) {
|
1300
|
// return Language_Russian_North_caucasian_lak;
|
1301
|
// } else if (language.equals(Language.)) {
|
1302
|
// return Language_Russian_North_caucasian_avar;
|
1303
|
// } else if (language.equals(Language.)) {
|
1304
|
// return Language_Russian_North_caucasian_in;
|
1305
|
// } else if (language.equals(Language.)) {
|
1306
|
// return Language_Russian_Uralic_chuvash;
|
1307
|
// } else if (language.equals(Language.)) {
|
1308
|
// return Language_Russian_Uralic_udmurt;
|
1309
|
} else if (language.equals(Language.SERBIAN())) {
|
1310
|
return Language_Serbian;
|
1311
|
} else if (language.equals(Language.SLOVAK())) {
|
1312
|
return Language_Slovak;
|
1313
|
} else if (language.equals(Language.SLOVENIAN())) {
|
1314
|
return Language_Slovene;
|
1315
|
} else if (language.equals(Language.SPANISH_CASTILIAN())) {
|
1316
|
return Language_Spanish_Castillian;
|
1317
|
} else if (language.equals(Language.SWEDISH())) {
|
1318
|
return Language_Swedish;
|
1319
|
} else if (language.equals(Language.TURKISH())) {
|
1320
|
return Language_Turkish;
|
1321
|
} else if (language.equals(Language.UKRAINIAN())) {
|
1322
|
return Language_Ukraine;
|
1323
|
} else if (language.equals(Language.WELSH())) {
|
1324
|
return Language_Welsh;
|
1325
|
} else if (language.equals(Language.CORSICAN())) {
|
1326
|
return Language_Corsican;
|
1327
|
} else {
|
1328
|
logger.debug("Unknown Language: " + language.getTitleCache());
|
1329
|
return null;
|
1330
|
}
|
1331
|
}
|
1332
|
|
1333
|
/**
|
1334
|
* Returns the NodeCategoryCache for a given TextData.
|
1335
|
* @param feature
|
1336
|
* @return
|
1337
|
*/
|
1338
|
public String getCacheByFeature(Feature feature) {
|
1339
|
if (feature == null){
|
1340
|
return null;
|
1341
|
}else{
|
1342
|
return this.featureCacheMap.get(feature2NoteCategoryFk(feature));
|
1343
|
}
|
1344
|
}
|
1345
|
|
1346
|
/**
|
1347
|
* Returns the NodeCategoryFk for a given TextData.
|
1348
|
* @param feature
|
1349
|
* @return
|
1350
|
*/
|
1351
|
public static Integer feature2NoteCategoryFk(Feature feature) {
|
1352
|
if (feature == null) {
|
1353
|
return null;
|
1354
|
}
|
1355
|
|
1356
|
if (feature.equals(Feature.DESCRIPTION())) {
|
1357
|
return NoteCategory_description;
|
1358
|
} else if (feature.equals(Feature.ECOLOGY())) {
|
1359
|
return NoteCategory_ecology;
|
1360
|
} else if (feature.equals(Feature.PHENOLOGY())) {
|
1361
|
return NoteCategory_phenology;
|
1362
|
} else if (feature.equals(Feature.COMMON_NAME())) {
|
1363
|
return NoteCategory_Common_names;
|
1364
|
} else if (feature.equals(Feature.OCCURRENCE())) {
|
1365
|
return NoteCategory_Occurrence;
|
1366
|
} else if (feature.equals(Feature.DISTRIBUTION())) {
|
1367
|
return NoteCategory_Distribution;
|
1368
|
} else if (feature.getUuid().equals(ErmsTransformer.uuidRemark)) {
|
1369
|
return NoteCategory_Remark;
|
1370
|
} else if (feature.getUuid().equals(ErmsTransformer.uuidAdditionalinformation)) {
|
1371
|
return NoteCategory_Additional_information;
|
1372
|
} else if (feature.getUuid().equals(ErmsTransformer.uuidSpelling)) {
|
1373
|
return NoteCategory_Spelling;
|
1374
|
} else if (feature.getUuid().equals(ErmsTransformer.uuidDateofPublication)) {
|
1375
|
return NoteCategory_Date_of_publication;
|
1376
|
} else if (feature.getUuid().equals(ErmsTransformer.uuidSystematics)) {
|
1377
|
return NoteCategory_Systematics;
|
1378
|
} else if (feature.getUuid().equals(ErmsTransformer.uuidClassification)) {
|
1379
|
return NoteCategory_Classification;
|
1380
|
} else if (feature.getUuid().equals(ErmsTransformer.uuidEnvironment)) {
|
1381
|
return NoteCategory_Environment;
|
1382
|
} else if (feature.getUuid().equals(ErmsTransformer.uuidHabitat)) {
|
1383
|
return NoteCategory_Habitat;
|
1384
|
} else if (feature.getUuid().equals(ErmsTransformer.uuidAuthority)) {
|
1385
|
return NoteCategory_Authority;
|
1386
|
} else if (feature.getUuid().equals(ErmsTransformer.uuidMorphology)) {
|
1387
|
return NoteCategory_Morphology;
|
1388
|
} else if (feature.getUuid().equals(ErmsTransformer.uuidTaxonomicRemarks)) {
|
1389
|
return NoteCategory_Taxonomic_Remarks;
|
1390
|
} else if (feature.getUuid().equals(ErmsTransformer.uuidNote)){
|
1391
|
return NoteCategory_Note;
|
1392
|
} else if (feature.getUuid().equals(ErmsTransformer.uuidTaxonomy)) {
|
1393
|
return NoteCategory_Taxonomy;
|
1394
|
} else if (feature.getUuid().equals(ErmsTransformer.uuidTaxonomicstatus)) {
|
1395
|
return NoteCategory_Taxonomic_status;
|
1396
|
} else if (feature.getUuid().equals(ErmsTransformer.uuidStatus)){
|
1397
|
return NoteCategory_Status;
|
1398
|
} else if (feature.getUuid().equals(ErmsTransformer.uuidRank)) {
|
1399
|
return NoteCategory_Rank;
|
1400
|
} else if (feature.getUuid().equals(ErmsTransformer.uuidHomonymy)) {
|
1401
|
return NoteCategory_Homonymy;
|
1402
|
} else if (feature.getUuid().equals(ErmsTransformer.uuidNomenclature)) {
|
1403
|
return NoteCategory_Nomenclature;
|
1404
|
} else if (feature.getUuid().equals(ErmsTransformer.uuidTaxonomicRemark)) {
|
1405
|
return NoteCategory_Taxonomic_Remark;
|
1406
|
} else if (feature.getUuid().equals(ErmsTransformer.uuidAcknowledgments)){
|
1407
|
return NoteCategory_Acknowledgments;
|
1408
|
} else if (feature.getUuid().equals(ErmsTransformer.uuidOriginalpublication)) {
|
1409
|
return NoteCategory_Original_publication;
|
1410
|
} else if (feature.getUuid().equals(ErmsTransformer.uuidTypelocality)) {
|
1411
|
return NoteCategory_Type_locality;
|
1412
|
} else if (feature.getUuid().equals(ErmsTransformer.uuidValidity)) {
|
1413
|
return NoteCategory_Validity;
|
1414
|
} else if (feature.getUuid().equals(ErmsTransformer.uuidIdentification)) {
|
1415
|
return NoteCategory_Identification;
|
1416
|
} else if (feature.getUuid().equals(ErmsTransformer.uuidSynonymy)) {
|
1417
|
return NoteCategory_Synonymy;
|
1418
|
} else if (feature.equals(Feature.CITATION())) {
|
1419
|
return null; //citations are handled differently
|
1420
|
} else if (feature.getUuid().equals(BerlinModelTransformer.uuidFeatureMaps)){
|
1421
|
return NoteCategory_Link_to_maps;
|
1422
|
} else if (feature.getUuid().equals(BerlinModelTransformer.uuidFeatureUse)){
|
1423
|
return NoteCategory_Use;
|
1424
|
} else if (feature.getUuid().equals(BerlinModelTransformer.uuidFeatureComments)){
|
1425
|
return NoteCategory_Comments;
|
1426
|
} else if (feature.getUuid().equals(BerlinModelTransformer.uuidFeatureConservationStatus)){
|
1427
|
return NoteCategory_Conservation_Status;
|
1428
|
|
1429
|
//E+M
|
1430
|
} else if (feature.getUuid().equals(BerlinModelTransformer.uuidFeatureDistrEM)){
|
1431
|
return NoteCategory_general_distribution_euromed;
|
1432
|
} else if (feature.getUuid().equals(BerlinModelTransformer.uuidFeatureDistrWorld)){
|
1433
|
return NoteCategory_general_distribution_world;
|
1434
|
} else if (feature.getUuid().equals(BerlinModelTransformer.uuidFeatureEditorBrackets)){
|
1435
|
return NoteCategory_Editor_Brackets;
|
1436
|
} else if (feature.getUuid().equals(BerlinModelTransformer.uuidFeatureEditorParenthesis)){
|
1437
|
return NoteCategory_Editor_Parenthesis;
|
1438
|
} else if (feature.getUuid().equals(BerlinModelTransformer.uuidFeatureInedited)){
|
1439
|
return NoteCategory_Inedited;
|
1440
|
} else if (feature.getUuid().equals(BerlinModelTransformer.uuidFeatureCommentsEditing)){
|
1441
|
return NoteCategory_Comments_on_editing_process;
|
1442
|
|
1443
|
|
1444
|
// TODO: Unknown NoteCategories
|
1445
|
// NoteCategory_Common_names = 12;
|
1446
|
// NoteCategory_Maps =14;
|
1447
|
|
1448
|
// NoteCategory_Link_to_images = 21;
|
1449
|
// NoteCategory_Link_to_taxonomy = 22;
|
1450
|
// NoteCategory_Link_to_general_information = 23;
|
1451
|
// NoteCategory_undefined_link = 24;
|
1452
|
// NoteCategory_Editor_Braces = 249;
|
1453
|
|
1454
|
// NoteCategory_Publication_date = 254;
|
1455
|
// NoteCategory_Distribution = 278;
|
1456
|
// NoteCategory_Biology = 281;
|
1457
|
// NoteCategory_Diagnosis = 282;
|
1458
|
// NoteCategory_Host = 283;
|
1459
|
|
1460
|
}else{
|
1461
|
logger.warn("Unhandled Feature: " + feature.getTitleCache());
|
1462
|
return null;
|
1463
|
}
|
1464
|
}
|
1465
|
|
1466
|
/**
|
1467
|
* Returns the string representation for a given rank.
|
1468
|
* @param rank
|
1469
|
* @param pesiKingdomId
|
1470
|
* @return
|
1471
|
*/
|
1472
|
public String getCacheByRankAndKingdom(Rank rank, Integer pesiKingdomId) {
|
1473
|
if (rank == null){
|
1474
|
return null;
|
1475
|
}else{
|
1476
|
return this.rankCacheMap.get(pesiKingdomId).get(rank2RankId(rank, pesiKingdomId));
|
1477
|
}
|
1478
|
}
|
1479
|
|
1480
|
/**
|
1481
|
* Returns the abbreviation for a given rank.
|
1482
|
* Currently unused.
|
1483
|
* @param rank
|
1484
|
* @param pesiKingdomId
|
1485
|
* @return
|
1486
|
*/
|
1487
|
public String getCacheAbbrevByRankAndKingdom(Rank rank, Integer pesiKingdomId) {
|
1488
|
if (rank == null){
|
1489
|
return null;
|
1490
|
}else{
|
1491
|
return this.rankAbbrevCacheMap.get(pesiKingdomId).get(rank2RankId(rank, pesiKingdomId));
|
1492
|
}
|
1493
|
}
|
1494
|
|
1495
|
/**
|
1496
|
* Returns the identifier of a PESI specific kingdom for a given CDM nomenclatural code.
|
1497
|
* @param nomenclaturalCode
|
1498
|
* @return KINGDOM_ANIMALIA for NomenclaturalCode.ICZN, KINGDOM_PLANTAE for NomenclaturalCode.ICBN
|
1499
|
*/
|
1500
|
public static Integer nomenClaturalCode2Kingdom(NomenclaturalCode nomenclaturalCode) {
|
1501
|
Integer result = null;
|
1502
|
// TODO: This needs to be refined. For now we differentiate between Animalia and Plantae only.
|
1503
|
if (nomenclaturalCode.equals(NomenclaturalCode.ICZN)) {
|
1504
|
result = KINGDOM_ANIMALIA;
|
1505
|
} else if (nomenclaturalCode.equals(NomenclaturalCode.ICNAFP)) {
|
1506
|
result = KINGDOM_PLANTAE;
|
1507
|
} else if (nomenclaturalCode.equals(NomenclaturalCode.ICNB)) {
|
1508
|
result = KINGDOM_BACTERIA;
|
1509
|
// } else if (nomenclaturalCode.equals(NomenclaturalCode.)) { // Biota
|
1510
|
// result =
|
1511
|
} else {
|
1512
|
logger.error("NomenclaturalCode not yet considered: " + nomenclaturalCode.getUuid() + " (" + nomenclaturalCode.getTitleCache() + ")");
|
1513
|
}
|
1514
|
return result;
|
1515
|
}
|
1516
|
|
1517
|
/**
|
1518
|
* Returns the RankId for a Rank.
|
1519
|
* @param rank
|
1520
|
* @return
|
1521
|
*/
|
1522
|
public static Integer rank2RankId (Rank rank, Integer pesiKingdomId) {
|
1523
|
Integer result = null;
|
1524
|
if (rank == null) {
|
1525
|
return null;
|
1526
|
}
|
1527
|
|
1528
|
// We differentiate between Animalia and Plantae only for now.
|
1529
|
if (pesiKingdomId != null && pesiKingdomId.intValue() == KINGDOM_ANIMALIA) {
|
1530
|
if (rank.equals(Rank.KINGDOM())) {
|
1531
|
result = Animalia_Kingdom;
|
1532
|
} else if (rank.equals(Rank.SUBKINGDOM())) {
|
1533
|
result = Animalia_Subkingdom;
|
1534
|
} else if (rank.equals(Rank.SUPERPHYLUM())) {
|
1535
|
result = Animalia_Superphylum;
|
1536
|
} else if (rank.equals(Rank.PHYLUM())) {
|
1537
|
result = Animalia_Phylum;
|
1538
|
} else if (rank.equals(Rank.SUBPHYLUM())) {
|
1539
|
result = Animalia_Subphylum;
|
1540
|
} else if (rank.equals(Rank.INFRAPHYLUM())) {
|
1541
|
result = Animalia_Infraphylum;
|
1542
|
} else if (rank.equals(Rank.SUPERCLASS())) {
|
1543
|
result = Animalia_Superclass;
|
1544
|
} else if (rank.equals(Rank.CLASS())) {
|
1545
|
result = Animalia_Class;
|
1546
|
} else if (rank.equals(Rank.SUBCLASS())) {
|
1547
|
result = Animalia_Subclass;
|
1548
|
} else if (rank.equals(Rank.INFRACLASS())) {
|
1549
|
result = Animalia_Infraclass;
|
1550
|
} else if (rank.equals(Rank.SUPERORDER())) {
|
1551
|
result = Animalia_Superorder;
|
1552
|
} else if (rank.equals(Rank.ORDER())) {
|
1553
|
result = Animalia_Order;
|
1554
|
} else if (rank.equals(Rank.SUBORDER())) {
|
1555
|
result = Animalia_Suborder;
|
1556
|
} else if (rank.equals(Rank.INFRAORDER())) {
|
1557
|
result = Animalia_Infraorder;
|
1558
|
} else if (rank.equals(Rank.SECTION_ZOOLOGY())) {
|
1559
|
result = Animalia_Section;
|
1560
|
} else if (rank.equals(Rank.SUBSECTION_ZOOLOGY())) {
|
1561
|
result = Animalia_Subsection;
|
1562
|
} else if (rank.equals(Rank.SUPERFAMILY())) {
|
1563
|
result = Animalia_Superfamily;
|
1564
|
} else if (rank.equals(Rank.FAMILY())) {
|
1565
|
result = Animalia_Family;
|
1566
|
} else if (rank.equals(Rank.SUBFAMILY())) {
|
1567
|
result = Animalia_Subfamily;
|
1568
|
} else if (rank.equals(Rank.TRIBE())) {
|
1569
|
result = Animalia_Tribe;
|
1570
|
} else if (rank.equals(Rank.SUBTRIBE())) {
|
1571
|
result = Animalia_Subtribe;
|
1572
|
} else if (rank.equals(Rank.GENUS())) {
|
1573
|
result = Animalia_Genus;
|
1574
|
} else if (rank.equals(Rank.SUBGENUS())) {
|
1575
|
result = Animalia_Subgenus;
|
1576
|
} else if (rank.equals(Rank.SPECIES())) {
|
1577
|
result = Animalia_Species;
|
1578
|
} else if (rank.equals(Rank.SUBSPECIES())) {
|
1579
|
result = Animalia_Subspecies;
|
1580
|
// } else if (rank.equals(Rank.)) { // not yet specified
|
1581
|
// result = Animalia_Natio;
|
1582
|
} else if (rank.equals(Rank.VARIETY())) {
|
1583
|
result = Animalia_Variety;
|
1584
|
} else if (rank.equals(Rank.SUBVARIETY())) {
|
1585
|
result = Animalia_Subvariety;
|
1586
|
} else if (rank.equals(Rank.FORM())) {
|
1587
|
result = Animalia_Forma;
|
1588
|
} else {
|
1589
|
//TODO Exception
|
1590
|
logger.warn("Rank for Kingdom Animalia not yet supported in CDM: "+ rank.getLabel());
|
1591
|
return null;
|
1592
|
}
|
1593
|
} else if (pesiKingdomId != null && pesiKingdomId.intValue() == KINGDOM_PLANTAE) {
|
1594
|
if (rank.equals(Rank.KINGDOM())) {
|
1595
|
result = Plantae_Kingdom;
|
1596
|
} else if (rank.equals(Rank.SUBKINGDOM())) {
|
1597
|
result = Plantae_Subkingdom;
|
1598
|
} else if (rank.equals(Rank.DIVISION())) {
|
1599
|
result = Plantae_Division;
|
1600
|
} else if (rank.equals(Rank.SUBDIVISION())) {
|
1601
|
result = Plantae_Subdivision;
|
1602
|
} else if (rank.equals(Rank.CLASS())) {
|
1603
|
result = Plantae_Class;
|
1604
|
} else if (rank.equals(Rank.SUBCLASS())) {
|
1605
|
result = Plantae_Subclass;
|
1606
|
} else if (rank.equals(Rank.ORDER())) {
|
1607
|
result = Plantae_Order;
|
1608
|
} else if (rank.equals(Rank.SUBORDER())) {
|
1609
|
result = Plantae_Suborder;
|
1610
|
} else if (rank.equals(Rank.FAMILY())) {
|
1611
|
result = Plantae_Family;
|
1612
|
} else if (rank.equals(Rank.SUBFAMILY())) {
|
1613
|
result = Plantae_Subfamily;
|
1614
|
} else if (rank.equals(Rank.TRIBE())) {
|
1615
|
result = Plantae_Tribe;
|
1616
|
} else if (rank.equals(Rank.SUBTRIBE())) {
|
1617
|
result = Plantae_Subtribe;
|
1618
|
} else if (rank.equals(Rank.GENUS())) {
|
1619
|
result = Plantae_Genus;
|
1620
|
} else if (rank.equals(Rank.SUBGENUS())) {
|
1621
|
result = Plantae_Subgenus;
|
1622
|
} else if (rank.equals(Rank.SECTION_BOTANY())) {
|
1623
|
result = Plantae_Section;
|
1624
|
} else if (rank.equals(Rank.SUBSECTION_BOTANY())) {
|
1625
|
result = Plantae_Subsection;
|
1626
|
} else if (rank.equals(Rank.SERIES())) {
|
1627
|
result = Plantae_Series;
|
1628
|
} else if (rank.equals(Rank.SUBSERIES())) {
|
1629
|
result = Plantae_Subseries;
|
1630
|
} else if (rank.equals(Rank.SPECIESAGGREGATE() )) {
|
1631
|
result = Plantae_Aggregate;
|
1632
|
} else if (rank.equals(Rank.SPECIESGROUP())) {
|
1633
|
logger.warn("Rank Species Group not yet implemented");
|
1634
|
result = null;
|
1635
|
} else if (rank.getUuid().equals(BerlinModelTransformer.uuidRankCollSpecies)) {
|
1636
|
result = Plantae_Coll_Species;
|
1637
|
} else if (rank.equals(Rank.SPECIES())) {
|
1638
|
result = Plantae_Species;
|
1639
|
} else if (rank.equals(Rank.SUBSPECIES())) {
|
1640
|
result = Plantae_Subspecies;
|
1641
|
} else if (rank.equals(Rank.GREX())) {
|
1642
|
result = Plantae_Grex;
|
1643
|
} else if (rank.getUuid().equals(BerlinModelTransformer.uuidRankProles) ) {
|
1644
|
result = Plantae_Proles;
|
1645
|
} else if (rank.getUuid().equals(BerlinModelTransformer.uuidRankRace)) {
|
1646
|
result = Plantae_Race;
|
1647
|
} else if (rank.equals(Rank.CONVAR())) {
|
1648
|
result = Plantae_Convarietas;
|
1649
|
} else if (rank.equals(Rank.VARIETY())) {
|
1650
|
result = Plantae_Variety;
|
1651
|
} else if (rank.equals(Rank.SUBVARIETY())) {
|
1652
|
result = Plantae_Subvariety;
|
1653
|
} else if (rank.equals(Rank.FORM())) {
|
1654
|
result = Plantae_Forma;
|
1655
|
} else if (rank.equals(Rank.SUBFORM())) {
|
1656
|
result = Plantae_Subforma;
|
1657
|
// } else if (rank.equals(Rank.)) { // not yet specified
|
1658
|
// result = Plantae_Forma_spec;
|
1659
|
} else if (rank.equals(Rank.INFRAGENERICTAXON())) {
|
1660
|
result = Plantae_Taxa_infragen;
|
1661
|
} else if (rank.equals(Rank.INFRASPECIFICTAXON())) {
|
1662
|
result = Plantae_Taxa_infraspec;
|
1663
|
} else {
|
1664
|
//TODO Exception
|
1665
|
logger.warn("Rank for Kingdom Plantae not yet supported in CDM: "+ rank.getLabel());
|
1666
|
return null;
|
1667
|
}
|
1668
|
} else if (pesiKingdomId != null && pesiKingdomId.intValue() == KINGDOM_BACTERIA) {
|
1669
|
if (rank.equals(Rank.KINGDOM())) { result = Bacteria_Kingdom; }
|
1670
|
else if (rank.equals(Rank.SUBKINGDOM())) { result = Bacteria_Subkingdom; }
|
1671
|
else if (rank.equals(Rank.PHYLUM())) { result = Bacteria_Phylum; }
|
1672
|
else if (rank.equals(Rank.SUBPHYLUM())) { result = Bacteria_Subphylum; }
|
1673
|
else if (rank.equals(Rank.SUPERCLASS())) { result = Bacteria_Superclass; }
|
1674
|
else if (rank.equals(Rank.CLASS())) { result = Bacteria_Class; }
|
1675
|
else if (rank.equals(Rank.SUBCLASS())) { result = Bacteria_Subclass; }
|
1676
|
else if (rank.equals(Rank.INFRACLASS())) { result = Bacteria_Infraclass; }
|
1677
|
else if (rank.equals(Rank.SUPERORDER())) { result = Bacteria_Superorder; }
|
1678
|
else if (rank.equals(Rank.ORDER())) { result = Bacteria_Order; }
|
1679
|
else if (rank.equals(Rank.SUBORDER())) { result = Bacteria_Suborder; }
|
1680
|
else if (rank.equals(Rank.INFRAORDER())) { result = Bacteria_Infraorder; }
|
1681
|
else if (rank.equals(Rank.SUPERFAMILY())) { result = Bacteria_Superfamily; }
|
1682
|
else if (rank.equals(Rank.FAMILY())) { result = Bacteria_Family; }
|
1683
|
else if (rank.equals(Rank.SUBFAMILY())) { result = Bacteria_Subfamily; }
|
1684
|
else if (rank.equals(Rank.TRIBE())) { result = Bacteria_Tribe; }
|
1685
|
else if (rank.equals(Rank.SUBTRIBE())) { result = Bacteria_Subtribe; }
|
1686
|
else if (rank.equals(Rank.GENUS())) { result = Bacteria_Genus; }
|
1687
|
else if (rank.equals(Rank.SUBGENUS())) { result = Bacteria_Subgenus; }
|
1688
|
else if (rank.equals(Rank.SPECIES())) { result = Bacteria_Species; }
|
1689
|
else if (rank.equals(Rank.SUBSPECIES())) { result = Bacteria_Subspecies; }
|
1690
|
else if (rank.equals(Rank.VARIETY())) { result = Bacteria_Variety; }
|
1691
|
else if (rank.equals(Rank.FORM())) { result = Bacteria_Forma; }
|
1692
|
} else {
|
1693
|
//TODO Exception
|
1694
|
logger.warn("Kingdom not yet supported in CDM: "+ pesiKingdomId);
|
1695
|
return null;
|
1696
|
}
|
1697
|
return result;
|
1698
|
}
|
1699
|
|
1700
|
/**
|
1701
|
*
|
1702
|
* @param nameTypeDesignationStatus
|
1703
|
* @return
|
1704
|
*/
|
1705
|
public static Integer nameTypeDesignationStatus2TypeDesignationStatusId(NameTypeDesignationStatus nameTypeDesignationStatus) {
|
1706
|
if (nameTypeDesignationStatus == null) {
|
1707
|
return null;
|
1708
|
}
|
1709
|
if (nameTypeDesignationStatus.equals(NameTypeDesignationStatus.ORIGINAL_DESIGNATION())) {
|
1710
|
return TYPE_BY_ORIGINAL_DESIGNATION;
|
1711
|
} else if (nameTypeDesignationStatus.equals(NameTypeDesignationStatus.SUBSEQUENT_DESIGNATION())) {
|
1712
|
return TYPE_BY_SUBSEQUENT_DESIGNATION;
|
1713
|
} else if (nameTypeDesignationStatus.equals(NameTypeDesignationStatus.MONOTYPY())) {
|
1714
|
return TYPE_BY_MONOTYPY;
|
1715
|
} else {
|
1716
|
//TODO Figure out a way to handle this gracefully.
|
1717
|
logger.warn("Name Type Designation Status not yet supported in PESI: "+ nameTypeDesignationStatus.getLabel());
|
1718
|
return null;
|
1719
|
}
|
1720
|
|
1721
|
}
|
1722
|
|
1723
|
/**
|
1724
|
*
|
1725
|
* @param nameTypeDesignationStatus
|
1726
|
* @return
|
1727
|
*/
|
1728
|
public static String nameTypeDesignationStatus2TypeDesignationStatusCache(NameTypeDesignationStatus nameTypeDesignationStatus) {
|
1729
|
if (nameTypeDesignationStatus == null) {
|
1730
|
return null;
|
1731
|
}
|
1732
|
if (nameTypeDesignationStatus.equals(NameTypeDesignationStatus.ORIGINAL_DESIGNATION())) {
|
1733
|
return TYPE_STR_BY_ORIGINAL_DESIGNATION;
|
1734
|
} else if (nameTypeDesignationStatus.equals(NameTypeDesignationStatus.SUBSEQUENT_DESIGNATION())) {
|
1735
|
return TYPE_STR_BY_SUBSEQUENT_DESIGNATION;
|
1736
|
} else if (nameTypeDesignationStatus.equals(NameTypeDesignationStatus.MONOTYPY())) {
|
1737
|
return TYPE_STR_BY_MONOTYPY;
|
1738
|
} else {
|
1739
|
//TODO Figure out a way to handle this gracefully.
|
1740
|
logger.warn("Name Type Designation Status not yet supported in PESI: "+ nameTypeDesignationStatus.getLabel());
|
1741
|
return null;
|
1742
|
}
|
1743
|
|
1744
|
}
|
1745
|
|
1746
|
/**
|
1747
|
* @see PesiTaxonExport#doPhaseUpdates(PesiExportState) for further transformation
|
1748
|
* @param taxonBase
|
1749
|
* @return
|
1750
|
*/
|
1751
|
public static Integer taxonBase2statusFk (TaxonBase<?> taxonBase){
|
1752
|
if (taxonBase == null){
|
1753
|
return null;
|
1754
|
}
|
1755
|
if (taxonBase.isInstanceOf(Taxon.class)){
|
1756
|
Taxon taxon = CdmBase.deproxy(taxonBase, Taxon.class);
|
1757
|
if (taxon.getTaxonNodes().size() == 0){
|
1758
|
return T_STATUS_NOT_ACCEPTED;
|
1759
|
}else{
|
1760
|
return T_STATUS_ACCEPTED;
|
1761
|
}
|
1762
|
}else if (taxonBase.isInstanceOf(Synonym.class)){
|
1763
|
return T_STATUS_SYNONYM;
|
1764
|
}else{
|
1765
|
logger.warn("Unknown ");
|
1766
|
return T_STATUS_UNRESOLVED;
|
1767
|
}
|
1768
|
//TODO
|
1769
|
// public static int T_STATUS_PARTIAL_SYN = 3;
|
1770
|
// public static int T_STATUS_PRO_PARTE_SYN = 4;
|
1771
|
// public static int T_STATUS_UNRESOLVED = 5;
|
1772
|
// public static int T_STATUS_ORPHANED = 6;
|
1773
|
}
|
1774
|
|
1775
|
// /**
|
1776
|
// *
|
1777
|
// * @param taxonBase
|
1778
|
// * @return
|
1779
|
// */
|
1780
|
// public static String taxonBase2statusCache (TaxonBase<?> taxonBase){
|
1781
|
// if (taxonBase == null){return null;}
|
1782
|
// if (taxonBase.isInstanceOf(Taxon.class)){
|
1783
|
// Taxon taxon = CdmBase.deproxy(taxonBase, Taxon.class);
|
1784
|
// if (taxon.getTaxonNodes().size() == 0){
|
1785
|
// return T_STATUS_STR_NOT_ACCEPTED;
|
1786
|
// }else{
|
1787
|
// return T_STATUS_STR_ACCEPTED;
|
1788
|
// }
|
1789
|
// }else if (taxonBase.isInstanceOf(Synonym.class)){
|
1790
|
// return T_STATUS_STR_SYNONYM;
|
1791
|
// }else{
|
1792
|
// logger.warn("Unknown ");
|
1793
|
// return T_STATUS_STR_UNRESOLVED;
|
1794
|
// }
|
1795
|
// //TODO
|
1796
|
// public static int T_STATUS_STR_PARTIAL_SYN = 3;
|
1797
|
// public static int T_STATUS_STR_PRO_PARTE_SYN = 4;
|
1798
|
// public static int T_STATUS_STR_UNRESOLVED = 5;
|
1799
|
// public static int T_STATUS_STR_ORPHANED = 6;
|
1800
|
// }
|
1801
|
|
1802
|
/**
|
1803
|
* Returns the {@link SourceCategory SourceCategory} representation of the given {@link ReferenceType ReferenceType} in PESI.
|
1804
|
* @param reference The {@link Reference Reference}.
|
1805
|
* @return The {@link SourceCategory SourceCategory} representation in PESI.
|
1806
|
*/
|
1807
|
public static Integer reference2SourceCategoryFK(Reference<?> reference) {
|
1808
|
if (reference == null){
|
1809
|
return null;
|
1810
|
} else if (reference.getType().equals(ReferenceType.Article)) {
|
1811
|
return REF_ARTICLE_IN_PERIODICAL;
|
1812
|
} else if (reference.getType().equals(ReferenceType.Book)) {
|
1813
|
return REF_BOOK;
|
1814
|
} else if (reference.getType().equals(ReferenceType.BookSection)) {
|
1815
|
return REF_PART_OF_OTHER;
|
1816
|
} else if (reference.getType().equals(ReferenceType.Database)) {
|
1817
|
return REF_DATABASE;
|
1818
|
} else if (reference.getType().equals(ReferenceType.WebPage)) {
|
1819
|
return REF_WEBSITE;
|
1820
|
} else if (reference.getType().equals(ReferenceType.CdDvd)) {
|
1821
|
return REF_NOT_APPLICABLE;
|
1822
|
} else if (reference.getType().equals(ReferenceType.Journal)) {
|
1823
|
return REF_JOURNAL;
|
1824
|
} else if (reference.getType().equals(ReferenceType.Generic)) {
|
1825
|
return REF_UNRESOLVED;
|
1826
|
} else if (reference.getType().equals(ReferenceType.PrintSeries)) {
|
1827
|
return REF_PUBLISHED;
|
1828
|
} else if (reference.getType().equals(ReferenceType.Proceedings)) {
|
1829
|
return REF_PUBLISHED;
|
1830
|
} else if (reference.getType().equals(ReferenceType.Patent)) {
|
1831
|
return REF_NOT_APPLICABLE;
|
1832
|
} else if (reference.getType().equals(ReferenceType.PersonalCommunication)) {
|
1833
|
return REF_INFORMAL;
|
1834
|
} else if (reference.getType().equals(ReferenceType.Report)) {
|
1835
|
return REF_NOT_APPLICABLE;
|
1836
|
} else if (reference.getType().equals(ReferenceType.Thesis)) {
|
1837
|
return REF_NOT_APPLICABLE;
|
1838
|
} else {
|
1839
|
logger.warn("Reference type not yet supported in PESI: "+ reference.getType());
|
1840
|
return null;
|
1841
|
}
|
1842
|
}
|
1843
|
|
1844
|
/**
|
1845
|
* Returns the {@link SourceCategoryCache SourceCategoryCache}.
|
1846
|
* @param reference The {@link Reference Reference}.
|
1847
|
* @return The {@link SourceCategoryCache SourceCategoryCache}.
|
1848
|
*/
|
1849
|
public String getCacheByReference(Reference<?> reference) {
|
1850
|
if (reference == null){
|
1851
|
return null;
|
1852
|
}else{
|
1853
|
return this.sourceCategoryCacheMap.get(reference2SourceCategoryFK(reference));
|
1854
|
}
|
1855
|
}
|
1856
|
|
1857
|
/**
|
1858
|
*
|
1859
|
* @param status
|
1860
|
* @return
|
1861
|
*/
|
1862
|
public String getCacheByNomStatus(NomenclaturalStatusType status) {
|
1863
|
if (status == null){
|
1864
|
return null;
|
1865
|
}else{
|
1866
|
return this.nameStatusCacheMap.get(nomStatus2nomStatusFk(status));
|
1867
|
}
|
1868
|
}
|
1869
|
|
1870
|
/**
|
1871
|
*
|
1872
|
* @param status
|
1873
|
* @return
|
1874
|
*/
|
1875
|
public static Integer nomStatus2nomStatusFk (NomenclaturalStatusType status){
|
1876
|
if (status == null){
|
1877
|
return null;
|
1878
|
}
|
1879
|
if (status.equals(NomenclaturalStatusType.INVALID())) {return NAME_ST_NOM_INVAL;
|
1880
|
}else if (status.equals(NomenclaturalStatusType.ILLEGITIMATE())) {return NAME_ST_NOM_ILLEG;
|
1881
|
}else if (status.equals(NomenclaturalStatusType.NUDUM())) {return NAME_ST_NOM_NUD;
|
1882
|
}else if (status.equals(NomenclaturalStatusType.REJECTED())) {return NAME_ST_NOM_REJ;
|
1883
|
}else if (status.equals(NomenclaturalStatusType.REJECTED_PROP())) {return NAME_ST_NOM_REJ_PROP;
|
1884
|
}else if (status.equals(NomenclaturalStatusType.UTIQUE_REJECTED())) {return NAME_ST_NOM_UTIQUE_REJ;
|
1885
|
}else if (status.equals(NomenclaturalStatusType.UTIQUE_REJECTED_PROP())) {return NAME_ST_NOM_UTIQUE_REJ_PROP;
|
1886
|
}else if (status.equals(NomenclaturalStatusType.CONSERVED())) {return NAME_ST_NOM_CONS;
|
1887
|
|
1888
|
}else if (status.equals(NomenclaturalStatusType.CONSERVED_PROP())) {return NAME_ST_NOM_CONS_PROP;
|
1889
|
}else if (status.equals(NomenclaturalStatusType.ORTHOGRAPHY_CONSERVED())) {return NAME_ST_ORTH_CONS;
|
1890
|
}else if (status.equals(NomenclaturalStatusType.ORTHOGRAPHY_CONSERVED_PROP())) {return NAME_ST_ORTH_CONS_PROP;
|
1891
|
}else if (status.equals(NomenclaturalStatusType.SUPERFLUOUS())) {return NAME_ST_NOM_SUPERFL;
|
1892
|
}else if (status.equals(NomenclaturalStatusType.AMBIGUOUS())) {return NAME_ST_NOM_AMBIG;
|
1893
|
}else if (status.equals(NomenclaturalStatusType.PROVISIONAL())) {return NAME_ST_NOM_PROVIS;
|
1894
|
}else if (status.equals(NomenclaturalStatusType.DOUBTFUL())) {return NAME_ST_NOM_DUB;
|
1895
|
}else if (status.equals(NomenclaturalStatusType.NOVUM())) {return NAME_ST_NOM_NOV;
|
1896
|
|
1897
|
}else if (status.equals(NomenclaturalStatusType.CONFUSUM())) {return NAME_ST_NOM_CONFUS;
|
1898
|
}else if (status.equals(NomenclaturalStatusType.ALTERNATIVE())) {return NAME_ST_NOM_ALTERN;
|
1899
|
}else if (status.equals(NomenclaturalStatusType.COMBINATION_INVALID())) {return NAME_ST_COMB_INVAL;
|
1900
|
}else if (status.equals(NomenclaturalStatusType.LEGITIMATE())) {return NAME_ST_LEGITIMATE;
|
1901
|
|
1902
|
}else if (status.getUuid().equals(BerlinModelTransformer.uuidNomStatusCombIned)) {return NAME_ST_COMB_INED;
|
1903
|
}else if (status.getUuid().equals(BerlinModelTransformer.uuidNomStatusNomOrthCons)) {return NAME_ST_NOM_AND_ORTH_CONS;
|
1904
|
}else if (status.getUuid().equals(BerlinModelTransformer.uuidNomStatusSpNovIned)) {return NAME_ST_SP_NOV_INED;
|
1905
|
|
1906
|
|
1907
|
// The following are non-existent in CDM
|
1908
|
// }else if (status.equals(NomenclaturalStatusType.)) {return NAME_ST_COMB_AND_STAT_INED;
|
1909
|
// }else if (status.equals(NomenclaturalStatusType.)) {return NAME_ST_NOM_NOV_INED;
|
1910
|
// }else if (status.equals(NomenclaturalStatusType.)) {return NAME_ST_ALTERNATE_REPRESENTATION;
|
1911
|
}else if (status.getUuid().equals(FaunaEuropaeaTransformer.uuidNomStatusTempNamed)) {return NAME_ST_TEMPORARY_NAME;
|
1912
|
// }else if (status.equals(NomenclaturalStatusType.)) {return NAME_ST_SPECIES_INQUIRENDA;
|
1913
|
|
1914
|
//TODO
|
1915
|
}else {
|
1916
|
//TODO Exception
|
1917
|
logger.warn("NomStatus type not yet supported by PESI export: "+ status);
|
1918
|
return null;
|
1919
|
}
|
1920
|
}
|
1921
|
|
1922
|
/**
|
1923
|
* Returns the RelTaxonQualifierCache for a given taxonRelation.
|
1924
|
* @param relation
|
1925
|
* @return
|
1926
|
*/
|
1927
|
public String getCacheByRelationshipType(RelationshipBase relation, NomenclaturalCode code){
|
1928
|
if (relation == null){
|
1929
|
return null;
|
1930
|
}else{
|
1931
|
String result;
|
1932
|
Integer key = taxonRelation2RelTaxonQualifierFk(relation);
|
1933
|
if (code.equals(NomenclaturalCode.ICZN)){
|
1934
|
result = this.taxRelZooQualifierCacheMap.get(key);
|
1935
|
if (result == null){
|
1936
|
this.taxRelQualifierCacheMap.get(key);
|
1937
|
}
|
1938
|
}else{
|
1939
|
result = this.taxRelQualifierCacheMap.get(key);
|
1940
|
}
|
1941
|
return result;
|
1942
|
}
|
1943
|
}
|
1944
|
|
1945
|
/**
|
1946
|
* Returns the RelTaxonQualifierFk for a TaxonRelation.
|
1947
|
* @param relation
|
1948
|
* @return
|
1949
|
*/
|
1950
|
public static Integer taxonRelation2RelTaxonQualifierFk(RelationshipBase<?,?,?> relation) {
|
1951
|
if (relation == null) {
|
1952
|
return null;
|
1953
|
}
|
1954
|
RelationshipTermBase<?> type = relation.getType();
|
1955
|
if (type.equals(TaxonRelationshipType.MISAPPLIED_NAME_FOR())) {
|
1956
|
return IS_MISAPPLIED_NAME_FOR;
|
1957
|
} else if (type.equals(SynonymRelationshipType.SYNONYM_OF())) {
|
1958
|
SynonymRelationship synRel = CdmBase.deproxy(relation, SynonymRelationship.class);
|
1959
|
if (synRel.isProParte()){
|
1960
|
return IS_PRO_PARTE_SYNONYM_OF;
|
1961
|
}else if (synRel.isPartial()){
|
1962
|
return IS_PARTIAL_SYNONYM_OF;
|
1963
|
}else{
|
1964
|
return IS_SYNONYM_OF;
|
1965
|
}
|
1966
|
} else if (type.equals(SynonymRelationshipType.HOMOTYPIC_SYNONYM_OF())) {
|
1967
|
SynonymRelationship synRel = CdmBase.deproxy(relation, SynonymRelationship.class);
|
1968
|
if (synRel.isProParte()){
|
1969
|
return IS_PRO_PARTE_AND_HOMOTYPIC_SYNONYM_OF;
|
1970
|
}else if (synRel.isPartial()){
|
1971
|
return IS_PARTIAL_AND_HOMOTYPIC_SYNONYM_OF;
|
1972
|
}else{
|
1973
|
return IS_HOMOTYPIC_SYNONYM_OF;
|
1974
|
}
|
1975
|
} else if (type.equals(SynonymRelationshipType.HETEROTYPIC_SYNONYM_OF())) {
|
1976
|
SynonymRelationship synRel = CdmBase.deproxy(relation, SynonymRelationship.class);
|
1977
|
if (synRel.isProParte()){
|
1978
|
return IS_PRO_PARTE_AND_HETEROTYPIC_SYNONYM_OF;
|
1979
|
}else if (synRel.isPartial()){
|
1980
|
return IS_PARTIAL_AND_HETEROTYPIC_SYNONYM_OF;
|
1981
|
}else{
|
1982
|
return IS_HETEROTYPIC_SYNONYM_OF;
|
1983
|
}
|
1984
|
} else if (type.equals(SynonymRelationshipType.INFERRED_EPITHET_OF())) {
|
1985
|
return IS_INFERRED_EPITHET_FOR;
|
1986
|
} else if (type.equals(SynonymRelationshipType.INFERRED_GENUS_OF())) {
|
1987
|
return IS_INFERRED_GENUS_FOR;
|
1988
|
} else if (type.equals(SynonymRelationshipType.POTENTIAL_COMBINATION_OF())) {
|
1989
|
return IS_POTENTIAL_COMBINATION_FOR;
|
1990
|
} else if (type.equals(NameRelationshipType.BASIONYM())) {
|
1991
|
return IS_BASIONYM_FOR;
|
1992
|
} else if (type.equals(NameRelationshipType.LATER_HOMONYM())) {
|
1993
|
return IS_LATER_HOMONYM_OF;
|
1994
|
} else if (type.equals(NameRelationshipType.REPLACED_SYNONYM())) {
|
1995
|
return IS_REPLACED_SYNONYM_FOR;
|
1996
|
} else if (type.equals(NameRelationshipType.VALIDATED_BY_NAME())) {
|
1997
|
return IS_VALIDATION_OF;
|
1998
|
} else if (type.equals(NameRelationshipType.LATER_VALIDATED_BY_NAME())) {
|
1999
|
return IS_LATER_VALIDATION_OF;
|
2000
|
} else if (type.equals(NameRelationshipType.CONSERVED_AGAINST())) {
|
2001
|
return IS_CONSERVED_AGAINST;
|
2002
|
} else if (type.equals(NameRelationshipType.TREATED_AS_LATER_HOMONYM())) {
|
2003
|
return IS_TREATED_AS_LATER_HOMONYM_OF;
|
2004
|
} else if (type.equals(NameRelationshipType.ORTHOGRAPHIC_VARIANT())) {
|
2005
|
return IS_ORTHOGRAPHIC_VARIANT_OF;
|
2006
|
} else if (type.equals(NameRelationshipType.ALTERNATIVE_NAME())) {
|
2007
|
return IS_ALTERNATIVE_NAME_FOR;
|
2008
|
} else if (type.equals(HybridRelationshipType.FEMALE_PARENT())) {
|
2009
|
return IS_FEMALE_PARENT_OF;
|
2010
|
} else if (type.equals(HybridRelationshipType.MALE_PARENT())) {
|
2011
|
return IS_MALE_PARENT_OF;
|
2012
|
} else if (type.equals(HybridRelationshipType.FIRST_PARENT())) {
|
2013
|
return IS_FIRST_PARENT_OF;
|
2014
|
} else if (type.equals(HybridRelationshipType.SECOND_PARENT())) {
|
2015
|
return IS_SECOND_PARENT_OF;
|
2016
|
} else if (type.getUuid().equals(ErmsTransformer.uuidTaxRelTypeIsTaxonSynonymOf)) {
|
2017
|
return IS_SYNONYM_OF;
|
2018
|
} else {
|
2019
|
logger.warn("No equivalent RelationshipType found in datawarehouse for: " + type.getTitleCache());
|
2020
|
}
|
2021
|
|
2022
|
// The following have no equivalent attribute in CDM
|
2023
|
// IS_TYPE_OF
|
2024
|
// IS_CONSERVED_TYPE_OF
|
2025
|
// IS_REJECTED_TYPE_OF
|
2026
|
// IS_REJECTED_IN_FAVOUR_OF
|
2027
|
// HAS_SAME_TYPE_AS
|
2028
|
// IS_LECTOTYPE_OF
|
2029
|
// TYPE_NOT_DESIGNATED
|
2030
|
|
2031
|
|
2032
|
return null;
|
2033
|
}
|
2034
|
|
2035
|
/**
|
2036
|
* Returns the StatusFk for a given StatusCache.
|
2037
|
* @param StatusCache
|
2038
|
* @return
|
2039
|
*/
|
2040
|
public Integer StatusCache2StatusFk(String StatusCache) {
|
2041
|
Integer result = null;
|
2042
|
if (StatusCache.equalsIgnoreCase("Checked by Taxonomic Editor: included in ERMS 1.1")) {
|
2043
|
return 0;
|
2044
|
} else if (StatusCache.equalsIgnoreCase("Added by Database Management Team")) {
|
2045
|
return 2;
|
2046
|
} else if (StatusCache.equalsIgnoreCase("Checked by Taxonomic Editor")) {
|
2047
|
return 3;
|
2048
|
} else if (StatusCache.equalsIgnoreCase("Edited by Database Management Team")) {
|
2049
|
return 4;
|
2050
|
} else {
|
2051
|
logger.error("StatusFk could not be determined. StatusCache unknown: " + StatusCache);
|
2052
|
}
|
2053
|
|
2054
|
return result;
|
2055
|
}
|
2056
|
|
2057
|
/**
|
2058
|
* Returns the FossilStatusFk for a given FossilStatusCache.
|
2059
|
* @param fossilStatusCache
|
2060
|
* @return
|
2061
|
*/
|
2062
|
public Integer FossilStatusCache2FossilStatusFk(String fossilStatusCache) {
|
2063
|
Integer result = null;
|
2064
|
if (fossilStatusCache.equalsIgnoreCase("recent only")) {
|
2065
|
return 1;
|
2066
|
} else if (fossilStatusCache.equalsIgnoreCase("fossil only")) {
|
2067
|
return 2;
|
2068
|
} else if (fossilStatusCache.equalsIgnoreCase("recent + fossil")) {
|
2069
|
return 3;
|
2070
|
} else {
|
2071
|
logger.error("FossilStatusFk could not be determined. FossilStatusCache unknown: " + fossilStatusCache);
|
2072
|
}
|
2073
|
|
2074
|
return result;
|
2075
|
}
|
2076
|
|
2077
|
/**
|
2078
|
* Returns the NoteCategoryFk for a given UUID representing an ExtensionType.
|
2079
|
* @param uuid
|
2080
|
* @return
|
2081
|
*/
|
2082
|
public static Integer getNoteCategoryFk(UUID uuid) {
|
2083
|
Integer result = null;
|
2084
|
if (uuid.equals(taxCommentUuid)) {
|
2085
|
result = 270;
|
2086
|
} else if (uuid.equals(fauCommentUuid)) {
|
2087
|
result = 281;
|
2088
|
} else if (uuid.equals(fauExtraCodesUuid)) {
|
2089
|
result = 278;
|
2090
|
}
|
2091
|
return result;
|
2092
|
}
|
2093
|
|
2094
|
/**
|
2095
|
* Returns the NoteCategoryCache for a given UUID representing an ExtensionType.
|
2096
|
* @param uuid
|
2097
|
* @return
|
2098
|
*/
|
2099
|
public static String getNoteCategoryCache(UUID uuid) {
|
2100
|
String result = null;
|
2101
|
if (uuid.equals(taxCommentUuid)) {
|
2102
|
result = "Taxonomy";
|
2103
|
} else if (uuid.equals(fauCommentUuid)) {
|
2104
|
result = "Biology";
|
2105
|
} else if (uuid.equals(fauExtraCodesUuid)) {
|
2106
|
result = "Distribution";
|
2107
|
}
|
2108
|
return result;
|
2109
|
}
|
2110
|
|
2111
|
public static Integer getQualityStatusKeyBySource(BitSet sources, TaxonNameBase<?,?> taxonName) {
|
2112
|
if (sources.get(SOURCE_EM)){
|
2113
|
return QUALITY_STATUS_ADD_BY_DBMT;
|
2114
|
}else if (sources.get(SOURCE_ERMS)){
|
2115
|
Set<String> statusSet = getAllQualityStatus(taxonName);
|
2116
|
if (statusSet.size() > 1){
|
2117
|
logger.warn("ERMS TaxonName has more than 1 quality status: " + taxonName.getTitleCache() + "; lisd=" + taxonName.getLsid());
|
2118
|
}
|
2119
|
if (statusSet.contains("Checked by Taxonomic Editor: included in ERMS 1.1")){
|
2120
|
return QUALITY_STATUS_CHECKED_EDITOR_ERMS_1_1;
|
2121
|
}else if (statusSet.contains("Added by Database Management Team")){
|
2122
|
return QUALITY_STATUS_ADD_BY_DBMT;
|
2123
|
}else if (statusSet.contains("Checked by Taxonomic Editor")){
|
2124
|
return QUALITY_STATUS_CHECKED_EDITOR;
|
2125
|
}else if (statusSet.contains("Edited by Database Management Team")){
|
2126
|
return QUALITY_STATUS_EDITED_BY_DBMT;
|
2127
|
}else{
|
2128
|
logger.warn("Unknown ERMS quality status: " + statusSet.iterator().next() + " for taxon name " + taxonName.getTitleCache());
|
2129
|
return null;
|
2130
|
}
|
2131
|
}else{
|
2132
|
return null; // TODO needs to be implemented for others
|
2133
|
}
|
2134
|
}
|
2135
|
|
2136
|
|
2137
|
private static Set<String> getAllQualityStatus(TaxonNameBase<?, ?> taxonName) {
|
2138
|
Set<String> result = new HashSet<String>();
|
2139
|
for (TaxonBase<?> taxonBase : taxonName.getTaxonBases()){
|
2140
|
result.addAll(taxonBase.getExtensions(ErmsTransformer.uuidQualityStatus));
|
2141
|
}
|
2142
|
return result;
|
2143
|
}
|
2144
|
|
2145
|
@Override
|
2146
|
public String getQualityStatusCacheByKey(Integer qualityStatusId) throws UndefinedTransformerMethodException {
|
2147
|
if (qualityStatusId == null){
|
2148
|
return null;
|
2149
|
}else{
|
2150
|
return this.qualityStatusCacheMap.get(qualityStatusId);
|
2151
|
}
|
2152
|
}
|
2153
|
|
2154
|
|
2155
|
public Object getSourceUseCacheByKey(Integer sourceUseFk) {
|
2156
|
if (sourceUseFk == null){
|
2157
|
return null;
|
2158
|
}else{
|
2159
|
return this.sourceUseCacheMap.get(sourceUseFk);
|
2160
|
}
|
2161
|
}
|
2162
|
|
2163
|
@Override
|
2164
|
public String getTaxonStatusCacheByKey(Integer taxonStatusId) throws UndefinedTransformerMethodException {
|
2165
|
if (taxonStatusId == null){
|
2166
|
return null;
|
2167
|
}else{
|
2168
|
return this.taxonStatusCacheMap.get(taxonStatusId);
|
2169
|
}
|
2170
|
}
|
2171
|
|
2172
|
public static String getOriginalDbBySources(BitSet sources) {
|
2173
|
String result = "";
|
2174
|
if (sources.get(SOURCE_EM)){
|
2175
|
result = CdmUtils.concat(",", result, SOURCE_STR_EM);
|
2176
|
}
|
2177
|
if (sources.get(SOURCE_FE)){
|
2178
|
result = CdmUtils.concat(",", result, SOURCE_STR_FE);
|
2179
|
}
|
2180
|
if (sources.get(SOURCE_IF)){
|
2181
|
result = CdmUtils.concat(",", result, SOURCE_STR_IF);
|
2182
|
}
|
2183
|
if (sources.get(SOURCE_ERMS)){
|
2184
|
result = CdmUtils.concat(",", result, SOURCE_STR_ERMS);
|
2185
|
}
|
2186
|
|
2187
|
return result;
|
2188
|
}
|
2189
|
|
2190
|
|
2191
|
|
2192
|
}
|