39ae5d1f6bcc96a00fb73fb8918f9ffaca8b2482
[cdmlib.git] / cdmlib-model / src / main / java / eu / etaxonomy / cdm / model / description / Feature.java
1 /**
2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
5 *
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
8 */
9
10 package eu.etaxonomy.cdm.model.description;
11
12
13 import java.util.HashSet;
14 import java.util.List;
15 import java.util.Map;
16 import java.util.Set;
17 import java.util.UUID;
18
19 import javax.persistence.Entity;
20 import javax.persistence.FetchType;
21 import javax.persistence.JoinTable;
22 import javax.persistence.ManyToMany;
23 import javax.persistence.OneToMany;
24 import javax.xml.bind.annotation.XmlAccessType;
25 import javax.xml.bind.annotation.XmlAccessorType;
26 import javax.xml.bind.annotation.XmlElement;
27 import javax.xml.bind.annotation.XmlElementWrapper;
28 import javax.xml.bind.annotation.XmlIDREF;
29 import javax.xml.bind.annotation.XmlRootElement;
30 import javax.xml.bind.annotation.XmlSchemaType;
31 import javax.xml.bind.annotation.XmlType;
32
33 import org.apache.log4j.Logger;
34 import org.hibernate.envers.Audited;
35 import org.hibernate.search.annotations.Indexed;
36
37 import eu.etaxonomy.cdm.model.common.DefinedTermBase;
38 import eu.etaxonomy.cdm.model.common.Language;
39 import eu.etaxonomy.cdm.model.common.TermVocabulary;
40 import eu.etaxonomy.cdm.model.name.BotanicalName;
41 import eu.etaxonomy.cdm.model.name.HybridRelationshipType;
42 import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
43 import eu.etaxonomy.cdm.model.name.TaxonNameBase;
44 import eu.etaxonomy.cdm.model.occurrence.Specimen;
45 import eu.etaxonomy.cdm.model.taxon.Taxon;
46
47 /**
48 * The class for individual properties (also designed as character, type or
49 * category) of observed phenomena able to be described or measured. It also
50 * covers categories of informations on {@link TaxonNameBase taxon names} not
51 * taken in account in {@link NomenclaturalCode nomenclature}.<BR>
52 * Descriptions require features in order to be structured and disaggregated
53 * in {@link DescriptionElementBase description elements}.<BR>
54 * Experts do not use the word feature for the actual description
55 * but only for the property itself. Therefore naming this class FeatureType
56 * would have leaded to confusion.
57 * <P>
58 * Since features are {@link DefinedTermBase defined terms} they have a hierarchical
59 * structure that allows to specify ("kind of") or generalize
60 * ("generalization of") features. "Kind of" / "generalization of" relations
61 * are bidirectional (a feature F1 is a "Kind of" a feature F2 if and only
62 * if the feature F2 is a "generalization of" the feature F1. This hierarchical
63 * structure has nothing in common with {@link FeatureTree feature trees} used for determination.
64 * <P>
65 * A standard set of feature instances will be automatically
66 * created as the project starts. But this class allows to extend this standard
67 * set by creating new instances of additional features if needed.<BR>
68 * <P>
69 * This class corresponds to DescriptionsSectionType according to the SDD
70 * schema.
71 *
72 * @author m.doering
73 * @version 1.0
74 * @created 08-Nov-2007 13:06:24
75 */
76 @XmlAccessorType(XmlAccessType.FIELD)
77 @XmlType(name="Feature", factoryMethod="NewInstance", propOrder = {
78 "supportsTextData",
79 "supportsQuantitativeData",
80 "supportsDistribution",
81 "supportsIndividualAssociation",
82 "supportsTaxonInteraction",
83 "supportsCommonTaxonName",
84 "recommendedModifierEnumeration",
85 "recommendedStatisticalMeasures",
86 "supportedCategoricalEnumerations"
87 })
88 @XmlRootElement(name = "Feature")
89 @Entity
90 @Indexed(index = "eu.etaxonomy.cdm.model.common.DefinedTermBase")
91 @Audited
92 public class Feature extends DefinedTermBase<Feature> {
93 private static final long serialVersionUID = 6754598791831848704L;
94 private static final Logger logger = Logger.getLogger(Feature.class);
95 private static Feature IMAGE;
96 private static Feature CULTIVATION;
97 private static Feature CONSERVATION;
98 private static Feature USES;
99 private static Feature ADDITIONAL_PUBLICATION;
100 private static Feature CITATION;
101 private static Feature OCCURRENCE;
102 private static Feature PHENOLOGY;
103 private static Feature COMMON_NAME;
104 private static Feature PROTOLOG;
105 private static Feature INTRODUCTION;
106 private static Feature DIAGNOSIS;
107 private static Feature ETYMOLOGY;
108 private static Feature MATERIALS_METHODS;
109 private static Feature MATERIALS_EXAMINED;
110 private static Feature KEY;
111 private static Feature BIOLOGY_ECOLOGY;
112 private static Feature ECOLOGY;
113 private static Feature DISCUSSION;
114 private static Feature DISTRIBUTION;
115 private static Feature DESCRIPTION;
116 private static Feature UNKNOWN;
117
118 @XmlElement(name = "SupportsTextData")
119 private boolean supportsTextData;
120
121 @XmlElement(name = "SupportsQuantitativeData")
122 private boolean supportsQuantitativeData;
123
124 @XmlElement(name = "SupportsDistribution")
125 private boolean supportsDistribution;
126
127 @XmlElement(name = "SupportsIndividualAssociation")
128 private boolean supportsIndividualAssociation;
129
130 @XmlElement(name = "SupportsTaxonInteraction")
131 private boolean supportsTaxonInteraction;
132
133 @XmlElement(name = "SupportsCategoricalData")
134 private boolean supportsCategoricalData;
135
136 /*
137 * FIXME Should this be Many-To-Many or do we expect each Feature to have its own unique modifier enums?
138 */
139 @XmlElementWrapper(name = "RecommendedModifierEnumerations")
140 @XmlElement(name = "RecommendedModifierEnumeration")
141 @XmlIDREF
142 @XmlSchemaType(name = "IDREF")
143 @OneToMany(fetch = FetchType.LAZY)
144 @JoinTable(name="DefinedTermBase_RecommendedModifierEnumeration")
145 private Set<TermVocabulary<Modifier>> recommendedModifierEnumeration = new HashSet<TermVocabulary<Modifier>>();
146
147 @XmlElementWrapper(name = "RecommendedStatisticalMeasures")
148 @XmlElement(name = "RecommendedStatisticalMeasure")
149 @XmlIDREF
150 @XmlSchemaType(name = "IDREF")
151 @ManyToMany(fetch = FetchType.LAZY)
152 @JoinTable(name="DefinedTermBase_StatisticalMeasure")
153 private Set<StatisticalMeasure> recommendedStatisticalMeasures = new HashSet<StatisticalMeasure>();
154
155 /*
156 * FIXME Should this be Many-To-Many or do we expect each Feature to have its own unique state enums?
157 */
158 @XmlElementWrapper(name = "SupportedCategoricalEnumerations")
159 @XmlElement(name = "SupportedCategoricalEnumeration")
160 @XmlIDREF
161 @XmlSchemaType(name = "IDREF")
162 @OneToMany(fetch = FetchType.LAZY)
163 @JoinTable(name="DefinedTermBase_SupportedCategoricalEnumeration")
164 private Set<TermVocabulary<State>> supportedCategoricalEnumerations = new HashSet<TermVocabulary<State>>();
165 @XmlElement(name = "SupportsCommonTaxonName")
166 private boolean supportsCommonTaxonName;
167
168 /* ***************** CONSTRUCTOR AND FACTORY METHODS **********************************/
169
170
171 /**
172 * Class constructor: creates a new empty feature instance.
173 *
174 * @see #Feature(String, String, String)
175 */
176 public Feature() {
177 super();
178 }
179
180 /**
181 * Class constructor: creates a new feature instance with a description (in the {@link Language#DEFAULT() default language}),
182 * a label and a label abbreviation.
183 *
184 * @param term the string (in the default language) describing the
185 * new feature to be created
186 * @param label the string identifying the new feature to be created
187 * @param labelAbbrev the string identifying (in abbreviated form) the
188 * new feature to be created
189 * @see #Feature()
190 */
191 protected Feature(String term, String label, String labelAbbrev) {
192 super(term, label, labelAbbrev);
193 }
194
195 /**
196 * Creates a new empty feature instance.
197 *
198 * @see #NewInstance(String, String, String)
199 */
200 public static Feature NewInstance() {
201 return new Feature();
202 }
203
204 /**
205 * Creates a new feature instance with a description (in the {@link Language#DEFAULT() default language}),
206 * a label and a label abbreviation.
207 *
208 * @param term the string (in the default language) describing the
209 * new feature to be created
210 * @param label the string identifying the new feature to be created
211 * @param labelAbbrev the string identifying (in abbreviated form) the
212 * new feature to be created
213 * @see #readCsvLine(List, Language)
214 * @see #NewInstance()
215 */
216 public static Feature NewInstance(String term, String label, String labelAbbrev){
217 return new Feature(term, label, labelAbbrev);
218 }
219
220 /* *************************************************************************************/
221
222 /**
223 * Returns the boolean value of the flag indicating whether <i>this</i>
224 * feature can be described with {@link QuantitativeData quantitative data} (true)
225 * or not (false). If this flag is set <i>this</i> feature can only apply to
226 * {@link TaxonDescription taxon descriptions} or {@link SpecimenDescription specimen descriptions}.
227 *
228 * @return the boolean value of the supportsQuantitativeData flag
229 */
230 public boolean supportsQuantitativeData() {
231 return supportsQuantitativeData;
232 }
233
234 /**
235 * @see #isSupportsQuantitativeData()
236 */
237 public void setSupportsQuantitativeData(boolean supportsQuantitativeData) {
238 this.supportsQuantitativeData = supportsQuantitativeData;
239 }
240
241 /**
242 * Returns the boolean value of the flag indicating whether <i>this</i>
243 * feature can be described with {@link TextData text data} (true)
244 * or not (false).
245 *
246 * @return the boolean value of the supportsTextData flag
247 */
248 public boolean supportsTextData() {
249 return supportsTextData;
250 }
251
252 /**
253 * @see #isSupportsTextData()
254 */
255 public void setSupportsTextData(boolean supportsTextData) {
256 this.supportsTextData = supportsTextData;
257 }
258
259 /**
260 * Returns the boolean value of the flag indicating whether <i>this</i>
261 * feature can be described with {@link Distribution distribution} objects
262 * (true) or not (false). This flag is set if and only if <i>this</i> feature
263 * is the {@link #DISTRIBUTION() distribution feature}.
264 *
265 * @return the boolean value of the supportsDistribution flag
266 */
267 public boolean supportsDistribution() {
268 return supportsDistribution;
269 }
270
271 /**
272 * @see #isSupportsDistribution()
273 */
274 public void setSupportsDistribution(boolean supportsDistribution) {
275 this.supportsDistribution = supportsDistribution;
276 }
277
278 /**
279 * Returns the boolean value of the flag indicating whether <i>this</i>
280 * feature can be described with {@link IndividualsAssociation individuals associations}
281 * (true) or not (false).
282 *
283 * @return the boolean value of the supportsIndividualAssociation flag
284 */
285 public boolean supportsIndividualAssociation() {
286 return supportsIndividualAssociation;
287 }
288
289 /**
290 * @see #isSupportsIndividualAssociation()
291 */
292 public void setSupportsIndividualAssociation(
293 boolean supportsIndividualAssociation) {
294 this.supportsIndividualAssociation = supportsIndividualAssociation;
295 }
296
297 /**
298 * Returns the boolean value of the flag indicating whether <i>this</i>
299 * feature can be described with {@link TaxonInteraction taxon interactions}
300 * (true) or not (false).
301 *
302 * @return the boolean value of the supportsTaxonInteraction flag
303 */
304 public boolean supportsTaxonInteraction() {
305 return supportsTaxonInteraction;
306 }
307
308 /**
309 * @see #isSupportsTaxonInteraction()
310 */
311 public void setSupportsTaxonInteraction(boolean supportsTaxonInteraction) {
312 this.supportsTaxonInteraction = supportsTaxonInteraction;
313 }
314
315 /**
316 * Returns the boolean value of the flag indicating whether <i>this</i>
317 * feature can be described with {@link CommonTaxonName common names}
318 * (true) or not (false). This flag is set if and only if <i>this</i> feature
319 * is the {@link #COMMON_NAME() common name feature}.
320 *
321 * @return the boolean value of the supportsCommonTaxonName flag
322 */
323 public boolean supportsCommonTaxonName() {
324 return supportsCommonTaxonName;
325 }
326
327 /**
328 * @see #isSupportsTaxonInteraction()
329 */
330 public void setSupportsCommonTaxonName(boolean supportsCommonTaxonName) {
331 this.supportsCommonTaxonName = supportsCommonTaxonName;
332 }
333
334 /**
335 * Returns the boolean value of the flag indicating whether <i>this</i>
336 * feature can be described with {@link CategoricalData categorical data}
337 * (true) or not (false).
338 *
339 * @return the boolean value of the supportsCategoricalData flag
340 */
341 public boolean supportsCategoricalData() {
342 return supportsCategoricalData;
343 }
344
345 /**
346 * @see #supportsCategoricalData()
347 */
348 public void setSupportsCategoricalData(boolean supportsCategoricalData) {
349 this.supportsCategoricalData = supportsCategoricalData;
350 }
351
352
353 /**
354 * Returns the set of {@link TermVocabulary term vocabularies} containing the
355 * {@link Modifier modifiers} recommended to be used for {@link DescriptionElementBase description elements}
356 * with <i>this</i> feature.
357 *
358 */
359 public Set<TermVocabulary<Modifier>> getRecommendedModifierEnumeration() {
360 return recommendedModifierEnumeration;
361 }
362
363 /**
364 * Adds a {@link TermVocabulary term vocabulary} (with {@link Modifier modifiers}) to the set of
365 * {@link #getRecommendedModifierEnumeration() recommended modifier vocabularies} assigned
366 * to <i>this</i> feature.
367 *
368 * @param recommendedModifierEnumeration the term vocabulary to be added
369 * @see #getRecommendedModifierEnumeration()
370 */
371 public void addRecommendedModifierEnumeration(
372 TermVocabulary<Modifier> recommendedModifierEnumeration) {
373 this.recommendedModifierEnumeration.add(recommendedModifierEnumeration);
374 }
375 /**
376 * Removes one element from the set of {@link #getRecommendedModifierEnumeration() recommended modifier vocabularies}
377 * assigned to <i>this</i> feature.
378 *
379 * @param recommendedModifierEnumeration the term vocabulary which should be removed
380 * @see #getRecommendedModifierEnumeration()
381 * @see #addRecommendedModifierEnumeration(TermVocabulary)
382 */
383 public void removeRecommendedModifierEnumeration(
384 TermVocabulary<Modifier> recommendedModifierEnumeration) {
385 this.recommendedModifierEnumeration.remove(recommendedModifierEnumeration);
386 }
387
388 /**
389 * Returns the set of {@link StatisticalMeasure statistical measures} recommended to be used
390 * in case of {@link QuantitativeData quantitative data} with <i>this</i> feature.
391 */
392 public Set<StatisticalMeasure> getRecommendedStatisticalMeasures() {
393 return recommendedStatisticalMeasures;
394 }
395
396 /**
397 * Adds a {@link StatisticalMeasure statistical measure} to the set of
398 * {@link #getRecommendedStatisticalMeasures() recommended statistical measures} assigned
399 * to <i>this</i> feature.
400 *
401 * @param recommendedStatisticalMeasure the statistical measure to be added
402 * @see #getRecommendedStatisticalMeasures()
403 */
404 public void addRecommendedStatisticalMeasure(
405 StatisticalMeasure recommendedStatisticalMeasure) {
406 this.recommendedStatisticalMeasures.add(recommendedStatisticalMeasure);
407 }
408 /**
409 * Removes one element from the set of {@link #getRecommendedStatisticalMeasures() recommended statistical measures}
410 * assigned to <i>this</i> feature.
411 *
412 * @param recommendedStatisticalMeasure the statistical measure which should be removed
413 * @see #getRecommendedStatisticalMeasures()
414 * @see #addRecommendedStatisticalMeasure(StatisticalMeasure)
415 */
416 public void removeRecommendedStatisticalMeasure(
417 StatisticalMeasure recommendedStatisticalMeasure) {
418 this.recommendedStatisticalMeasures.remove(recommendedStatisticalMeasure);
419 }
420
421 /**
422 * Returns the set of {@link TermVocabulary term vocabularies} containing the list of
423 * possible {@link State states} to be used in {@link CategoricalData categorical data}
424 * with <i>this</i> feature.
425 *
426 */
427 public Set<TermVocabulary<State>> getSupportedCategoricalEnumerations() {
428 return supportedCategoricalEnumerations;
429 }
430
431 /**
432 * Adds a {@link TermVocabulary term vocabulary} to the set of
433 * {@link #getSupportedCategoricalEnumerations() supported state vocabularies} assigned
434 * to <i>this</i> feature.
435 *
436 * @param supportedCategoricalEnumeration the term vocabulary which should be removed
437 * @see #getSupportedCategoricalEnumerations()
438 */
439 public void addSupportedCategoricalEnumeration(
440 TermVocabulary<State> supportedCategoricalEnumeration) {
441 this.supportedCategoricalEnumerations.add(supportedCategoricalEnumeration);
442 }
443 /**
444 * Removes one element from the set of {@link #getSupportedCategoricalEnumerations() supported state vocabularies}
445 * assigned to <i>this</i> feature.
446 *
447 * @param supportedCategoricalEnumeration the term vocabulary which should be removed
448 * @see #getSupportedCategoricalEnumerations()
449 * @see #addSupportedCategoricalEnumeration(TermVocabulary)
450 */
451 public void removeSupportedCategoricalEnumeration(
452 TermVocabulary<State> supportedCategoricalEnumeration) {
453 this.supportedCategoricalEnumerations.remove(supportedCategoricalEnumeration);
454 }
455
456 private static final UUID uuidUnknown = UUID.fromString("910307f1-dc3c-452c-a6dd-af5ac7cd365c");
457 private static final UUID uuidDescription = UUID.fromString("9087cdcd-8b08-4082-a1de-34c9ba9fb493");
458 private static final UUID uuidDistribution = UUID.fromString("9fc9d10c-ba50-49ee-b174-ce83fc3f80c6");
459 private static final UUID uuidEcology = UUID.fromString("aa923827-d333-4cf5-9a5f-438ae0a4746b");
460 private static final UUID uuidBiologyEcology = UUID.fromString("9832e24f-b670-43b4-ac7c-20a7261a1d8c");
461 private static final UUID uuidKey = UUID.fromString("a677f827-22b9-4205-bb37-11cb48dd9106");
462 private static final UUID uuidMaterialsExamined = UUID.fromString("7c0c7571-a864-47c1-891d-01f59000dae1");
463 private static final UUID uuidMaterialsMethods = UUID.fromString("1e87d9c3-0844-4a03-9686-773e2ccb3ab6");
464 private static final UUID uuidEtymology = UUID.fromString("dd653d48-355c-4aec-a4e7-724f6eb29f8d");
465 private static final UUID uuidDiagnosis = UUID.fromString("d43d8501-ceab-4caa-9e51-e87138528fac");
466 private static final UUID uuidProtolog = UUID.fromString("7f1fd111-fc52-49f0-9e75-d0097f576b2d");
467 private static final UUID uuidCommonName = UUID.fromString("fc810911-51f0-4a46-ab97-6562fe263ae5");
468 private static final UUID uuidPhenology = UUID.fromString("a7786d3e-7c58-4141-8416-346d4c80c4a2");
469 private static final UUID uuidOccurrence = UUID.fromString("5deff505-1a32-4817-9a74-50e6936fd630");
470 private static final UUID uuidCitation = UUID.fromString("99b2842f-9aa7-42fa-bd5f-7285311e0101");
471 private static final UUID uuidAdditionalPublication = UUID.fromString("cb2eab09-6d9d-4e43-8ad2-873f23400930");
472 private static final UUID uuidUses = UUID.fromString("e5374d39-b210-47c7-bec1-bee05b5f1cb6");
473 private static final UUID uuidConservation = UUID.fromString("4518fc20-2492-47de-b345-777d2b83c9cf");
474 private static final UUID uuidCultivation = UUID.fromString("e28965b2-a367-48c5-b954-8afc8ac2c69b");
475 private static final UUID uuidIntroduction = UUID.fromString("e75255ca-8ff4-4905-baad-f842927fe1d3");
476 private static final UUID uuidDiscussion = UUID.fromString("d3c4cbb6-0025-4322-886b-cd0156753a25");
477 private static final UUID uuidImage = UUID.fromString("84193b2c-327f-4cce-90ef-c8da18fd5bb5");
478
479
480 // private static final UUID uuidDistribution = UUID.fromString("");
481 // private static final UUID uuidDistribution = UUID.fromString("");
482 // private static final UUID uuidDistribution = UUID.fromString("");
483
484 // "86bd920d-f8c5-48b9-af1d-03f63c31de5c",,"Abstract","Abstract"
485 // "489bf358-b78a-45e2-a691-f9f3f10446ce",,"Synopsis","Synopsis"
486 // "89d3b005-9876-4923-89d9-60eb75b9583b",,"Multiple","Multiple"
487 // "555a46bc-211a-476f-a022-c472970d6f8b",,"Acknowledgments","Acknowledgments"
488
489
490 /**
491 * Creates and returns a new feature instance on the basis of a given string
492 * list (containing an UUID, an URI, a label and a description) and a given
493 * {@link Language language} to be associated with the description. Furthermore
494 * the flags concerning the supported subclasses of {@link DescriptionElementBase description elements}
495 * are set according to a particular string belonging to the given
496 * string list.<BR>
497 * This method overrides the readCsvLine method from {@link DefinedTermBase#readCsvLine(List, Language) DefinedTermBase}.
498 *
499 * @param csvLine the string list with elementary information for attributes
500 * @param lang the language in which the description has been formulated
501 * @see #NewInstance(String, String, String)
502 */
503 @Override
504 public Feature readCsvLine(Class<Feature> termClass, List<String> csvLine, Map<UUID,DefinedTermBase> terms) {
505 Feature newInstance = super.readCsvLine(termClass, csvLine, terms);
506 String text = (String)csvLine.get(4);
507 if (text != null && text.length() >= 6){
508 if ("1".equals(text.substring(0, 1))){newInstance.setSupportsTextData(true);};
509 if ("1".equals(text.substring(1, 2))){newInstance.setSupportsQuantitativeData(true);};
510 if ("1".equals(text.substring(2, 3))){newInstance.setSupportsDistribution(true);};
511 if ("1".equals(text.substring(3, 4))){newInstance.setSupportsIndividualAssociation(true);};
512 if ("1".equals(text.substring(4, 5))){newInstance.setSupportsTaxonInteraction(true);};
513 if ("1".equals(text.substring(5, 6))){newInstance.setSupportsCommonTaxonName(true);};
514 // if ("1".equals(text.substring(6, 7))){newInstance.setSupportsCategoricalData(true);};
515 }
516 return newInstance;
517 }
518
519 /**
520 * Returns the "unknown" feature. This feature allows to store values of
521 * {@link DescriptionElementBase description elements} even if it is momentarily
522 * not known what they mean.
523 */
524 public static final Feature UNKNOWN(){
525 return UNKNOWN;
526 }
527
528 /**
529 * Returns the "description" feature. This feature allows to handle global
530 * {@link DescriptionElementBase description elements} for a global {@link DescriptionBase description}.<BR>
531 * The "description" feature is the highest level feature.
532 */
533 public static final Feature DESCRIPTION(){
534 return DESCRIPTION;
535 }
536
537 /**
538 * Returns the "distribution" feature. This feature allows to handle only
539 * {@link Distribution distributions}.
540 *
541 * @see #isSupportsDistribution()
542 */
543 public static final Feature DISTRIBUTION(){
544 return DISTRIBUTION;
545 }
546
547 /**
548 * Returns the "discussion" feature. This feature can only be described
549 * with {@link TextData text data}.
550 *
551 * @see #isSupportsTextData()
552 */
553 public static final Feature DISCUSSION(){
554 return DISCUSSION;
555 }
556
557 /**
558 * Returns the "ecology" feature. This feature only applies
559 * to {@link SpecimenDescription specimen descriptions} or to {@link TaxonDescription taxon descriptions}.<BR>
560 * The "ecology" feature generalizes all other possible features concerning
561 * ecological matters.
562 */
563 public static final Feature ECOLOGY(){
564 return ECOLOGY;
565 }
566
567 /**
568 * Returns the "biology_ecology" feature. This feature only applies
569 * to {@link SpecimenDescription specimen descriptions} or to {@link TaxonDescription taxon descriptions}.<BR>
570 * The "biology_ecology" feature generalizes all possible features concerning
571 * biological aspects of ecological matters.
572 *
573 * @see #ECOLOGY()
574 */
575 public static final Feature BIOLOGY_ECOLOGY(){
576 return BIOLOGY_ECOLOGY;
577 }
578
579 /**
580 * Returns the "key" feature. This feature is the "upper" feature generalizing
581 * all features being used within an identification key.
582 */
583 public static final Feature KEY(){
584 return KEY;
585 }
586
587
588 /**
589 * Returns the "materials_examined" feature. This feature can only be described
590 * with {@link TextData text data} or eventually with {@link CategoricalData categorical data}
591 * mentioning which material has been examined in order to accomplish
592 * the description. This feature applies only to
593 * {@link SpecimenDescription specimen descriptions} or to {@link TaxonDescription taxon descriptions}.
594 */
595 public static final Feature MATERIALS_EXAMINED(){
596 return MATERIALS_EXAMINED;
597 }
598
599 /**
600 * Returns the "materials_methods" feature. This feature can only be described
601 * with {@link TextData text data} or eventually with {@link CategoricalData categorical data}
602 * mentioning which methods have been adopted to analyze the material in
603 * order to accomplish the description. This feature applies only to
604 * {@link SpecimenDescription specimen descriptions} or to {@link TaxonDescription taxon descriptions}.
605 */
606 public static final Feature MATERIALS_METHODS(){
607 return MATERIALS_METHODS;
608 }
609
610 /**
611 * Returns the "etymology" feature. This feature can only be described
612 * with {@link TextData text data} or eventually with {@link CategoricalData categorical data}
613 * giving some information about the history of the taxon name. This feature applies only to
614 * {@link TaxonNameDescription taxon name descriptions}.
615 */
616 public static final Feature ETYMOLOGY(){
617 return ETYMOLOGY;
618 }
619
620 /**
621 * Returns the "diagnosis" feature. This feature can only be described
622 * with {@link TextData text data} or eventually with {@link CategoricalData categorical data}.
623 * This feature applies only to {@link SpecimenDescription specimen descriptions} or to
624 * {@link TaxonDescription taxon descriptions}.
625 */
626 public static final Feature DIAGNOSIS(){
627 return DIAGNOSIS;
628 }
629
630
631 /**
632 * Returns the "introduction" feature. This feature can only be described
633 * with {@link TextData text data}.
634 *
635 * @see #isSupportsTextData()
636 */
637 public static final Feature INTRODUCTION(){
638 return INTRODUCTION;
639 }
640
641 /**
642 * Returns the "protologue" feature. This feature can only be described
643 * with {@link TextData text data} reproducing the content of the protologue
644 * (or some information about it) of the taxon name. This feature applies only to
645 * {@link TaxonNameDescription taxon name descriptions}.
646 *
647 * @see #isSupportsTextData()
648 */
649 public static final Feature PROTOLOG(){
650 return PROTOLOG;
651 }
652 /**
653 * Returns the "common_name" feature. This feature allows to handle only
654 * {@link CommonTaxonName common names}.
655 *
656 * @see #isSupportsCommonTaxonName()
657 */
658 public static final Feature COMMON_NAME(){
659 return COMMON_NAME;
660 }
661
662 /**
663 * Returns the "phenology" feature. This feature can only be described
664 * with {@link CategoricalData categorical data} or eventually with {@link TextData text data}
665 * containing information time about recurring natural phenomena.
666 * This feature only applies to {@link TaxonDescription taxon descriptions}.<BR>
667 * The "phenology" feature generalizes all other possible features
668 * concerning time information about particular natural phenomena
669 * (such as "first flight of butterflies").
670 */
671 public static final Feature PHENOLOGY(){
672 return PHENOLOGY;
673 }
674
675 /**
676 * Returns the "occurrence" feature.
677 */
678 public static final Feature OCCURRENCE(){
679 return OCCURRENCE;
680 }
681
682 /**
683 * Returns the "citation" feature. This feature can only be described
684 * with {@link TextData text data}.
685 *
686 * @see #isSupportsTextData()
687 */
688 public static final Feature CITATION(){
689 return CITATION;
690 }
691
692 /**
693 * Returns the "additional_publication" feature. This feature can only be
694 * described with {@link TextData text data} with information about a
695 * publication where a {@link TaxonNameBase taxon name} has also been published
696 * but which is not the {@link TaxonNameBase#getNomenclaturalReference() nomenclatural reference}.
697 * This feature applies only to {@link TaxonNameDescription taxon name descriptions}.
698 *
699 * @see #isSupportsTextData()
700 */
701 public static final Feature ADDITIONAL_PUBLICATION(){
702 return ADDITIONAL_PUBLICATION;
703 }
704
705
706 /**
707 * Returns the "uses" feature. This feature only applies
708 * to {@link TaxonDescription taxon descriptions}.<BR>
709 * The "uses" feature generalizes all other possible features concerning
710 * particular uses (for instance "industrial use of seeds").
711 */
712 public static final Feature USES(){
713 return USES;
714 }
715
716
717 /**
718 * Returns the "conservation" feature. This feature only applies
719 * to {@link SpecimenDescription specimen descriptions} and generalizes
720 * methods and conditions for the conservation of {@link Specimen specimens}.<BR>
721 */
722 public static final Feature CONSERVATION(){
723 return CONSERVATION;
724 }
725
726
727 /**
728 * Returns the "cultivation" feature.
729 */
730 public static final Feature CULTIVATION(){
731 return CULTIVATION;
732 }
733
734
735 /**
736 * Returns the "cultivation" feature.
737 */
738 public static final Feature IMAGE(){
739 return IMAGE;
740 }
741
742 /**
743 * Returns the "hybrid_parent" feature. This feature can only be used
744 * by {@link TaxonInteraction taxon interactions}.<BR>
745 * <P>
746 * Note: It must be distinguished between hybrid relationships as
747 * relevant nomenclatural relationships between {@link BotanicalName plant names}
748 * on the one side and the biological relation between two {@link Taxon taxa}
749 * as it is here the case on the other one.
750 *
751 * @see #isSupportsTaxonInteraction()
752 * @see HybridRelationshipType
753 */
754 public static final Feature HYBRID_PARENT(){
755 //TODO
756 logger.warn("HYBRID_PARENT not yet implemented");
757 return null;
758 }
759
760 @Override
761 protected void setDefaultTerms(TermVocabulary<Feature> termVocabulary) {
762 Feature.ADDITIONAL_PUBLICATION = termVocabulary.findTermByUuid(Feature.uuidAdditionalPublication);
763 Feature.BIOLOGY_ECOLOGY = termVocabulary.findTermByUuid(Feature.uuidBiologyEcology);
764 Feature.CITATION = termVocabulary.findTermByUuid(Feature.uuidCitation);
765 Feature.COMMON_NAME = termVocabulary.findTermByUuid(Feature.uuidCommonName);
766 Feature.CONSERVATION = termVocabulary.findTermByUuid(Feature.uuidConservation);
767 Feature.CULTIVATION = termVocabulary.findTermByUuid(Feature.uuidCultivation);
768 Feature.DESCRIPTION = termVocabulary.findTermByUuid(Feature.uuidDescription);
769 Feature.DIAGNOSIS = termVocabulary.findTermByUuid(Feature.uuidDiagnosis);
770 Feature.DISCUSSION = termVocabulary.findTermByUuid(Feature.uuidDiscussion);
771 Feature.DISTRIBUTION = termVocabulary.findTermByUuid(Feature.uuidDistribution);
772 Feature.ECOLOGY = termVocabulary.findTermByUuid(Feature.uuidEcology);
773 Feature.ETYMOLOGY = termVocabulary.findTermByUuid(Feature.uuidEtymology);
774 Feature.IMAGE = termVocabulary.findTermByUuid(Feature.uuidImage);
775 Feature.INTRODUCTION = termVocabulary.findTermByUuid(Feature.uuidIntroduction);
776 Feature.KEY = termVocabulary.findTermByUuid(Feature.uuidKey);
777 Feature.MATERIALS_EXAMINED = termVocabulary.findTermByUuid(Feature.uuidMaterialsExamined);
778 Feature.MATERIALS_METHODS = termVocabulary.findTermByUuid(Feature.uuidMaterialsMethods);
779 Feature.OCCURRENCE = termVocabulary.findTermByUuid(Feature.uuidOccurrence);
780 Feature.PHENOLOGY = termVocabulary.findTermByUuid(Feature.uuidPhenology);
781 Feature.PROTOLOG = termVocabulary.findTermByUuid(Feature.uuidProtolog);
782 Feature.UNKNOWN = termVocabulary.findTermByUuid(Feature.uuidUnknown);
783 Feature.USES = termVocabulary.findTermByUuid(Feature.uuidUses);
784 }
785
786
787 }