3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
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.
11 package eu
.etaxonomy
.cdm
.model
.common
;
13 import java
.io
.Serializable
;
15 import java
.util
.UUID
;
17 import javax
.lang
.model
.element
.Modifier
;
18 import javax
.xml
.bind
.annotation
.XmlEnum
;
19 import javax
.xml
.bind
.annotation
.XmlEnumValue
;
21 import org
.apache
.log4j
.Logger
;
23 import eu
.etaxonomy
.cdm
.model
.agent
.Institution
;
24 import eu
.etaxonomy
.cdm
.model
.description
.CategoricalData
;
25 import eu
.etaxonomy
.cdm
.model
.description
.DescriptionBase
;
26 import eu
.etaxonomy
.cdm
.model
.description
.DescriptionElementBase
;
27 import eu
.etaxonomy
.cdm
.model
.description
.Distribution
;
28 import eu
.etaxonomy
.cdm
.model
.description
.MeasurementUnit
;
29 import eu
.etaxonomy
.cdm
.model
.description
.SpecimenDescription
;
30 import eu
.etaxonomy
.cdm
.model
.description
.StateData
;
31 import eu
.etaxonomy
.cdm
.model
.description
.StatisticalMeasurementValue
;
32 import eu
.etaxonomy
.cdm
.model
.description
.TaxonDescription
;
33 import eu
.etaxonomy
.cdm
.model
.description
.TextData
;
34 import eu
.etaxonomy
.cdm
.model
.location
.NamedArea
;
35 import eu
.etaxonomy
.cdm
.model
.location
.Point
;
36 import eu
.etaxonomy
.cdm
.model
.media
.Rights
;
37 import eu
.etaxonomy
.cdm
.model
.molecular
.Amplification
;
38 import eu
.etaxonomy
.cdm
.model
.name
.HybridRelationship
;
39 import eu
.etaxonomy
.cdm
.model
.name
.NameRelationship
;
40 import eu
.etaxonomy
.cdm
.model
.name
.NameTypeDesignation
;
41 import eu
.etaxonomy
.cdm
.model
.name
.NomenclaturalStatus
;
42 import eu
.etaxonomy
.cdm
.model
.name
.SpecimenTypeDesignation
;
43 import eu
.etaxonomy
.cdm
.model
.name
.TaxonNameBase
;
44 import eu
.etaxonomy
.cdm
.model
.occurrence
.DerivationEvent
;
45 import eu
.etaxonomy
.cdm
.model
.occurrence
.SpecimenOrObservationBase
;
46 import eu
.etaxonomy
.cdm
.model
.taxon
.Synonym
;
47 import eu
.etaxonomy
.cdm
.model
.taxon
.SynonymRelationship
;
48 import eu
.etaxonomy
.cdm
.model
.taxon
.Taxon
;
49 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonBase
;
50 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonRelationship
;
55 * The term type is used to define the type of a {@link TermBase term}, may it be a vocabulary or a defined term.<BR>
56 * It is used to define in which context a term may be used. From v3.3 on this replaces the semantic part of the subclasses
57 * of the class {@link DefinedTermBase}. E.g. before v3.3 a term defining a sex and a term defining a stage had to different
58 * classes Sex and Stage. With v3.3 they both became {@link DefinedTerm}s but with different types.<BR>
59 * The type of a term and the type of its vocabulary should be the same. Before v3.3 it was not always possible to define
60 * what the context of an (empty) vocabulary is.
61 * In future versions this enum may also be expressed as a term, not an enum. For now the general policy is to
62 * transform former classes to general classes with enums as their types.
68 public enum TermType
implements IEnumTerm
<TermType
>, Serializable
{
72 * Unknown term type is the type to be used if no information is available about the type.
73 * In the current model this type should never be used. However, it is a placeholder in case
74 * we find an appropriate usage in future.
76 @XmlEnumValue("Unknown")
77 Unknown(UUID
.fromString("b2836c89-3b1d-4758-ba6d-568ef8d6fbc4"), "Unknown term type","UNK", null),
81 * Term type to represent languages.
83 @XmlEnumValue("Language")
84 Language(UUID
.fromString("5591dc6c-ad1f-4abd-b6c2-4852ea8e46df"), "Language", "LA", null),
88 * Term type for areas.
90 @XmlEnumValue("NamedArea")
91 NamedArea(UUID
.fromString("8c9a0bc9-da91-478d-bc8b-44b11565e160"), "Named area", "NA", null),
95 * Term type for taxonomic ranks.
98 Rank(UUID
.fromString("8d26b6a9-8a89-45d5-8358-49c3e4f30ade"), "Rank", "RK", null),
102 * Term type for descriptive features.
103 * @see DescriptionElementBase
105 @XmlEnumValue("Feature")
106 Feature(UUID
.fromString("b866a1d6-f962-4c23-bb8e-a3b66d33aedc"), "Feature", "FE", null),
110 * Term type for annotation types.
113 @XmlEnumValue("AnnotationType")
114 AnnotationType(UUID
.fromString("c3aabb64-6174-4152-95b1-7cec57e485cf"), "Annotation type", "ANT", null),
118 * Term type for marker types.
121 @XmlEnumValue("MarkerType")
122 MarkerType(UUID
.fromString("d28a1bf8-95ed-483a-8f02-3515b14998e0"), "MarkerType", "MKT", null),
126 * Term type for extension types.
129 @XmlEnumValue("ExtensionType")
130 ExtensionType(UUID
.fromString("12f5c03b-528a-4909-b81b-e525feabc97c"), "Extension type", "EXT", null),
134 * Term type for derivation event types.
135 * @see DerivationEvent
137 @XmlEnumValue("DerivationEventType")
138 DerivationEventType(UUID
.fromString("ba8e4b10-c792-42e7-a3f5-874708f10094"), "Derivation event type", "DET", null),
142 * Term type for presence or absence status
145 @XmlEnumValue("PresenceAbsenceTerm")
146 PresenceAbsenceTerm(UUID
.fromString("f6b80f88-c8c5-456b-bbd6-d63ecf35606e"), "Presence or absence term", "PAT", null),
150 * Term type for the taxonomic nomenclatural status of a {@link TaxonNameBase taxon name}.
151 * @see NomenclaturalStatus
153 @XmlEnumValue("NomenclaturalStatusType")
154 NomenclaturalStatusType(UUID
.fromString("c1acb71a-1d11-4305-8818-c2268d341742"), "Nomenclatural status type", "NST", null),
158 * Term type for the type of a name relationship between {@link TaxonNameBase taxon names}
159 * @see NameRelationship
161 @XmlEnumValue("NameRelationshipType")
162 NameRelationshipType(UUID
.fromString("acd8189a-23b9-4a53-8f48-1d2aa270a6ba"), "Name relationship type", "NRT"),
166 * Term type for the type of a hybrid relationship between {@link TaxonNameBase taxon names}
167 * @see HybridRelationship
169 @XmlEnumValue("HybridRelationshipType")
170 HybridRelationshipType(UUID
.fromString("aade9e61-eaa1-40fe-9eb1-40f9e8ae1114"), "Hybrid relationship type", "HRT"),
174 * Term type for the type of a synonym relationship between 2 {@link TaxonBase taxa}
175 * @see SynonymRelationship
179 @XmlEnumValue("SynonymRelationshipType")
180 SynonymRelationshipType(UUID
.fromString("1eb4fee0-7716-4531-a9ed-a95327f1f4bb"), "Synonym relationship type", "SRT"),
184 * Term type for the type of a taxonomic concept relationship between
185 * 2 {@link Taxon accepted taxa} with different secundum referece.
186 * @see TaxonRelationship
189 @XmlEnumValue("TaxonRelationshipType")
190 TaxonRelationshipType(UUID
.fromString("2d4b281c-142e-42c5-8eb5-1747592b54d8"), "Taxon relationship type", "TRT"),
194 * Term type for the type of a typification of a taxonomic name
195 * with a rank higher then species.
196 * @see eu.etaxonomy.cdm.model.name.NameTypeDesignationStatus
197 * @see NameTypeDesignation
199 @XmlEnumValue("NameTypeDesignationStatus")
200 NameTypeDesignationStatus(UUID
.fromString("d3860be6-8a08-4fff-984a-6ee8b42937c9"), "Name type designation status", "NTD"),
204 * Term type for the type of a typification of a taxonomic name
205 * with a rank equal or lower then species.
206 * @see {@link eu.etaxonomy.cdm.model.name.SpecimenTypeDesignationStatus}
207 * @see SpecimenTypeDesignation
209 @XmlEnumValue("SpecimenTypeDesignationStatus")
210 SpecimenTypeDesignationStatus(UUID
.fromString("4014d7d4-f2dd-4328-8015-357a1a77c1ed"), "Specimen type designation status", "STD"),
214 * Term type for an institution type.
217 @XmlEnumValue("InstitutionType")
218 InstitutionType(UUID
.fromString("09d78265-18b5-4352-b154-d2f39e84d3f3"), "Institution type", "IT", null),
222 * Term type for a named area type.
224 * @see eu.etaxonomy.cdm.model.location.NamedAreaType
226 @XmlEnumValue("NamedAreaType")
227 NamedAreaType(UUID
.fromString("6a9aba35-6272-4373-8386-000cf95b729e"), "Named area type", "NAT", null),
231 * Term type for a named area level.
233 * @see eu.etaxonomy.cdm.model.location.NamedAreaLevel
235 @XmlEnumValue("NamedAreaLevel")
236 NamedAreaLevel(UUID
.fromString("62c16c74-dc79-4970-9031-bb1504be46f5"), "Named area level", "NAL", null),
240 * Term type for rights.
243 @XmlEnumValue("RightsType")
244 RightsType(UUID
.fromString("80e06b04-8d0d-4bd5-bcd6-d35f73c24d55"), "Rights type", "RT", null),
248 * Term type for a measurement unit.
249 * @see MeasurementUnit
251 @XmlEnumValue("MeasurementUnit")
252 MeasurementUnit(UUID
.fromString("f9e6c44f-f0d6-428b-9bc0-bb00a6514883"), "Measurement unit", "MU", null),
256 * Term type for a statistical measure.
257 * @see eu.etaxonomy.cdm.model.description.StatisticalMeasure
258 * @see StatisticalMeasurementValue
260 @XmlEnumValue("StatisticalMeasure")
261 StatisticalMeasure(UUID
.fromString("a22d19cd-a342-4af2-b156-d688a7aa8a6b"), "Statistical measure", "SM", null),
264 @XmlEnumValue("MaterialOrMethod")
265 MaterialOrMethod(UUID
.fromString("285a1406-a606-46b9-b0a4-717748296e50"), "Material or Method", "MOM"),
268 @XmlEnumValue("Material")
269 Material(UUID
.fromString("58499bc1-9808-4e03-861c-4325ca889515"), "Material", "MAT", MaterialOrMethod
),
272 @XmlEnumValue("Method")
273 Method(UUID
.fromString("527fc141-7fdf-43c1-9d46-20be13c2590c"), "Method", "MET", MaterialOrMethod
),
276 // //23c TODO required??
277 // @XmlEnumValue("PreservationMethod") --> Method
278 // PreservationMethod(UUID.fromString("9cadbee4-22b5-40f5-bb37-e4f5340d246e"), "Preservation method", "PRM", MaterialOrMethod),
280 // //23d TODO required?? --> Material
281 // @XmlEnumValue("PreservationMedium")
282 // PreservationMedium(UUID.fromString("c6269a06-6954-4838-a7a7-7f94ba372f3d"), "Preservation medium", "PME", MaterialOrMethod),
287 * This type represents possible modulations for the validity of
288 * information pieces ({@link DescriptionElementBase} description elements).
289 * It can cover probability ("perhaps"), frequency ("often") intensity ("very"),
290 * timing ("spring") and other domains. Its instances can be grouped to build
291 * different controlled {@link TermVocabulary term vocabularies}.
293 * This class corresponds to GeneralModifierNLDType according to
295 * This class is a generalization of {@link #Scope} and {@link #DeterminationModifier}
297 * @see DescriptionElementBase#getModifiers()
298 * @see StateData#getModifiers()
300 @XmlEnumValue("Modifier")
301 Modifier(UUID
.fromString("97c4db67-ccf5-40bf-9fb8-83fb7446a364"), "Modifier", "MO", null),
305 * The type representing restrictions for the validity of
306 * {@link TaxonDescription taxon descriptions} and others.
307 * This could include not only Stage (life stage) and Sex
308 * but also for instance particular organism parts or seasons.<BR>
309 * Scope is a specialization of {@link #Modifier} and a generalization of
310 * {@link #Sex} and {@link #Stage}
313 * @see DescriptionElementBase
314 * @see TaxonDescription
315 * @see TaxonDescription#getScopes()
317 @XmlEnumValue("Scope")
318 Scope(UUID
.fromString("8862b66e-9059-4ea4-885e-47a373357075"), "Scope", "SCO", Modifier
),
321 /** The stage type represents the restriction (scope) concerning the life stage for
322 * the applicability of {@link TaxonDescription taxon descriptions}. The life stage of a
323 * {@link SpecimenOrObservationBase specimen or observation}
324 * does not belong to a {@link SpecimenDescription specimen description} but is an attribute of
325 * the specimen itself.<BR>
327 * Stage is a specialization of {@link #Scope}.
329 @XmlEnumValue("Stage")
330 Stage(UUID
.fromString("cf411ef0-8eee-4461-99e9-c03f4f0a1656"), "Stage", "STG", Scope
),
333 /** The kind-of-unit type represents the restriction (scope) concerning the part(s) of an
334 * organism or the class of materials represented by a specimen or observation or described
335 * by a {@link DescriptionBase taxon or specimen description}.<BR>
336 * In a {@link DescriptionBase description} it can be used as a {@link #Modifier} or
337 * a {@link #Scope} and therefore it is a specialization of {@link #Scope}.<BR>
338 * The kind-of-unit of a {@link SpecimenOrObservationBase specimen or observation}
339 * should be added as an {@link SpecimenOrObservationBase#getKindOfUnit() kindOfUnit} attribute
340 * if the specimen is only a part of an organism and this part is described by the part-of-unit.
341 * If only a part of a specimen is described in a {@link SpecimenDescription specimen description}
342 * the kind-of-unit should be used as a {@link DescriptionBase description} scope
343 * (not yet implemented for specimen descriptions) or as a modifier in a
344 * {@link DescriptionElementBase description item}.<BR><BR>
346 * Value examples are: fruits, seeds, tissue, gDNA, leaves, ... <BR>
348 * KindOfUnit is a Specialization of {@link #Scope}.
350 * @see SpecimenOrObservationBase#getKindOfUnit()
351 * @see TaxonDescription#getScopes()
352 * @see DescriptionElementBase#getModifiers()
353 * @see StateData#getModifiers()
355 @XmlEnumValue("KindOfUnit")
356 KindOfUnit(UUID
.fromString("e3edf086-ff7b-4e58-ab1c-d509352fe5f4"), "Kind of Unit", "KOU", Scope
),
361 * The type represents the restriction concerning the sex for
362 * the applicability of {@link TaxonDescription taxon descriptions} or others. The sex of a
363 * {@link SpecimenOrObservationBase specimen or observation}
364 * does not belong to a {@link SpecimenDescription specimen description} but is an attribute of
365 * the specimen itself.<BR>
367 * Sex is a specialization of {@link #Scope}.
370 Sex(UUID
.fromString("4046f91f-063b-4b84-b34a-6245c2abc06f"), "Sex", "SEX", Scope
),
374 * Term type for a reference system of a geographic information.
376 * @see Point#getReferenceSystem()
378 @XmlEnumValue("ReferenceSystem")
379 ReferenceSystem(UUID
.fromString("b8cfa986-ef90-465e-9609-1dadae2a0f5b"), "Reference system", "RS", null),
383 * Term type for a term representing a state for {@link CategoricalData categorical data}
384 * @see CategoricalData#getStateData()
385 * @see StateData#getState()
387 @XmlEnumValue("State")
388 State(UUID
.fromString("5e5b8b60-7300-440a-8706-72fbf31a594f"), "State", "STA", null),
392 * Term type representing a natural language term.
394 @XmlEnumValue("NaturalLanguageTerm")
395 NaturalLanguageTerm(UUID
.fromString("9a42ac4e-c175-4633-8b31-74ba8203566a"), "Natural language term", "NLT", null),
400 * Term type for a text format.
403 @XmlEnumValue("TextFormat")
404 TextFormat(UUID
.fromString("d26cfdb4-baeb-43d0-a51b-a3428d838790"), "Text format", "TF", null),
410 * Determination modifier is a specialization of {@link #Modifier}.
412 @XmlEnumValue("DeterminationModifier")
413 DeterminationModifier(UUID
.fromString("ce910516-bc5d-4ac5-be4d-f3c14c27dd85"), "Determination modifier", "DMO", Modifier
),
417 * A marker is a region on a DNA which is addressed in an {@link Amplification amplification process}.
418 * It is very similar to a locus, a term which is often used as a synonym. However, a locus is correctly
419 * defining one concrete place on a given DNA and therefore is more specific. As this specific information
420 * is usually not available the marker information is provided instead.
421 * Sometimes marker information includes multiple markers. To handle this it was decided that for such
422 * combined markers we need to create a new "parent" marker which includes the single markers as "partOf" marker.
423 * However, this works only if you have a distinct marker hierarchy, so futuere
425 * @see Amplification#getMarker()
427 * @see Sequencing#getMarker()
429 @XmlEnumValue("DnaMarker")
430 DnaMarker(UUID
.fromString("7fdddb4f-b0ec-4ce0-bc28-dc94e30e8252"), "DNA Marker", "DMA", null),
433 @SuppressWarnings("unused")
434 private static final Logger logger
= Logger
.getLogger(TermType
.class);
436 private TermType(UUID uuid
, String defaultString
, String key
){
437 this(uuid
, defaultString
, key
, null);
440 private TermType(UUID uuid
, String defaultString
, String key
, TermType parent
){
441 delegateVocTerm
= EnumeratedTermVoc
.addTerm(getClass(), this, uuid
, defaultString
, key
, parent
);
445 // *************************** DELEGATE **************************************/
447 private static EnumeratedTermVoc
<TermType
> delegateVoc
;
448 private IEnumTerm
<TermType
> delegateVocTerm
;
451 delegateVoc
= EnumeratedTermVoc
.getVoc(TermType
.class);
455 public String
getKey(){return delegateVocTerm
.getKey();}
458 public String
getMessage(){return delegateVocTerm
.getMessage();}
461 public String
getMessage(Language language
){return delegateVocTerm
.getMessage(language
);}
464 public UUID
getUuid() {return delegateVocTerm
.getUuid();}
467 public TermType
getKindOf() {return delegateVocTerm
.getKindOf();}
470 public Set
<TermType
> getGeneralizationOf() {return delegateVocTerm
.getGeneralizationOf();}
473 public boolean isKindOf(TermType ancestor
) {return delegateVocTerm
.isKindOf(ancestor
); }
476 public Set
<TermType
> getGeneralizationOf(boolean recursive
) {return delegateVocTerm
.getGeneralizationOf(recursive
);}
478 public static TermType
getByKey(String key
){return delegateVoc
.getByKey(key
);}
479 public static TermType
getByUuid(UUID uuid
) {return delegateVoc
.getByUuid(uuid
);}
482 * Returns a defined term base object corresponding to this term type object
484 * @return a defined term base object
486 public DefinedTermBase
getEmptyDefinedTermBase() {
488 case DeterminationModifier
:
494 case PresenceAbsenceTerm
:
496 return DefinedTerm
.NewInstance(this, null, "Untitled", null);
498 return eu
.etaxonomy
.cdm
.model
.description
.Feature
.NewInstance(null, "Untitled", null);
500 return eu
.etaxonomy
.cdm
.model
.description
.State
.NewInstance(null, "Untitled", null);
502 return eu
.etaxonomy
.cdm
.model
.common
.MarkerType
.NewInstance(null, "Untitled", null);
504 return eu
.etaxonomy
.cdm
.model
.common
.ExtensionType
.NewInstance(null, "Untitled", null);
506 return eu
.etaxonomy
.cdm
.model
.location
.NamedArea
.NewInstance(null, "Untitled", null);
508 return eu
.etaxonomy
.cdm
.model
.location
.NamedAreaLevel
.NewInstance(null, "Untitled", null);
510 return eu
.etaxonomy
.cdm
.model
.location
.NamedAreaType
.NewInstance(null, "Untitled", null);