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.reference;
|
11
|
|
12
|
import java.io.Serializable;
|
13
|
import java.util.Set;
|
14
|
import java.util.UUID;
|
15
|
|
16
|
import javax.xml.bind.annotation.XmlEnum;
|
17
|
import javax.xml.bind.annotation.XmlEnumValue;
|
18
|
|
19
|
import org.apache.log4j.Logger;
|
20
|
|
21
|
import eu.etaxonomy.cdm.model.common.Language;
|
22
|
import eu.etaxonomy.cdm.model.name.TaxonName;
|
23
|
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
|
24
|
import eu.etaxonomy.cdm.model.term.EnumeratedTermVoc;
|
25
|
import eu.etaxonomy.cdm.model.term.IEnumTerm;
|
26
|
|
27
|
|
28
|
|
29
|
/**
|
30
|
* The original source type is used to define the type of an {@link OriginalSourceBase original source}.<BR>
|
31
|
* It is used to distinguish e.g. data lineage when importing data from one database to another from e.g. content oriented
|
32
|
* sources such as the citation in a book.
|
33
|
* In future they may come further source types.
|
34
|
* @author a.mueller
|
35
|
* @since 15.05.2013
|
36
|
*/
|
37
|
@XmlEnum
|
38
|
public enum OriginalSourceType implements IEnumTerm<OriginalSourceType>, Serializable{
|
39
|
|
40
|
//0
|
41
|
/**
|
42
|
* Unknown provenance is the type to be used if no information is available about the type
|
43
|
* of activity that happened.
|
44
|
*
|
45
|
*/
|
46
|
@XmlEnumValue("Unknown")
|
47
|
Unknown(UUID.fromString("b48a443c-05f2-47ff-b885-1d3bd31118e1"), "Unknown Provenance", "UNK", null),
|
48
|
|
49
|
//1
|
50
|
/**
|
51
|
* Primary Taxonomic Source describes the sources a taxonomist uses to gather certain information.
|
52
|
* E.g. a taxonomist may have used three books/articles/other references to gather information
|
53
|
* about the distribution status of a taxon.
|
54
|
* He/she will store these references as original source of type Primary Taxonomic Source.
|
55
|
* This is a specialization of PROV-O Primary Source
|
56
|
* ({@link http://www.w3.org/TR/2013/REC-prov-o-20130430/#PrimarySource})
|
57
|
*
|
58
|
*/
|
59
|
@XmlEnumValue("Primary Taxonomic Source")
|
60
|
PrimaryTaxonomicSource(UUID.fromString("c990beb3-3bc9-4dad-bbdf-9c11683493da"), "Primary Taxonomic Source", "PTS", null),
|
61
|
|
62
|
//2
|
63
|
/**
|
64
|
* Data Lineage describes the data life cycle of electronically available data. A typical
|
65
|
* use-case for data lineage is a data import from one database to another. Sources of
|
66
|
* type data lineage will store information about the original database and the identifier
|
67
|
* and table (->namespace) used in the original database.
|
68
|
* There are multiple types of data lineage: Blackbox, Dispatcher, Aggregator
|
69
|
* ({@link http://de.wikipedia.org/wiki/Data-Lineage})
|
70
|
*/
|
71
|
@XmlEnumValue("Data Lineage")
|
72
|
Lineage(UUID.fromString("4f9fdf9a-f3b5-490c-96f0-90e050599b0e"), "Data Lineage", "DLI", null),
|
73
|
|
74
|
//3
|
75
|
/**
|
76
|
* Database Import is a specialization of {@value #Lineage}. It describes the electronic
|
77
|
* import of data from an external datasource into the given datasource. This step may
|
78
|
* include data transformations also but the primary process is the import of data.
|
79
|
*/
|
80
|
@XmlEnumValue("Database Import")
|
81
|
Import(UUID.fromString("2a3902ff-06a7-4307-b542-c743e664b8f2"), "Database Import", "DIM", Lineage),
|
82
|
|
83
|
//4
|
84
|
/**
|
85
|
* Data Transformation is a specialization of {@value #Lineage} and describes a data
|
86
|
* transformation process that happens primarily on the given dataset but may also
|
87
|
* include external data.
|
88
|
*/
|
89
|
@XmlEnumValue("Data Transformation")
|
90
|
Transformation(UUID.fromString("d59e80e5-cbb7-4658-b74d-0626bbb0da7f"), "Data Transformation", "TRA", Lineage),
|
91
|
|
92
|
|
93
|
//5
|
94
|
/**
|
95
|
* Data aggregation is a specification of {@value #Lineage} and describes the
|
96
|
* data transformation process that primarily includes data aggregation processes
|
97
|
* but may also include data imports and transformations.
|
98
|
*/
|
99
|
@XmlEnumValue("Data Aggregation")
|
100
|
Aggregation(UUID.fromString("944f2f40-5144-4c81-80d9-f61aa10507b8"), "Data Aggregation", "DAG", Lineage),
|
101
|
|
102
|
//6
|
103
|
/**
|
104
|
* Primary Media Source describes the original source for any media file.
|
105
|
* E.g. a media may be copy of figure in book. The book itself will then be the primary media source.
|
106
|
*
|
107
|
* This is a specialization of PROV-O Primary Source
|
108
|
* ({@link http://www.w3.org/TR/2013/REC-prov-o-20130430/#PrimarySource})
|
109
|
*
|
110
|
*/
|
111
|
@XmlEnumValue("Primary Media Source")
|
112
|
PrimaryMediaSource(UUID.fromString("72be3615-a6da-4728-948a-b3c5797fa4bc"), "Primary Media Source", "PMS", null),
|
113
|
|
114
|
//6
|
115
|
/**
|
116
|
* Nomenclatural reference as used for {@link TaxonName taxon names} and
|
117
|
* type designations.
|
118
|
*/
|
119
|
@XmlEnumValue("Nomenclatural Reference")
|
120
|
NomenclaturalReference(UUID.fromString("67650daf-d4aa-48da-aa41-18d2763383aa"), "Nomenclatural Reference", "NOR", null),
|
121
|
|
122
|
//7
|
123
|
/**
|
124
|
* Secundum reference as used for {@link TaxonBase taxon bases}.
|
125
|
*/
|
126
|
@XmlEnumValue("Secundum Reference")
|
127
|
SecundumReference(UUID.fromString("83a218c2-b17a-4203-adba-e4042177c998"), "Secundum Reference", "SEC", null),
|
128
|
|
129
|
//8
|
130
|
/**
|
131
|
* <code>Other</code> is the type to be used if none of the other types is applicable.
|
132
|
*/
|
133
|
@XmlEnumValue("Other")
|
134
|
Other(UUID.fromString("b7c4b7fe-0aef-428a-bb7b-9153a11bf845"), "Other", "OTH", null),
|
135
|
|
136
|
;
|
137
|
|
138
|
|
139
|
@SuppressWarnings("unused")
|
140
|
private static final Logger logger = Logger.getLogger(OriginalSourceType.class);
|
141
|
|
142
|
|
143
|
@SuppressWarnings("unchecked")
|
144
|
private OriginalSourceType(UUID uuid, String defaultString, String key, OriginalSourceType parent){
|
145
|
delegateVocTerm = EnumeratedTermVoc.addTerm(getClass(), this, uuid, defaultString, key, parent);
|
146
|
}
|
147
|
|
148
|
|
149
|
|
150
|
// *************************** DELEGATE **************************************/
|
151
|
|
152
|
private static EnumeratedTermVoc<OriginalSourceType> delegateVoc;
|
153
|
private IEnumTerm<OriginalSourceType> delegateVocTerm;
|
154
|
|
155
|
static {
|
156
|
delegateVoc = EnumeratedTermVoc.getVoc(OriginalSourceType.class);
|
157
|
}
|
158
|
|
159
|
@Override
|
160
|
public String getKey(){return delegateVocTerm.getKey();}
|
161
|
|
162
|
@Override
|
163
|
public String getLabel(){return delegateVocTerm.getLabel();}
|
164
|
|
165
|
@Override
|
166
|
public String getLabel(Language language){return delegateVocTerm.getLabel(language);}
|
167
|
|
168
|
@Override
|
169
|
public UUID getUuid() {return delegateVocTerm.getUuid();}
|
170
|
|
171
|
@Override
|
172
|
public OriginalSourceType getKindOf() {return delegateVocTerm.getKindOf();}
|
173
|
|
174
|
@Override
|
175
|
public Set<OriginalSourceType> getGeneralizationOf() {return delegateVocTerm.getGeneralizationOf();}
|
176
|
|
177
|
@Override
|
178
|
public boolean isKindOf(OriginalSourceType ancestor) {return delegateVocTerm.isKindOf(ancestor); }
|
179
|
|
180
|
@Override
|
181
|
public Set<OriginalSourceType> getGeneralizationOf(boolean recursive) {return delegateVocTerm.getGeneralizationOf(recursive);}
|
182
|
|
183
|
|
184
|
public static OriginalSourceType getByKey(String key){return delegateVoc.getByKey(key);}
|
185
|
public static OriginalSourceType getByUuid(UUID uuid) {return delegateVoc.getByUuid(uuid);}
|
186
|
|
187
|
}
|