2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
10 package eu
.etaxonomy
.cdm
.io
.berlinModel
;
12 import java
.sql
.ResultSet
;
13 import java
.sql
.SQLException
;
14 import java
.util
.UUID
;
16 import org
.apache
.log4j
.Logger
;
18 import eu
.etaxonomy
.cdm
.common
.ResultWrapper
;
19 import eu
.etaxonomy
.cdm
.io
.common
.mapping
.UndefinedTransformerMethodException
;
20 import eu
.etaxonomy
.cdm
.model
.common
.Language
;
21 import eu
.etaxonomy
.cdm
.model
.common
.OrderedTermVocabulary
;
22 import eu
.etaxonomy
.cdm
.model
.common
.RelationshipBase
;
23 import eu
.etaxonomy
.cdm
.model
.common
.RelationshipTermBase
;
24 import eu
.etaxonomy
.cdm
.model
.description
.AbsenceTerm
;
25 import eu
.etaxonomy
.cdm
.model
.description
.Feature
;
26 import eu
.etaxonomy
.cdm
.model
.description
.PresenceAbsenceTermBase
;
27 import eu
.etaxonomy
.cdm
.model
.description
.PresenceTerm
;
28 import eu
.etaxonomy
.cdm
.model
.name
.HybridRelationshipType
;
29 import eu
.etaxonomy
.cdm
.model
.name
.NameRelationshipType
;
30 import eu
.etaxonomy
.cdm
.model
.name
.NomenclaturalStatus
;
31 import eu
.etaxonomy
.cdm
.model
.name
.NomenclaturalStatusType
;
32 import eu
.etaxonomy
.cdm
.model
.name
.Rank
;
33 import eu
.etaxonomy
.cdm
.model
.name
.RankClass
;
34 import eu
.etaxonomy
.cdm
.model
.name
.SpecimenTypeDesignationStatus
;
35 import eu
.etaxonomy
.cdm
.model
.reference
.ISection
;
36 import eu
.etaxonomy
.cdm
.model
.reference
.Reference
;
37 import eu
.etaxonomy
.cdm
.model
.reference
.ReferenceType
;
38 import eu
.etaxonomy
.cdm
.model
.taxon
.Synonym
;
39 import eu
.etaxonomy
.cdm
.model
.taxon
.SynonymRelationshipType
;
40 import eu
.etaxonomy
.cdm
.model
.taxon
.Taxon
;
41 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonBase
;
42 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonRelationshipType
;
43 import eu
.etaxonomy
.cdm
.strategy
.exceptions
.UnknownCdmTypeException
;
49 public class BerlinModelTransformer
{
50 private static final Logger logger
= Logger
.getLogger(BerlinModelTransformer
.class);
53 public static final UUID uuidSourceRefEuroMed
= UUID
.fromString("0603a84a-f024-4454-ab92-9e2ac0139126");
56 public static UUID uuidRankCollSpecies
= UUID
.fromString("e14630ee-9446-4bb4-a7b7-4c3881bc5d94");
57 public static UUID uuidRankProles
= UUID
.fromString("8810d1ba-6a34-4ae3-a355-919ccd1cd1a5");
58 public static UUID uuidRankRace
= UUID
.fromString("196dee39-cfd8-4460-8bf0-88b83da27f62");
59 public static UUID uuidRankSublusus
= UUID
.fromString("1fafa596-a8e7-4e62-a378-3cc8cb3627ca");
62 public static UUID euroMedUuid
= UUID
.fromString("9fe09988-58c0-4c06-8474-f660a0c50014");
64 public static UUID uuidEasternEuropeanRussia
= UUID
.fromString("3f013375-0e0a-40c3-8a14-84c0535fab40");
65 public static UUID uuidSerbiaMontenegro
= UUID
.fromString("8926dbe6-863e-47a9-98a0-7dc9ed2c57f7");
66 public static UUID uuidSerbia
= UUID
.fromString("4ffed197-3d7e-4cd9-8984-e64b8dee9512");
67 public static UUID uuidLebanonSyria
= UUID
.fromString("0c45f250-99da-4b19-aa89-c3e56cfdf103");
68 public static UUID uuidUssr
= UUID
.fromString("a512e00a-45f3-4be5-82fa-bba8d675696f");
69 public static UUID uuidSicilyMalta
= UUID
.fromString("424d81ee-d272-4ae8-9600-0a334049cd72");
71 public static UUID uuidDesertas
= UUID
.fromString("36f5e93e-34e8-45b5-a401-f0e0faad21cf");
72 public static UUID uuidMadeira
= UUID
.fromString("086e27ee-78ff-4236-aca9-9850850cd355");
73 public static UUID uuidPortoSanto
= UUID
.fromString("1f9ab6a0-a402-4dfe-8c5b-b1844eb4d8e5");
75 public static UUID uuidFlores
= UUID
.fromString("ef0067c2-8bbb-4e37-8462-97b03f51ba43");
76 public static UUID uuidCorvo
= UUID
.fromString("b1e6117c-2be1-43a3-9233-227dd90bdee9");
77 public static UUID uuidFaial
= UUID
.fromString("14f6dcdb-6524-4700-b80c-66424952ef2b");
78 public static UUID uuidGraciosa
= UUID
.fromString("05f93a7b-d813-4833-864f-eedbba747133");
79 public static UUID uuidSaoJorge
= UUID
.fromString("578e0ecd-b5e3-4c87-8ecc-0fc4c7e217d9");
80 public static UUID uuidSaoMiguel
= UUID
.fromString("0e2f6ad8-7afb-4f01-b134-4f71991e877a");
81 public static UUID uuidPico
= UUID
.fromString("98cc566f-4110-43d5-830f-68436a009f49");
82 public static UUID uuidSantaMaria
= UUID
.fromString("bd5e5d4a-22b7-41aa-8e58-1d1d73a9954d");
83 public static UUID uuidTerceira
= UUID
.fromString("6fc257c0-a131-41f0-b6c3-51ef9c4fa962");
85 public static UUID uuidGranCanaria
= UUID
.fromString("a0240c35-0e05-4157-8321-67ba8e31fdb9");
86 public static UUID uuidFuerteventura
= UUID
.fromString("549ce2c1-6d49-4bf3-b75d-cf3f4b5a1398");
87 public static UUID uuidGomera
= UUID
.fromString("895fab09-7478-4210-b42a-423d23c6f85e");
88 public static UUID uuidHierro
= UUID
.fromString("d137b6a5-31bc-418c-9403-f042017dc04b");
89 public static UUID uuidLanzaroteWithGraciosa
= UUID
.fromString("c9b08dc1-f301-4d9d-b447-b8744602c776");
90 public static UUID uuidLaPalma
= UUID
.fromString("fdb3f2b2-f154-4f04-9f31-240a47a0e780");
91 public static UUID uuidTenerife
= UUID
.fromString("73658c7e-a568-465e-bd84-4554fc93ca56");
93 public static UUID uuidIbizaWithFormentera
= UUID
.fromString("1cda2a33-3469-49d5-8e77-cb5451110519");
94 public static UUID uuidMallorca
= UUID
.fromString("a10cba04-b4b5-4a4b-b69a-fcd4b3916fec");
95 public static UUID uuidMenorca
= UUID
.fromString("9f6ede48-27f8-4270-bf4e-c97eaa86aab7");
98 public static UUID uuidRussiaNorthern
= UUID
.fromString("c23bc1c9-a775-4426-b883-07d4d7d47eed");
99 public static UUID uuidRussiaBaltic
= UUID
.fromString("579dad44-9439-4b19-8716-ab90d8f27944");
100 public static UUID uuidRussiaCentral
= UUID
.fromString("8bbc8c6a-2ef2-4024-ad51-66fe34c70092");
101 public static UUID uuidRussiaSouthWest
= UUID
.fromString("daa5c207-5567-4690-8742-5e4d153b6a64");
102 public static UUID uuidRussiaSouthEast
= UUID
.fromString("e8516598-b529-489e-9ee8-63bbbd295c1b");
103 public static UUID uuidEastAegeanIslands
= UUID
.fromString("1c429593-c493-46e6-971a-0d70be690da8");
104 public static UUID uuidTurkishEastAegeanIslands
= UUID
.fromString("ba35dba3-ac70-41ae-81c2-2070943f44f2");
105 public static UUID uuidBalticStates
= UUID
.fromString("bf9d64f6-3183-4fa5-8e90-73090e7a2282");
106 public static final UUID uuidTurkey
= UUID
.fromString("d344ee2c-14c8-438d-b03d-11538edb1268");
107 public static final UUID uuidCaucasia
= UUID
.fromString("ebfd3fd1-3859-4e5e-95c7-f66010599d7e");
110 public static final UUID uuidUkraineAndCrimea
= UUID
.fromString("99d4d1c2-09f6-416e-86a3-bdde5cae52af");
111 public static final UUID uuidAzerbaijanNakhichevan
= UUID
.fromString("232fbef0-9f4a-4cab-8ac1-e14c717e9de6");
114 public static final UUID uuidMisappliedCommonName
= UUID
.fromString("25f5cfc3-16ab-4aba-a008-0db0f2cf7f9d");
115 public static final UUID uuidEurArea
= UUID
.fromString("71dd0368-835c-4b53-889a-2bf316e10297");
116 public static final UUID uuidEurMedArea
= UUID
.fromString("aa6a5b25-3ee3-4771-b4d1-b91918f23fa5");
120 public static final UUID uuidSpeciesExpertName
= UUID
.fromString("2e8153d2-7412-49e4-87e1-5c38f4c5153a");
121 public static final UUID uuidExpertName
= UUID
.fromString("24becb79-a90c-47d3-be35-efc87bb48fd3");
123 public static final UUID DETAIL_EXT_UUID
= UUID
.fromString("c3959b4f-d876-4b7a-a739-9260f4cafd1c");
124 public static final UUID ID_IN_SOURCE_EXT_UUID
= UUID
.fromString("23dac094-e793-40a4-bad9-649fc4fcfd44");
125 public static final UUID uuidIsoCode
= UUID
.fromString("048b8153-e3ee-451c-a72c-f1c8bc291c3e");
126 public static final UUID uuidTdwgAreaCode
= UUID
.fromString("73ad0288-b71b-4a14-9c2e-7f81f1e64a36");
127 public static final UUID uuidMclCode
= UUID
.fromString("aa27083a-6a96-42aa-a2f8-5541cf057067");
130 public static final UUID uuidAreaLevelTop
= UUID
.fromString("190d5758-4b96-4016-9412-6dc9c36ef5fd");
131 public static final UUID uuidAreaLevelFirst
= UUID
.fromString("d21503e3-875e-4abc-82ec-f812e3cfea84");
132 public static final UUID uuidAreaLevelSecond
= UUID
.fromString("97ac0bf5-b31c-487a-8ed5-a576f46c902c");
136 public static final UUID uuidLangMajorcan
= UUID
.fromString("82d696d7-cb4e-49de-ac89-63a0e12ca766");
139 public static int REF_ARTICLE
= 1;
140 public static int REF_PART_OF_OTHER_TITLE
= 2;
141 public static int REF_BOOK
= 3;
142 public static int REF_DATABASE
= 4;
143 public static int REF_INFORMAL
= 5;
144 public static int REF_NOT_APPLICABLE
= 6;
145 public static int REF_WEBSITE
= 7;
146 public static int REF_CD
= 8;
147 public static int REF_JOURNAL
= 9;
148 public static int REF_UNKNOWN
= 10;
149 public static int REF_PRINT_SERIES
= 55;
150 public static int REF_CONFERENCE_PROCEEDINGS
= 56;
151 public static int REF_JOURNAL_VOLUME
= 57;
156 public static int NAME_ST_NOM_INVAL
= 1;
157 public static int NAME_ST_NOM_ILLEG
= 2;
158 public static int NAME_ST_NOM_NUD
= 3;
159 public static int NAME_ST_NOM_REJ
= 4;
160 public static int NAME_ST_NOM_REJ_PROP
= 5;
161 public static int NAME_ST_NOM_UTIQUE_REJ
= 6;
162 public static int NAME_ST_NOM_UTIQUE_REJ_PROP
= 7;
163 public static int NAME_ST_NOM_CONS
= 8;
164 public static int NAME_ST_NOM_CONS_PROP
= 9;
165 public static int NAME_ST_ORTH_CONS
= 10;
166 public static int NAME_ST_ORTH_CONS_PROP
= 11;
167 public static int NAME_ST_NOM_SUPERFL
= 12;
168 public static int NAME_ST_NOM_AMBIG
= 13;
169 public static int NAME_ST_NOM_PROVIS
= 14;
170 public static int NAME_ST_NOM_DUB
= 15;
171 public static int NAME_ST_NOM_NOV
= 16;
172 public static int NAME_ST_NOM_CONFUS
= 17;
173 public static int NAME_ST_NOM_ALTERN
= 18;
174 public static int NAME_ST_COMB_INVAL
= 19;
178 public static int NAME_REL_IS_BASIONYM_FOR
= 1;
179 public static int NAME_REL_IS_LATER_HOMONYM_OF
= 2;
180 public static int NAME_REL_IS_REPLACED_SYNONYM_FOR
= 3;
181 public static int NAME_REL_IS_VALIDATION_OF
= 4;
182 public static int NAME_REL_IS_LATER_VALIDATION_OF
= 5;
183 public static int NAME_REL_IS_TYPE_OF
= 6;
184 public static int NAME_REL_IS_CONSERVED_TYPE_OF
=7;
185 public static int NAME_REL_IS_REJECTED_TYPE_OF
= 8;
186 public static int NAME_REL_IS_FIRST_PARENT_OF
= 9;
187 public static int NAME_REL_IS_SECOND_PARENT_OF
= 10;
188 public static int NAME_REL_IS_FEMALE_PARENT_OF
= 11;
189 public static int NAME_REL_IS_MALE_PARENT_OF
= 12;
190 public static int NAME_REL_IS_CONSERVED_AGAINST
=13;
191 public static int NAME_REL_IS_REJECTED_IN_FAVOUR_OF
= 14;
192 public static int NAME_REL_IS_TREATED_AS_LATER_HOMONYM_OF
= 15;
193 public static int NAME_REL_IS_ORTHOGRAPHIC_VARIANT_OF
= 16;
194 public static int NAME_REL_IS_ALTERNATIVE_NAME_FOR
= 17;
195 public static int NAME_REL_HAS_SAME_TYPE_AS
= 18;
196 public static int NAME_REL_IS_LECTOTYPE_OF
= 61;
197 public static int NAME_REL_TYPE_NOT_DESIGNATED
= 62;
200 public static String NAME_FACT_PROTOLOGUE
= "Protologue";
201 public static String NAME_FACT_ALSO_PUBLISHED_IN
= "Also published in";
202 public static String NAME_FACT_BIBLIOGRAPHY
= "Bibliography";
205 public static int TAX_REL_IS_INCLUDED_IN
= 1;
206 public static int TAX_REL_IS_SYNONYM_OF
= 2;
207 public static int TAX_REL_IS_MISAPPLIED_NAME_OF
= 3;
208 public static int TAX_REL_IS_PROPARTE_SYN_OF
= 4;
209 public static int TAX_REL_IS_PARTIAL_SYN_OF
= 5;
210 public static int TAX_REL_IS_HETEROTYPIC_SYNONYM_OF
= 6;
211 public static int TAX_REL_IS_HOMOTYPIC_SYNONYM_OF
= 7;
212 public static int TAX_REL_IS_PROPARTE_HOMOTYPIC_SYNONYM_OF
= 101;
213 public static int TAX_REL_IS_PROPARTE_HETEROTYPIC_SYNONYM_OF
= 102;
214 public static int TAX_REL_IS_PARTIAL_HOMOTYPIC_SYNONYM_OF
= 103;
215 public static int TAX_REL_IS_PARTIAL_HETEROTYPIC_SYNONYM_OF
= 104;
220 public static int T_STATUS_ACCEPTED
= 1;
221 public static int T_STATUS_SYNONYM
= 2;
222 public static int T_STATUS_PARTIAL_SYN
= 3;
223 public static int T_STATUS_PRO_PARTE_SYN
= 4;
224 public static int T_STATUS_UNRESOLVED
= 5;
225 public static int T_STATUS_ORPHANED
= 6;
229 public static int FACT_DESCRIPTION
= 1;
230 public static int FACT_GROWTH_FORM
= 2;
231 public static int FACT_HARDINESS
= 3;
232 public static int FACT_ECOLOGY
= 4;
233 public static int FACT_PHENOLOGY
= 5;
234 public static int FACT_KARYOLOGY
= 6;
235 public static int FACT_ILLUSTRATION
= 7;
236 public static int FACT_IDENTIFICATION
= 8;
237 public static int FACT_OBSERVATION
= 9;
238 public static int FACT_DISTRIBUTION_EM
= 10;
239 public static int FACT_DISTRIBUTION_WORLD
= 11;
241 public static final UUID uuidFeatureMaps
= UUID
.fromString("8367730e-f3c3-4361-8360-a2057e4295ed");
242 public static final UUID uuidFeatureConservationStatus
= UUID
.fromString("a32f33cd-1966-4a22-986c-94c5e688bbd1");
243 public static final UUID uuidFeatureUse
= UUID
.fromString("199bbbd8-2db6-4335-b454-2e92ae02b699");
244 public static final UUID uuidFeatureComments
= UUID
.fromString("31cc2b92-5cad-44e9-b50f-b8af591a527c");
245 public static final UUID uuidFeatureDistrEM
= UUID
.fromString("a5ba7e7f-ca7f-4f50-afc7-73e76b3231d4");
246 public static final UUID uuidFeatureDistrWorld
= UUID
.fromString("e4e24080-7017-47e6-924e-d2560fa68fb8");
247 public static final UUID uuidFeatureEditorBrackets
= UUID
.fromString("b3b5bc1a-7ba8-4a39-9c0d-63ba599eb5d8");
248 public static final UUID uuidFeatureEditorParenthesis
= UUID
.fromString("6ee10a2e-ff02-4cf4-a520-89630edc5b44");
249 public static final UUID uuidFeatureInedited
= UUID
.fromString("c93e2968-bc52-4165-9755-ce37611faf01");
250 public static final UUID uuidFeatureCommentsEditing
= UUID
.fromString("7a155021-158a-48bb-81d0-9a72b718e2de");
254 public static UUID uuidNomStatusCombIned
= UUID
.fromString("dde8a2e7-bf9e-42ec-b186-d5bde9c9c128");
255 public static UUID uuidNomStatusSpNovIned
= UUID
.fromString("1a359ca1-9364-43bc-93e4-834bdcd52b72");
256 public static UUID uuidNomStatusNomOrthCons
= UUID
.fromString("0f838183-ffa0-4014-928e-0e3a27eb3918");
258 static NomenclaturalStatusType nomStatusCombIned
;
259 static NomenclaturalStatusType nomStatusSpNovIned
;
260 static NomenclaturalStatusType nomStatusNomOrthCons
;
262 public static NomenclaturalStatusType
nomStatusTypeAbbrev2NewNomStatusType(String nomStatus
){
263 NomenclaturalStatusType result
= null;
264 if (nomStatus
== null){
266 }else if (nomStatus
.equalsIgnoreCase("comb. ined.")){
267 if (nomStatusCombIned
== null){
268 nomStatusCombIned
= NomenclaturalStatusType
.NewInstance("comb. ined.", "comb. ined.", "comb. ined.", Language
.LATIN());
269 nomStatusCombIned
.setUuid(uuidNomStatusCombIned
);
270 NomenclaturalStatusType
.ALTERNATIVE().getVocabulary().addTerm(nomStatusCombIned
);
272 result
= nomStatusCombIned
;
273 }else if (nomStatus
.equalsIgnoreCase("sp. nov. ined.")){
274 if (nomStatusSpNovIned
== null){
275 nomStatusSpNovIned
= NomenclaturalStatusType
.NewInstance("sp. nov. ined.", "sp. nov. ined.", "sp. nov. ined.", Language
.LATIN());
276 nomStatusSpNovIned
.setUuid(uuidNomStatusSpNovIned
);
277 NomenclaturalStatusType
.ALTERNATIVE().getVocabulary().addTerm(nomStatusSpNovIned
);
279 result
= nomStatusSpNovIned
;
280 }else if (nomStatus
.equalsIgnoreCase("nom. & orth. cons.")){
281 if (nomStatusNomOrthCons
== null){
282 nomStatusNomOrthCons
= NomenclaturalStatusType
.NewInstance("nom. & orth. cons.", "nom. & orth. cons.", "nom. & orth. cons.", Language
.LATIN());
283 nomStatusNomOrthCons
.setUuid(uuidNomStatusNomOrthCons
);
284 NomenclaturalStatusType
.ALTERNATIVE().getVocabulary().addTerm(nomStatusNomOrthCons
);
286 result
= nomStatusNomOrthCons
;
292 public static NomenclaturalStatus
nomStatusFkToNomStatus(int nomStatusFk
, String nomStatusLabel
) throws UnknownCdmTypeException
{
293 if (nomStatusFk
== NAME_ST_NOM_INVAL
){
294 return NomenclaturalStatus
.NewInstance(NomenclaturalStatusType
.INVALID());
295 }else if (nomStatusFk
== NAME_ST_NOM_ILLEG
){
296 return NomenclaturalStatus
.NewInstance(NomenclaturalStatusType
.ILLEGITIMATE());
297 }else if (nomStatusFk
== NAME_ST_NOM_NUD
){
298 return NomenclaturalStatus
.NewInstance(NomenclaturalStatusType
.NUDUM());
299 }else if (nomStatusFk
== NAME_ST_NOM_REJ
){
300 return NomenclaturalStatus
.NewInstance(NomenclaturalStatusType
.REJECTED());
301 }else if (nomStatusFk
== NAME_ST_NOM_REJ_PROP
){
302 return NomenclaturalStatus
.NewInstance(NomenclaturalStatusType
.REJECTED_PROP());
303 }else if (nomStatusFk
== NAME_ST_NOM_UTIQUE_REJ
){
304 return NomenclaturalStatus
.NewInstance(NomenclaturalStatusType
.UTIQUE_REJECTED());
305 }else if (nomStatusFk
== NAME_ST_NOM_UTIQUE_REJ_PROP
){
306 return NomenclaturalStatus
.NewInstance(NomenclaturalStatusType
.UTIQUE_REJECTED_PROP());
307 }else if (nomStatusFk
== NAME_ST_NOM_CONS
){
308 return NomenclaturalStatus
.NewInstance(NomenclaturalStatusType
.CONSERVED());
309 }else if (nomStatusFk
== NAME_ST_NOM_CONS_PROP
){
310 return NomenclaturalStatus
.NewInstance(NomenclaturalStatusType
.CONSERVED_PROP());
311 }else if (nomStatusFk
== NAME_ST_ORTH_CONS
){
312 return NomenclaturalStatus
.NewInstance(NomenclaturalStatusType
.ORTHOGRAPHY_CONSERVED());
313 }else if (nomStatusFk
== NAME_ST_ORTH_CONS_PROP
){
314 return NomenclaturalStatus
.NewInstance(NomenclaturalStatusType
.ORTHOGRAPHY_CONSERVED_PROP());
315 }else if (nomStatusFk
== NAME_ST_NOM_SUPERFL
){
316 return NomenclaturalStatus
.NewInstance(NomenclaturalStatusType
.SUPERFLUOUS());
317 }else if (nomStatusFk
== NAME_ST_NOM_AMBIG
){
318 return NomenclaturalStatus
.NewInstance(NomenclaturalStatusType
.AMBIGUOUS());
319 }else if (nomStatusFk
== NAME_ST_NOM_PROVIS
){
320 return NomenclaturalStatus
.NewInstance(NomenclaturalStatusType
.PROVISIONAL());
321 }else if (nomStatusFk
== NAME_ST_NOM_DUB
){
322 return NomenclaturalStatus
.NewInstance(NomenclaturalStatusType
.DOUBTFUL());
323 }else if (nomStatusFk
== NAME_ST_NOM_NOV
){
324 return NomenclaturalStatus
.NewInstance(NomenclaturalStatusType
.NOVUM());
325 }else if (nomStatusFk
== NAME_ST_NOM_CONFUS
){
326 return NomenclaturalStatus
.NewInstance(NomenclaturalStatusType
.CONFUSUM());
327 }else if (nomStatusFk
== NAME_ST_NOM_ALTERN
){
328 return NomenclaturalStatus
.NewInstance(NomenclaturalStatusType
.ALTERNATIVE());
329 }else if (nomStatusFk
== NAME_ST_COMB_INVAL
){
330 return NomenclaturalStatus
.NewInstance(NomenclaturalStatusType
.COMBINATION_INVALID());
332 NomenclaturalStatusType statusType
= nomStatusTypeAbbrev2NewNomStatusType(nomStatusLabel
);
333 NomenclaturalStatus result
= NomenclaturalStatus
.NewInstance(statusType
);
337 throw new UnknownCdmTypeException("Unknown NomenclaturalStatus (id=" + Integer
.valueOf(nomStatusFk
).toString() + ")");
343 public static SpecimenTypeDesignationStatus
typeStatusId2TypeStatus (int typeStatusId
) throws UnknownCdmTypeException
{
344 switch (typeStatusId
){
346 case 1: return SpecimenTypeDesignationStatus
.HOLOTYPE();
347 case 2: return SpecimenTypeDesignationStatus
.LECTOTYPE();
348 case 3: return SpecimenTypeDesignationStatus
.NEOTYPE();
349 case 4: return SpecimenTypeDesignationStatus
.EPITYPE();
350 case 5: return SpecimenTypeDesignationStatus
.ISOLECTOTYPE();
351 case 6: return SpecimenTypeDesignationStatus
.ISONEOTYPE();
352 case 7: return SpecimenTypeDesignationStatus
.ISOTYPE();
353 case 8: return SpecimenTypeDesignationStatus
.PARANEOTYPE();
354 case 9: return SpecimenTypeDesignationStatus
.PARATYPE();
355 case 10: return SpecimenTypeDesignationStatus
.SECOND_STEP_LECTOTYPE();
356 case 11: return SpecimenTypeDesignationStatus
.SECOND_STEP_NEOTYPE();
357 case 12: return SpecimenTypeDesignationStatus
.SYNTYPE();
358 case 21: return SpecimenTypeDesignationStatus
.ICONOTYPE();
359 case 22: return SpecimenTypeDesignationStatus
.PHOTOTYPE();
361 throw new UnknownCdmTypeException("Unknown TypeDesignationStatus (id=" + Integer
.valueOf(typeStatusId
).toString() + ")");
367 public static TaxonRelationshipType
taxonRelId2TaxonRelType (int relTaxonTypeId
, ResultWrapper
<Boolean
> isInverse
) throws UnknownCdmTypeException
{
368 isInverse
.setValue(false);
369 switch (relTaxonTypeId
){
371 case 11: return TaxonRelationshipType
.CONGRUENT_TO();
372 case 12: isInverse
.setValue(true); return TaxonRelationshipType
.INCLUDES();
373 case 13: isInverse
.setValue(true); return TaxonRelationshipType
.CONGRUENT_OR_INCLUDES();
374 case 14: return TaxonRelationshipType
.INCLUDES();
375 case 15: return TaxonRelationshipType
.CONGRUENT_OR_INCLUDES();
376 case 16: return TaxonRelationshipType
.INCLUDED_OR_INCLUDES();
377 case 17: return TaxonRelationshipType
.CONGRUENT_OR_INCLUDED_OR_INCLUDES();
378 case 18: return TaxonRelationshipType
.OVERLAPS();
379 case 19: return TaxonRelationshipType
.CONGRUENT_OR_OVERLAPS();
380 case 20: isInverse
.setValue(true); return TaxonRelationshipType
.INCLUDES_OR_OVERLAPS();
381 case 21: isInverse
.setValue(true); return TaxonRelationshipType
.CONGRUENT_OR_INCLUDES_OR_OVERLAPS();
382 case 22: return TaxonRelationshipType
.INCLUDES_OR_OVERLAPS();
383 case 23: return TaxonRelationshipType
.CONGRUENT_OR_INCLUDES_OR_OVERLAPS();
384 case 24: return TaxonRelationshipType
.INCLUDED_OR_INCLUDES_OR_OVERLAPS();
386 case 26: return TaxonRelationshipType
.EXCLUDES();
388 //TODO other relationshipTypes
390 case 40: return TaxonRelationshipType
.NOT_CONGRUENT_TO();
393 case 43: return TaxonRelationshipType
.CONGRUENT_TO();
395 throw new UnknownCdmTypeException("Unknown TypeDesignationStatus (id=" + Integer
.valueOf(relTaxonTypeId
).toString() + ")");
401 public static HybridRelationshipType
relNameId2HybridRel (int relNameId
) throws UnknownCdmTypeException
{
404 case 9: return HybridRelationshipType
.FIRST_PARENT();
405 case 10: return HybridRelationshipType
.SECOND_PARENT();
406 case 11: return HybridRelationshipType
.FEMALE_PARENT();
407 case 12: return HybridRelationshipType
.MALE_PARENT();
409 throw new UnknownCdmTypeException("Unknown HybridRelationshipType (id=" + Integer
.valueOf(relNameId
).toString() + ")");
415 public static PresenceAbsenceTermBase
<?
> occStatus2PresenceAbsence (int occStatusId
) throws UnknownCdmTypeException
{
416 switch (occStatusId
){
418 case 110: return AbsenceTerm
.CULTIVATED_REPORTED_IN_ERROR();
419 case 120: return PresenceTerm
.CULTIVATED();
420 case 210: return AbsenceTerm
.INTRODUCED_REPORTED_IN_ERROR();
421 case 220: return PresenceTerm
.INTRODUCED_PRESENCE_QUESTIONABLE();
422 case 230: return AbsenceTerm
.INTRODUCED_FORMERLY_INTRODUCED();
423 case 240: return PresenceTerm
.INTRODUCED_DOUBTFULLY_INTRODUCED();
424 case 250: return PresenceTerm
.INTRODUCED();
425 case 260: return PresenceTerm
.INTRODUCED_UNCERTAIN_DEGREE_OF_NATURALISATION();
426 case 270: return PresenceTerm
.INTRODUCED_ADVENTITIOUS();
427 case 280: return PresenceTerm
.INTRODUCED_NATURALIZED();
428 case 310: return AbsenceTerm
.NATIVE_REPORTED_IN_ERROR();
429 case 320: return PresenceTerm
.NATIVE_PRESENCE_QUESTIONABLE();
430 case 330: return AbsenceTerm
.NATIVE_FORMERLY_NATIVE();
431 case 340: return PresenceTerm
.NATIVE_DOUBTFULLY_NATIVE();
432 case 350: return PresenceTerm
.NATIVE();
434 logger
.info("endemic for EM can not be transformed in legal status. Used 'PRESENT' instead");
436 return PresenceTerm
.PRESENT();
439 throw new UnknownCdmTypeException("Unknown occurrence status (id=" + Integer
.valueOf(occStatusId
).toString() + ")");
446 public static Feature
factCategory2Feature (int factCategoryId
) throws UnknownCdmTypeException
{
447 switch (factCategoryId
){
449 case 1: return Feature
.DESCRIPTION();
450 case 4: return Feature
.ECOLOGY();
451 case 5: return Feature
.PHENOLOGY();
452 case 12: return Feature
.COMMON_NAME();
453 case 13: return Feature
.OCCURRENCE();
454 case 99: return Feature
.CITATION();
456 throw new UnknownCdmTypeException("Unknown FactCategory (id=" + Integer
.valueOf(factCategoryId
).toString() + ")");
461 public static UUID
getFeatureUuid(String key
) throws UndefinedTransformerMethodException
{
464 }else if (key
.equalsIgnoreCase("14-Maps")){ return uuidFeatureMaps
;
465 }else if (key
.equalsIgnoreCase("301-Conservation Status")){ return uuidFeatureConservationStatus
;
466 }else if (key
.equalsIgnoreCase("302-Use")){ return uuidFeatureUse
;
467 }else if (key
.equalsIgnoreCase("303-Comments")){ return uuidFeatureComments
;
469 }else if (key
.equalsIgnoreCase("10-general distribution (Euro+Med)")){ return uuidFeatureDistrEM
;
470 }else if (key
.equalsIgnoreCase("11-general distribution (world)")){ return uuidFeatureDistrWorld
;
471 }else if (key
.equalsIgnoreCase("250-Editor_Brackets")){ return uuidFeatureEditorBrackets
;
472 }else if (key
.equalsIgnoreCase("251-Editor_Parenthesis")){ return uuidFeatureEditorParenthesis
;
473 }else if (key
.equalsIgnoreCase("252-Inedited")){ return uuidFeatureInedited
;
474 }else if (key
.equalsIgnoreCase("253-Comments on editing process")){ return uuidFeatureCommentsEditing
;
482 static Rank collSpeciesRank
;
487 private static Rank
rankId2NewRank(Integer rankId
, boolean switchRank
) {
491 }else if (rankId
== 57){
493 if (collSpeciesRank
== null){
494 collSpeciesRank
= Rank
.NewInstance(RankClass
.SpeciesGroup
, "Collective species", "Coll. species", "coll.");
495 collSpeciesRank
.setUuid(uuidRankCollSpecies
);
496 OrderedTermVocabulary
<Rank
> voc
= (OrderedTermVocabulary
<Rank
>)Rank
.SPECIES().getVocabulary();
497 voc
.addTermBelow(collSpeciesRank
, Rank
.SPECIESGROUP());
499 result
= collSpeciesRank
;
505 public static Rank
rankId2Rank (ResultSet rs
, boolean useUnknown
, boolean switchSpeciesGroup
) throws UnknownCdmTypeException
{
508 int rankId
= rs
.getInt("rankFk");
510 String abbrev
= rs
.getString("rankAbbrev");
511 String rankName
= rs
.getString("rank");
512 if (logger
.isDebugEnabled()){logger
.debug(rankId
);}
513 if (logger
.isDebugEnabled()){logger
.debug(abbrev
);}
514 if (logger
.isDebugEnabled()){logger
.debug(rankName
);}
516 if (switchSpeciesGroup
){
519 }else if (rankId
== 57){
524 result
= Rank
.getRankByNameOrIdInVoc(abbrev
);
525 } catch (UnknownCdmTypeException e
) {
527 result
= Rank
.getRankByNameOrIdInVoc(rankName
);
528 } catch (UnknownCdmTypeException e1
) {
531 case 1: return Rank
.KINGDOM();
532 case 3: return Rank
.SUBKINGDOM();
533 case 5: return Rank
.PHYLUM();
534 case 7: return Rank
.SUBPHYLUM();
535 case 8: return Rank
.DIVISION();
536 case 9: return Rank
.SUBDIVISION();
537 case 10: return Rank
.CLASS();
538 case 13: return Rank
.SUBCLASS();
539 case 16: return Rank
.SUPERORDER();
540 case 18: return Rank
.ORDER();
541 case 19: return Rank
.SUBORDER();
542 case 20: return Rank
.FAMILY();
543 case 25: return Rank
.SUBFAMILY();
544 case 30: return Rank
.TRIBE();
545 case 35: return Rank
.SUBTRIBE();
546 case 40: return Rank
.GENUS();
547 case 42: return Rank
.SUBGENUS();
548 case 45: return Rank
.SECTION_BOTANY();
549 case 47: return Rank
.SUBSECTION_BOTANY();
550 case 50: return Rank
.SERIES();
551 case 52: return Rank
.SUBSERIES();
552 case 58: return Rank
.SPECIESAGGREGATE();
553 case 59: return Rank
.SPECIESGROUP();
554 case 60: return Rank
.SPECIES();
555 case 61: return Rank
.GREX();
556 case 65: return Rank
.SUBSPECIES();
557 case 66: {System
.out
.println("Rank 66 not yet implemented"); throw new UnknownCdmTypeException("Unknown Rank id" + Integer
.valueOf(rankId
).toString());}
558 case 67: {System
.out
.println("Rank 67 not yet implemented"); throw new UnknownCdmTypeException("Unknown Rank id" + Integer
.valueOf(rankId
).toString());}
559 case 68: return Rank
.CONVAR();
560 case 70: return Rank
.VARIETY();
561 case 73: return Rank
.SUBVARIETY();
562 case 80: return Rank
.FORM();
563 case 82: return Rank
.SUBFORM();
564 case 84: return Rank
.SPECIALFORM();
565 case 98: return Rank
.INFRAGENERICTAXON();
566 case 99: return Rank
.INFRASPECIFICTAXON();
568 case 750: return Rank
.SUPERCLASS();
569 case 780: return Rank
.INFRACLASS();
570 case 820: return Rank
.INFRAORDER();
572 case 830: return Rank
.SUPERFAMILY();
575 Rank rank
= rankId2NewRank(57, switchSpeciesGroup
);
580 logger
.error("Rank unknown: " + rankId
+ ". Created UNKNOWN_RANK");
581 return Rank
.UNKNOWN_RANK();
583 throw new UnknownCdmTypeException("Unknown Rank id" + Integer
.valueOf(rankId
).toString());
589 } catch (SQLException e
) {
591 logger
.warn("Exception occurred. Created UNKNOWN_RANK instead");
592 return Rank
.UNKNOWN_RANK();
597 public static Integer
rank2RankId (Rank rank
){
601 else if (rank
.equals(Rank
.KINGDOM())){ return 1;}
602 else if (rank
.equals(Rank
.SUBKINGDOM())){ return 3;}
603 else if (rank
.equals(Rank
.PHYLUM())){ return 5;}
604 else if (rank
.equals(Rank
.SUBPHYLUM())){ return 7;}
605 else if (rank
.equals(Rank
.DIVISION())){ return 8;}
606 else if (rank
.equals(Rank
.SUBDIVISION())){ return 9;}
608 else if (rank
.equals(Rank
.CLASS())){ return 10;}
609 else if (rank
.equals(Rank
.SUBCLASS())){ return 13;}
610 else if (rank
.equals(Rank
.SUPERORDER())){ return 16;}
611 else if (rank
.equals(Rank
.ORDER())){ return 18;}
612 else if (rank
.equals(Rank
.SUBORDER())){ return 19;}
613 else if (rank
.equals(Rank
.FAMILY())){ return 20;}
614 else if (rank
.equals(Rank
.SUBFAMILY())){ return 25;}
615 else if (rank
.equals(Rank
.TRIBE())){ return 30;}
616 else if (rank
.equals(Rank
.SUBTRIBE())){ return 35;}
617 else if (rank
.equals(Rank
.GENUS())){ return 40;}
618 else if (rank
.equals(Rank
.SUBGENUS())){ return 42;}
619 else if (rank
.equals(Rank
.SECTION_BOTANY())){ return 45;}
620 else if (rank
.equals(Rank
.SUBSECTION_BOTANY())){ return 47;}
621 else if (rank
.equals(Rank
.SERIES())){ return 50;}
622 else if (rank
.equals(Rank
.SUBSERIES())){ return 52;}
623 else if (rank
.equals(Rank
.SPECIESAGGREGATE())){ return 58;}
625 // else if (rank.equals(Rank.XXX())){ return 59;}
626 else if (rank
.equals(Rank
.SPECIES())){ return 60;}
627 else if (rank
.equals(Rank
.SUBSPECIES())){ return 65;}
628 else if (rank
.equals(Rank
.CONVAR())){ return 68;}
629 else if (rank
.equals(Rank
.VARIETY())){ return 70;}
630 else if (rank
.equals(Rank
.SUBVARIETY())){ return 73;}
631 else if (rank
.equals(Rank
.FORM())){ return 80;}
632 else if (rank
.equals(Rank
.SUBFORM())){ return 82;}
633 else if (rank
.equals(Rank
.SPECIALFORM())){ return 84;}
634 else if (rank
.equals(Rank
.INFRAGENERICTAXON())){ return 98;}
635 else if (rank
.equals(Rank
.INFRASPECIFICTAXON())){ return 99;}
637 else if (rank
.equals(Rank
.SUPERCLASS())){ return 750;}
638 else if (rank
.equals(Rank
.INFRACLASS())){ return 780;}
639 else if (rank
.equals(Rank
.INFRAORDER())){ return 820;}
640 else if (rank
.equals(Rank
.SUPERFAMILY())){ return 830;}
644 logger
.warn("Rank not yet supported in Berlin Model: "+ rank
.getLabel());
649 public static Integer
textData2FactCategoryFk (Feature feature
){
650 if (feature
== null){return null;}
651 if (feature
.equals(Feature
.DESCRIPTION())){
653 }else if (feature
.equals(Feature
.ECOLOGY())){
655 }else if (feature
.equals(Feature
.PHENOLOGY())){
657 }else if (feature
.equals(Feature
.COMMON_NAME())){
659 }else if (feature
.equals(Feature
.OCCURRENCE())){
661 }else if (feature
.equals(Feature
.CITATION())){
664 logger
.debug("Unknown Feature.");
670 public static Integer
taxonBase2statusFk (TaxonBase
<?
> taxonBase
){
671 if (taxonBase
== null){return null;}
672 if (taxonBase
.isInstanceOf(Taxon
.class)){
673 return T_STATUS_ACCEPTED
;
674 }else if (taxonBase
.isInstanceOf(Synonym
.class)){
675 return T_STATUS_SYNONYM
;
677 logger
.warn("Unknown ");
678 return T_STATUS_UNRESOLVED
;
681 // public static int T_STATUS_PARTIAL_SYN = 3;
682 // public static int T_STATUS_PRO_PARTE_SYN = 4;
683 // public static int T_STATUS_UNRESOLVED = 5;
684 // public static int T_STATUS_ORPHANED = 6;
687 public static Integer
ref2refCategoryId (Reference
<?
> ref
){
691 else if (ref
.getType().equals(ReferenceType
.Article
)){ return REF_ARTICLE
;}
692 else if (ref
instanceof ISection
){ return REF_PART_OF_OTHER_TITLE
;}
693 else if (ref
.getType().equals(ReferenceType
.Book
)){ return REF_BOOK
;}
694 else if (ref
.getType().equals(ReferenceType
.Database
)){ return REF_DATABASE
;}
695 // else if (ref instanceof SectionBas){ return REF_INFORMAL;}
696 // else if (ref instanceof SectionBas){ return REF_NOT_APPLICABLE;}
697 else if (ref
.getType().equals(ReferenceType
.WebPage
)){ return REF_WEBSITE
;}
698 else if (ref
.getType().equals(ReferenceType
.CdDvd
)){ return REF_CD
;}
699 else if (ref
.getType().equals(ReferenceType
.Journal
)){ return REF_JOURNAL
;}
700 else if (ref
.getType().equals(ReferenceType
.Generic
)){ return REF_UNKNOWN
;}
701 else if (ref
.getType().equals(ReferenceType
.PrintSeries
)){
702 logger
.warn("Print Series is not a standard Berlin Model category");
703 return REF_PRINT_SERIES
;
705 else if (ref
.getType().equals(ReferenceType
.Proceedings
)){
706 logger
.warn("Proceedings is not a standard Berlin Model category");
707 return REF_CONFERENCE_PROCEEDINGS
;
709 // else if (ref instanceof ){ return REF_JOURNAL_VOLUME;}
710 else if (ref
.getType().equals(ReferenceType
.Patent
)){ return REF_NOT_APPLICABLE
;}
711 else if (ref
.getType().equals(ReferenceType
.PersonalCommunication
)){ return REF_INFORMAL
;}
712 else if (ref
.getType().equals(ReferenceType
.Report
)){ return REF_NOT_APPLICABLE
;}
713 else if (ref
.getType().equals(ReferenceType
.Thesis
)){ return REF_NOT_APPLICABLE
;}
714 else if (ref
.getType().equals(ReferenceType
.Report
)){ return REF_NOT_APPLICABLE
;}
718 logger
.warn("Reference type not yet supported in Berlin Model: "+ ref
.getClass().getSimpleName());
724 public static Integer
taxRelation2relPtQualifierFk (RelationshipBase
<?
,?
,?
> rel
){
728 // else if (rel instanceof SynonymRelationship){
730 // }else if (rel instanceof TaxonRelationship){
731 RelationshipTermBase
<?
> type
= rel
.getType();
732 if (type
.equals(TaxonRelationshipType
.TAXONOMICALLY_INCLUDED_IN())) {return TAX_REL_IS_INCLUDED_IN
;
733 }else if (type
.equals(TaxonRelationshipType
.MISAPPLIED_NAME_FOR())) {return TAX_REL_IS_MISAPPLIED_NAME_OF
;
734 }else if (type
.equals(SynonymRelationshipType
.SYNONYM_OF())) {return TAX_REL_IS_SYNONYM_OF
;
735 }else if (type
.equals(SynonymRelationshipType
.HOMOTYPIC_SYNONYM_OF())) {return TAX_REL_IS_HOMOTYPIC_SYNONYM_OF
;
736 }else if (type
.equals(SynonymRelationshipType
.HETEROTYPIC_SYNONYM_OF())) {return TAX_REL_IS_HETEROTYPIC_SYNONYM_OF
;
737 }else if (type
.equals(TaxonRelationshipType
.CONGRUENT_TO())) {return 11;
738 // public static int TAX_REL_IS_PROPARTE_SYN_OF = 4;
739 // public static int TAX_REL_IS_PARTIAL_SYN_OF = 5;
740 // public static int TAX_REL_IS_PROPARTE_HOMOTYPIC_SYNONYM_OF = 101;
741 // public static int TAX_REL_IS_PROPARTE_HETEROTYPIC_SYNONYM_OF = 102;
742 // public static int TAX_REL_IS_PARTIAL_HOMOTYPIC_SYNONYM_OF = 103;
743 // public static int TAX_REL_IS_PARTIAL_HETEROTYPIC_SYNONYM_OF = 104;
747 logger
.warn("Relationship type not yet supported by Berlin Model export: "+ rel
.getType());
752 public static Integer
nomStatus2nomStatusFk (NomenclaturalStatusType status
){
756 if (status
.equals(NomenclaturalStatusType
.INVALID())) {return NAME_ST_NOM_INVAL
;
757 }else if (status
.equals(NomenclaturalStatusType
.ILLEGITIMATE())) {return NAME_ST_NOM_ILLEG
;
758 }else if (status
.equals(NomenclaturalStatusType
.NUDUM())) {return NAME_ST_NOM_NUD
;
759 }else if (status
.equals(NomenclaturalStatusType
.REJECTED())) {return NAME_ST_NOM_REJ
;
760 }else if (status
.equals(NomenclaturalStatusType
.REJECTED_PROP())) {return NAME_ST_NOM_REJ_PROP
;
761 }else if (status
.equals(NomenclaturalStatusType
.UTIQUE_REJECTED())) {return NAME_ST_NOM_UTIQUE_REJ
;
762 }else if (status
.equals(NomenclaturalStatusType
.UTIQUE_REJECTED_PROP())) {return NAME_ST_NOM_UTIQUE_REJ_PROP
;
763 }else if (status
.equals(NomenclaturalStatusType
.CONSERVED())) {return NAME_ST_NOM_CONS
;
765 }else if (status
.equals(NomenclaturalStatusType
.CONSERVED_PROP())) {return NAME_ST_NOM_CONS_PROP
;
766 }else if (status
.equals(NomenclaturalStatusType
.ORTHOGRAPHY_CONSERVED())) {return NAME_ST_ORTH_CONS
;
767 }else if (status
.equals(NomenclaturalStatusType
.ORTHOGRAPHY_CONSERVED_PROP())) {return NAME_ST_ORTH_CONS_PROP
;
768 }else if (status
.equals(NomenclaturalStatusType
.SUPERFLUOUS())) {return NAME_ST_NOM_SUPERFL
;
769 }else if (status
.equals(NomenclaturalStatusType
.AMBIGUOUS())) {return NAME_ST_NOM_AMBIG
;
770 }else if (status
.equals(NomenclaturalStatusType
.PROVISIONAL())) {return NAME_ST_NOM_PROVIS
;
771 }else if (status
.equals(NomenclaturalStatusType
.DOUBTFUL())) {return NAME_ST_NOM_DUB
;
772 }else if (status
.equals(NomenclaturalStatusType
.NOVUM())) {return NAME_ST_NOM_NOV
;
774 }else if (status
.equals(NomenclaturalStatusType
.CONFUSUM())) {return NAME_ST_NOM_CONFUS
;
775 }else if (status
.equals(NomenclaturalStatusType
.ALTERNATIVE())) {return NAME_ST_NOM_ALTERN
;
776 }else if (status
.equals(NomenclaturalStatusType
.COMBINATION_INVALID())) {return NAME_ST_COMB_INVAL
;
780 logger
.warn("NomStatus type not yet supported by Berlin Model export: "+ status
);
787 public static Integer
nameRel2RelNameQualifierFk (RelationshipBase
<?
,?
,?
> rel
){
791 RelationshipTermBase
<?
> type
= rel
.getType();
792 if (type
.equals(NameRelationshipType
.BASIONYM())) {return NAME_REL_IS_BASIONYM_FOR
;
793 }else if (type
.equals(NameRelationshipType
.LATER_HOMONYM())) {return NAME_REL_IS_LATER_HOMONYM_OF
;
794 }else if (type
.equals(NameRelationshipType
.REPLACED_SYNONYM())) {return NAME_REL_IS_REPLACED_SYNONYM_FOR
;
796 }else if (type
.equals(NameRelationshipType
.VALIDATED_BY_NAME())) {return NAME_REL_IS_VALIDATION_OF
;
797 }else if (type
.equals(NameRelationshipType
.LATER_VALIDATED_BY_NAME())) {return NAME_REL_IS_LATER_VALIDATION_OF
;
798 }else if (type
.equals(NameRelationshipType
.CONSERVED_AGAINST())) {return NAME_REL_IS_CONSERVED_AGAINST
;
801 }else if (type
.equals(NameRelationshipType
.TREATED_AS_LATER_HOMONYM())) {return NAME_REL_IS_TREATED_AS_LATER_HOMONYM_OF
;
802 }else if (type
.equals(NameRelationshipType
.ORTHOGRAPHIC_VARIANT())) {return NAME_REL_IS_ORTHOGRAPHIC_VARIANT_OF
;
805 logger
.warn("Relationship type not yet supported by Berlin Model export: "+ rel
.getType());
811 // }else if (type.equals(NameRelationshipType.())) {return NAME_REL_IS_REJECTED_IN_FAVOUR_OF;
813 // public static int NAME_REL_IS_FIRST_PARENT_OF = 9;
814 // public static int NAME_REL_IS_SECOND_PARENT_OF = 10;
815 // public static int NAME_REL_IS_FEMALE_PARENT_OF = 11;
816 // public static int NAME_REL_IS_MALE_PARENT_OF = 12;
818 // public static int NAME_REL_IS_REJECTED_IN_FAVOUR_OF = 14;
819 // }else if (type.equals(NameRelationshipType.)) {return NAME_REL_IS_REJECTED_TYPE_OF;
821 // public static int NAME_REL_HAS_SAME_TYPE_AS = 18;
822 // public static int NAME_REL_IS_LECTOTYPE_OF = 61;
823 // public static int NAME_REL_TYPE_NOT_DESIGNATED = 62;
825 // }else if (type.equals(NameRelationshipType.LATER_VALIDATED_BY_NAME())) {return NAME_REL_IS_TYPE_OF;
830 public static UUID
getWebMarkerUuid (int markerCategoryId
){
831 if (markerCategoryId
== 1){
832 return UUID
.fromString("d8554418-d1ae-471d-a1bd-a0cbc7ab860c"); //any as not to find in cichorieae
833 }else if (markerCategoryId
== 2){
834 return UUID
.fromString("7f189c48-8632-4870-9ec8-e4d2489f324e");
835 }else if (markerCategoryId
== 3){
836 return UUID
.fromString("9a115e6b-8210-4dd3-825a-6fed11016c63");
837 }else if (markerCategoryId
== 4){
838 return UUID
.fromString("1d287011-2054-41c5-a919-17ac1d0a9270");
839 }else if (markerCategoryId
== 9){
840 return UUID
.fromString("cc5eca5c-1ae5-4feb-9a95-507fc167b0c9");
842 }else if (markerCategoryId
== 5){
843 return UUID
.fromString("7d8875b3-107c-4189-97e5-cadb470e543a");
844 }else if (markerCategoryId
== 20){
845 return UUID
.fromString("3574e2b0-6431-4d71-b456-bc967c80f622");
846 }else if (markerCategoryId
== 30){
847 return UUID
.fromString("9924b27e-0dbe-4d95-ae9b-096fbbc3edcb");
848 }else if (markerCategoryId
== 40){
849 return UUID
.fromString("69241b97-f4d2-4f60-9aed-1c4ccb5bced5");
850 }else if (markerCategoryId
== 50){
851 return UUID
.fromString("f3b62ce3-0212-4542-a74c-0c68d08859b1");
852 }else if (markerCategoryId
== 55){
853 return UUID
.fromString("bec822f2-8242-425f-ad46-f11f0b82f69b");
854 }else if (markerCategoryId
== 60){
855 return UUID
.fromString("722fca60-0416-4bf0-aa4b-a07400f9710d");
856 }else if (markerCategoryId
== 70){
857 return UUID
.fromString("ed57857b-1001-4b09-b48e-d88ab146bb2b");
858 }else if (markerCategoryId
== 80){
859 return UUID
.fromString("637e8b77-1202-462b-9d77-1023f3c192d9");
860 }else if (markerCategoryId
== 90){
861 return UUID
.fromString("c769c231-6e76-46df-88f7-2c459342a3c2");
862 }else if (markerCategoryId
== 93){
863 return UUID
.fromString("075ee97e-246f-4f3d-aa96-16930df6268c");
864 }else if (markerCategoryId
== 100){
865 return UUID
.fromString("e17065bf-3e44-417a-b05c-f82929f680c3");
866 }else if (markerCategoryId
== 110){
867 return UUID
.fromString("e2b8de07-770e-4fda-b445-c4735f4e95c8");
868 }else if (markerCategoryId
== 900){
869 return UUID
.fromString("d029c3c9-944a-4bb9-bba6-12c95da94a04");
870 }else if (markerCategoryId
== 920){
871 return UUID
.fromString("98af97b1-e5e3-4ee4-902e-15032316bfc3");
872 }else if (markerCategoryId
== 930){
873 return UUID
.fromString("4b6c3130-4e50-4f45-8461-d2698cf5f80b");
874 }else if (markerCategoryId
== 950){
875 return UUID
.fromString("1e53f58c-6528-42c6-99ae-0f75a3c3c264");
876 }else if (markerCategoryId
== 960){
877 return UUID
.fromString("1903d460-94cc-4fc4-b2a8-a3fb0cfd69a0");
879 logger
.warn("Unknown webMarker category: " + markerCategoryId
);