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.Set;
|
15
|
import java.util.UUID;
|
16
|
|
17
|
import javax.persistence.Entity;
|
18
|
import javax.persistence.OneToMany;
|
19
|
import javax.xml.bind.annotation.XmlType;
|
20
|
|
21
|
import org.apache.log4j.Logger;
|
22
|
|
23
|
import eu.etaxonomy.cdm.model.common.DefinedTermBase;
|
24
|
import eu.etaxonomy.cdm.model.common.TermVocabulary;
|
25
|
|
26
|
/**
|
27
|
* Individual property of observed phenomena able to be described or measured.
|
28
|
* Experts do not use the word feature for the actual description but only for
|
29
|
* the property itself. Naming this class FeatureType would create confusion.
|
30
|
* NEEDS TO BE COMPLEMENTED SPM / TDWG http://rs.tdwg.
|
31
|
* org/ontology/voc/SpeciesProfileModel
|
32
|
*
|
33
|
* @author m.doering
|
34
|
* @version 1.0
|
35
|
* @created 08-Nov-2007 13:06:24
|
36
|
*/
|
37
|
@XmlType(name="Feature", factoryMethod="NewInstance")
|
38
|
@Entity
|
39
|
public class Feature extends DefinedTermBase {
|
40
|
static Logger logger = Logger.getLogger(Feature.class);
|
41
|
|
42
|
private boolean supportsQuantitativeData;
|
43
|
private boolean supportsTextData;
|
44
|
private boolean supportsDistribution;
|
45
|
private boolean supportsIndividualAssociation;
|
46
|
private boolean supportsTaxonInteraction;
|
47
|
private boolean supportsCommonTaxonName;
|
48
|
private Set<TermVocabulary> recommendedModifierEnumeration = new HashSet<TermVocabulary>();
|
49
|
private Set<StatisticalMeasure> recommendedStatisticalMeasures = new HashSet<StatisticalMeasure>();
|
50
|
private Set<TermVocabulary> supportedCategoricalEnumerations = new HashSet<TermVocabulary>();
|
51
|
|
52
|
/* ***************** CONSTRUCTOR AND FACTORY METHODS **********************************/
|
53
|
|
54
|
|
55
|
public static Feature NewInstance() {
|
56
|
return new Feature();
|
57
|
}
|
58
|
|
59
|
public static Feature NewInstance(String term, String label, String labelAbbrev){
|
60
|
return new Feature(term, label, labelAbbrev);
|
61
|
}
|
62
|
|
63
|
/**
|
64
|
* Default Constructor
|
65
|
*/
|
66
|
public Feature() {
|
67
|
super();
|
68
|
}
|
69
|
|
70
|
protected Feature(String term, String label, String labelAbbrev) {
|
71
|
super(term, label, labelAbbrev);
|
72
|
}
|
73
|
|
74
|
/* *************************************************************************************/
|
75
|
public boolean isSupportsQuantitativeData() {
|
76
|
return supportsQuantitativeData;
|
77
|
}
|
78
|
|
79
|
public void setSupportsQuantitativeData(boolean supportsQuantitativeData) {
|
80
|
this.supportsQuantitativeData = supportsQuantitativeData;
|
81
|
}
|
82
|
|
83
|
public boolean isSupportsTextData() {
|
84
|
return supportsTextData;
|
85
|
}
|
86
|
|
87
|
public void setSupportsTextData(boolean supportsTextData) {
|
88
|
this.supportsTextData = supportsTextData;
|
89
|
}
|
90
|
|
91
|
public boolean isSupportsDistribution() {
|
92
|
return supportsDistribution;
|
93
|
}
|
94
|
|
95
|
public void setSupportsDistribution(boolean supportsDistribution) {
|
96
|
this.supportsDistribution = supportsDistribution;
|
97
|
}
|
98
|
|
99
|
public boolean isSupportsIndividualAssociation() {
|
100
|
return supportsIndividualAssociation;
|
101
|
}
|
102
|
|
103
|
public void setSupportsIndividualAssociation(
|
104
|
boolean supportsIndividualAssociation) {
|
105
|
this.supportsIndividualAssociation = supportsIndividualAssociation;
|
106
|
}
|
107
|
|
108
|
public boolean isSupportsTaxonInteraction() {
|
109
|
return supportsTaxonInteraction;
|
110
|
}
|
111
|
|
112
|
public void setSupportsTaxonInteraction(boolean supportsTaxonInteraction) {
|
113
|
this.supportsTaxonInteraction = supportsTaxonInteraction;
|
114
|
}
|
115
|
|
116
|
public boolean isSupportsCommonTaxonName() {
|
117
|
return supportsCommonTaxonName;
|
118
|
}
|
119
|
|
120
|
public void setSupportsCommonTaxonName(boolean supportsCommonTaxonName) {
|
121
|
this.supportsCommonTaxonName = supportsCommonTaxonName;
|
122
|
}
|
123
|
|
124
|
@OneToMany
|
125
|
public Set<TermVocabulary> getRecommendedModifierEnumeration() {
|
126
|
return recommendedModifierEnumeration;
|
127
|
}
|
128
|
|
129
|
protected void setRecommendedModifierEnumeration(
|
130
|
Set<TermVocabulary> recommendedModifierEnumeration) {
|
131
|
this.recommendedModifierEnumeration = recommendedModifierEnumeration;
|
132
|
}
|
133
|
|
134
|
public void addRecommendedModifierEnumeration(
|
135
|
TermVocabulary recommendedModifierEnumeration) {
|
136
|
this.recommendedModifierEnumeration.add(recommendedModifierEnumeration);
|
137
|
}
|
138
|
public void removeRecommendedModifierEnumeration(
|
139
|
TermVocabulary recommendedModifierEnumeration) {
|
140
|
this.recommendedModifierEnumeration.remove(recommendedModifierEnumeration);
|
141
|
}
|
142
|
|
143
|
@OneToMany
|
144
|
public Set<StatisticalMeasure> getRecommendedStatisticalMeasures() {
|
145
|
return recommendedStatisticalMeasures;
|
146
|
}
|
147
|
|
148
|
protected void setRecommendedStatisticalMeasures(
|
149
|
Set<StatisticalMeasure> recommendedStatisticalMeasures) {
|
150
|
this.recommendedStatisticalMeasures = recommendedStatisticalMeasures;
|
151
|
}
|
152
|
|
153
|
public void addRecommendedStatisticalMeasure(
|
154
|
StatisticalMeasure recommendedStatisticalMeasure) {
|
155
|
this.recommendedStatisticalMeasures.add(recommendedStatisticalMeasure);
|
156
|
}
|
157
|
public void removeRecommendedStatisticalMeasure(
|
158
|
StatisticalMeasure recommendedStatisticalMeasure) {
|
159
|
this.recommendedStatisticalMeasures.remove(recommendedStatisticalMeasure);
|
160
|
}
|
161
|
|
162
|
@OneToMany
|
163
|
public Set<TermVocabulary> getSupportedCategoricalEnumerations() {
|
164
|
return supportedCategoricalEnumerations;
|
165
|
}
|
166
|
|
167
|
protected void setSupportedCategoricalEnumerations(
|
168
|
Set<TermVocabulary> supportedCategoricalEnumerations) {
|
169
|
this.supportedCategoricalEnumerations = supportedCategoricalEnumerations;
|
170
|
}
|
171
|
public void addSupportedCategoricalEnumeration(
|
172
|
TermVocabulary supportedCategoricalEnumeration) {
|
173
|
this.supportedCategoricalEnumerations.add(supportedCategoricalEnumeration);
|
174
|
}
|
175
|
public void removeSupportedCategoricalEnumeration(
|
176
|
TermVocabulary supportedCategoricalEnumeration) {
|
177
|
this.supportedCategoricalEnumerations.remove(supportedCategoricalEnumeration);
|
178
|
}
|
179
|
|
180
|
|
181
|
private static final UUID uuidUnknown = UUID.fromString("910307f1-dc3c-452c-a6dd-af5ac7cd365c");
|
182
|
private static final UUID uuidDescription = UUID.fromString("9087cdcd-8b08-4082-a1de-34c9ba9fb493");
|
183
|
private static final UUID uuidDistribution = UUID.fromString("9fc9d10c-ba50-49ee-b174-ce83fc3f80c6");
|
184
|
private static final UUID uuidEcology = UUID.fromString("aa923827-d333-4cf5-9a5f-438ae0a4746b");
|
185
|
private static final UUID uuidBiologyEcology = UUID.fromString("9832e24f-b670-43b4-ac7c-20a7261a1d8c");
|
186
|
private static final UUID uuidKey = UUID.fromString("a677f827-22b9-4205-bb37-11cb48dd9106");
|
187
|
private static final UUID uuidMaterialsExamined = UUID.fromString("7c0c7571-a864-47c1-891d-01f59000dae1");
|
188
|
private static final UUID uuidMaterialsMethods = UUID.fromString("1e87d9c3-0844-4a03-9686-773e2ccb3ab6");
|
189
|
private static final UUID uuidEtymology = UUID.fromString("dd653d48-355c-4aec-a4e7-724f6eb29f8d");
|
190
|
private static final UUID uuidDiagnosis = UUID.fromString("d43d8501-ceab-4caa-9e51-e87138528fac");
|
191
|
private static final UUID uuidProtolog = UUID.fromString("7f1fd111-fc52-49f0-9e75-d0097f576b2d");
|
192
|
private static final UUID uuidCommonName = UUID.fromString("fc810911-51f0-4a46-ab97-6562fe263ae5");
|
193
|
private static final UUID uuidPhenology = UUID.fromString("a7786d3e-7c58-4141-8416-346d4c80c4a2");
|
194
|
private static final UUID uuidOccurrence = UUID.fromString("5deff505-1a32-4817-9a74-50e6936fd630");
|
195
|
private static final UUID uuidCitation = UUID.fromString("99b2842f-9aa7-42fa-bd5f-7285311e0101");
|
196
|
|
197
|
// private static final UUID uuidDistribution = UUID.fromString("");
|
198
|
// private static final UUID uuidDistribution = UUID.fromString("");
|
199
|
// private static final UUID uuidDistribution = UUID.fromString("");
|
200
|
|
201
|
// "d3c4cbb6-0025-4322-886b-cd0156753a25",,"Discussion","Discussion"
|
202
|
// "86bd920d-f8c5-48b9-af1d-03f63c31de5c",,"Abstract","Abstract"
|
203
|
// "e75255ca-8ff4-4905-baad-f842927fe1d3",,"Introduction","Introduction"
|
204
|
// "489bf358-b78a-45e2-a691-f9f3f10446ce",,"Synopsis","Synopsis"
|
205
|
// "89d3b005-9876-4923-89d9-60eb75b9583b",,"Multiple","Multiple"
|
206
|
// "555a46bc-211a-476f-a022-c472970d6f8b",,"Acknowledgments","Acknowledgments"
|
207
|
|
208
|
|
209
|
public static final Feature getByUuid(UUID uuid){
|
210
|
return (Feature)findByUuid(uuid);
|
211
|
}
|
212
|
|
213
|
public static final Feature UNKNOWN(){
|
214
|
return getByUuid(uuidUnknown);
|
215
|
}
|
216
|
|
217
|
public static final Feature DESCRIPTION(){
|
218
|
return getByUuid(uuidDescription);
|
219
|
}
|
220
|
|
221
|
public static final Feature DISTRIBUTION(){
|
222
|
return getByUuid(uuidDistribution);
|
223
|
}
|
224
|
|
225
|
public static final Feature ECOLOGY(){
|
226
|
return getByUuid(uuidEcology);
|
227
|
}
|
228
|
|
229
|
public static final Feature BIOLOGY_ECOLOGY(){
|
230
|
return getByUuid(uuidBiologyEcology);
|
231
|
}
|
232
|
|
233
|
public static final Feature KEY(){
|
234
|
return getByUuid(uuidKey);
|
235
|
}
|
236
|
|
237
|
|
238
|
public static final Feature MATERIALS_EXAMINED(){
|
239
|
return getByUuid(uuidMaterialsExamined);
|
240
|
}
|
241
|
|
242
|
public static final Feature MATERIALS_METHODS(){
|
243
|
return getByUuid(uuidMaterialsMethods);
|
244
|
}
|
245
|
|
246
|
public static final Feature ETYMOLOGY(){
|
247
|
return getByUuid(uuidEtymology);
|
248
|
}
|
249
|
|
250
|
public static final Feature DIAGNOSIS(){
|
251
|
return getByUuid(uuidDiagnosis);
|
252
|
}
|
253
|
|
254
|
public static final Feature PROTOLOG(){
|
255
|
return getByUuid(uuidProtolog);
|
256
|
}
|
257
|
public static final Feature COMMON_NAME(){
|
258
|
return getByUuid(uuidCommonName);
|
259
|
}
|
260
|
|
261
|
public static final Feature PHENOLOGY(){
|
262
|
return getByUuid(uuidPhenology);
|
263
|
}
|
264
|
|
265
|
|
266
|
public static final Feature OCCURRENCE(){
|
267
|
return getByUuid(uuidOccurrence);
|
268
|
}
|
269
|
|
270
|
public static final Feature CITATION(){
|
271
|
return getByUuid(uuidCitation);
|
272
|
}
|
273
|
|
274
|
/**
|
275
|
* special kind of OrganismInteraction
|
276
|
*/
|
277
|
public static final Feature HYBRID_PARENT(){
|
278
|
//TODO
|
279
|
logger.warn("HYBRID_PARENT not yet implemented");
|
280
|
return null;
|
281
|
}
|
282
|
|
283
|
|
284
|
}
|