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