Project

General

Profile

Download (23.8 KB) Statistics
| Branch: | Tag: | Revision:
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.name;
11

    
12

    
13
import java.util.HashMap;
14
import java.util.List;
15
import java.util.Map;
16
import java.util.UUID;
17

    
18
import javax.persistence.Entity;
19
import javax.persistence.Transient;
20
import javax.xml.bind.annotation.XmlAccessType;
21
import javax.xml.bind.annotation.XmlAccessorType;
22
import javax.xml.bind.annotation.XmlType;
23

    
24
import org.apache.log4j.Logger;
25
import org.hibernate.envers.Audited;
26

    
27
import eu.etaxonomy.cdm.model.common.RelationshipTermBase;
28
import eu.etaxonomy.cdm.model.term.DefinedTermBase;
29
import eu.etaxonomy.cdm.model.term.TermType;
30
import eu.etaxonomy.cdm.model.term.TermVocabulary;
31

    
32
/**
33
 * The class representing the categories of {@link NameRelationship taxon name relationships} between
34
 * two {@link TaxonName taxon names}. These name relationship types are
35
 * based on the concrete {@link NomenclaturalCode nomenclatural code} governing
36
 * the taxon names involved in the name relationship or on decisions taken by
37
 * the competent authorities; they do not depend on the use made of these
38
 * taxon names in a particular reference or in a particular taxonomic treatment.
39
 * Most relationships are to be understood as 'is .... of': for instance
40
 * <i>Linum radiola</i> L. is a replaced synonym of <i>Radiola linoides</i> Roth or
41
 * <i>Astragalus rhizanthus</i> Boiss. is a later homonym of
42
 * <i>Astragalus rhizanthus</i> Royle.
43
 * <P>
44
 * A standard (ordered) list of name relationship type instances will be
45
 * automatically created as the project starts. But this class allows to extend
46
 * this standard list by creating new instances of additional name relationship
47
 * types if needed.
48
 * <P>
49
 * This class corresponds partially to: <ul>
50
 * <li> TaxonRelationshipTerm and NomenclaturalNoteTypeTerm according to the TDWG ontology
51
 * <li> RelationshipType and NomenclaturalNoteType according to the TCS
52
 * </ul>
53
 *
54
 * @author m.doering
55
 * @since 08-Nov-2007 13:06:38
56
 */
57
@XmlAccessorType(XmlAccessType.FIELD)
58
@XmlType(name = "NameRelationshipType")
59
@Entity
60
//@Indexed disabled to reduce clutter in indexes, since this type is not used by any search
61
//@Indexed(index = "eu.etaxonomy.cdm.model.term.DefinedTermBase")
62
@Audited
63
public class NameRelationshipType extends RelationshipTermBase<NameRelationshipType> {
64
	private static final long serialVersionUID = 8504916205254159334L;
65

    
66
	static Logger logger = Logger.getLogger(NameRelationshipType.class);
67

    
68
	private static final UUID uuidOrthographicVariant = UUID.fromString("eeaea868-c4c1-497f-b9fe-52c9fc4aca53");
69
	private static final UUID uuidMisspelling = UUID.fromString("c6f9afcb-8287-4a2b-a6f6-4da3a073d5de");
70
	private static final UUID uuidEmendation = UUID.fromString("6e23ad45-3f2a-462b-ad87-d2389cd6e26c");
71
	private static final UUID uuidLaterHomonym = UUID.fromString("80f06f65-58e0-4209-b811-cb40ad7220a6");
72
	private static final UUID uuidTreatedAsLaterHomonym = UUID.fromString("2990a884-3302-4c8b-90b2-dfd31aaa2778");
73
	private static final UUID uuidAlternativeName = UUID.fromString("049c6358-1094-4765-9fae-c9972a0e7780");
74
	private static final UUID uuidBasionym = UUID.fromString("25792738-98de-4762-bac1-8c156faded4a");
75
	private static final UUID uuidReplacedSynonym = UUID.fromString("71c67c38-d162-445b-b0c2-7aba56106696");
76
	private static final UUID uuidConservedAgainst = UUID.fromString("e6439f95-bcac-4ebb-a8b5-69fa5ce79e6a");
77
	private static final UUID uuidValidatedByName = UUID.fromString("a176c9ad-b4c2-4c57-addd-90373f8270eb");
78
	private static final UUID uuidLaterValidatedByName = UUID.fromString("a25ee4c1-863a-4dab-9499-290bf9b89639");
79
	private static final UUID uuidBlockingNameFor = UUID.fromString("1dab357f-2e12-4511-97a4-e5153589e6a6");
80
	private static final UUID uuidLaterIsonym = UUID.fromString("29ab238d-598d-45b9-addd-003cf39ccc3e");
81
	private static final UUID uuidOriginalSpellingFor = UUID.fromString("264d2be4-e378-4168-9760-a9512ffbddc4");
82

    
83

    
84
	public static NameRelationshipType NewInstance(String term, String label, String labelAbbrev, boolean symmetric, boolean transitive) {
85
		return new NameRelationshipType(term, label, labelAbbrev, symmetric, transitive);
86
	}
87

    
88

    
89
	protected static Map<UUID, NameRelationshipType> termMap = null;
90

    
91
	protected static NameRelationshipType findTermByUuid(UUID uuid){
92
		if (termMap == null || termMap.isEmpty()){
93
		    return getTermByClassAndUUID(NameRelationshipType.class, uuid);
94
		} else {
95
		    return termMap.get(uuid);
96
		}
97
	}
98

    
99

    
100
//********************************** Constructor *********************************/
101

    
102
  	//for hibernate use only
103
  	@Deprecated
104
  	protected  NameRelationshipType() {
105
		super(TermType.NameRelationshipType);
106
	}
107

    
108
	/**
109
	 * Class constructor: creates an additional name relationship type
110
	 * instance with a description, a label, a label abbreviation and the flags
111
	 * indicating whether <i>this</i> new name relationship type is symmetric and/or
112
	 * transitive.
113
	 *
114
	 * @param	term  		 the string (in the default language) describing the
115
	 * 						 new name relationship type to be created
116
	 * @param	label  		 the string identifying the new name relationship
117
	 * 						 type to be created
118
	 * @param	labelAbbrev  the string identifying (in abbreviated form) the
119
	 * 						 new name relationship type to be created
120
	 * @param	symmetric	 the boolean indicating whether the new name
121
	 * 						 relationship type to be created is symmetric
122
	 * @param	transitive	 the boolean indicating whether the new name
123
	 * 						 relationship type to be created is transitive
124
	 * @see 				 #NameRelationshipType()
125
	 */
126
	private NameRelationshipType(String term, String label, String labelAbbrev, boolean symmetric, boolean transitive) {
127
		super(TermType.NameRelationshipType, term, label, labelAbbrev, symmetric, transitive);
128
	}
129

    
130

    
131

    
132
//************************** METHODS ********************************
133

    
134
	@Override
135
	public void resetTerms(){
136
		termMap = null;
137
	}
138

    
139
	// TODO this method should be moved to consistency proof classes
140
	/**
141
	 * Returns the boolean value indicating whether the nomenclatural status
142
	 * type of the {@link eu.etaxonomy.cdm.model.common.RelationshipBase#getRelatedFrom() first taxon name}
143
	 * involved in a name relationship with <i>this</i> name relationship type should
144
	 * be "invalid" (true) or not (false). Returns false if <i>this</i> name
145
	 * relationship status type is null.
146
	 *
147
	 * @see  #isLegitimateType()
148
	 * @see  #isIllegitimateType()
149
	 * @see  NomenclaturalStatusType#isInvalidType()
150
	 * @see  eu.etaxonomy.cdm.model.common.RelationshipBase#getRelatedFrom()
151
	 */
152
	@Transient
153
	public boolean isInvalidType(){
154
		if (this.equals(VALIDATED_BY_NAME()) ||
155
				this.equals(LATER_VALIDATED_BY_NAME())
156
			){
157
			return true;
158
		}else{
159
			return false;
160
		}
161
	}
162

    
163
	// TODO this method should be moved to consistency proof classes
164
	/**
165
	 * Returns the boolean value indicating whether the nomenclatural status
166
	 * type of the {@link eu.etaxonomy.cdm.model.common.RelationshipBase#getRelatedFrom() first taxon name}
167
	 * involved in a name relationship with <i>this</i> name relationship type should
168
	 * be "legitimate" (true) or not (false). Returns false if <i>this</i> name
169
	 * relationship status type is null.
170
	 *
171
	 * @see  #isInvalidType()
172
	 * @see  #isIllegitimateType()
173
	 * @see  NomenclaturalStatusType#isLegitimateType()
174
	 * @see  eu.etaxonomy.cdm.model.common.RelationshipBase#getRelatedFrom()
175
	 */
176
	@Transient
177
	public boolean isLegitimateType(){
178
		if (this.equals(BASIONYM()) ||
179
				this.equals(REPLACED_SYNONYM()) ||
180
				this.equals(ALTERNATIVE_NAME()) ||
181
				this.equals(CONSERVED_AGAINST())
182
			){
183
			return true;
184
		}else{
185
			return false;
186
		}
187
	}
188

    
189
	// TODO this method should be moved to consistency proof classes
190
	/**
191
	 * Returns the boolean value indicating whether the nomenclatural status
192
	 * type of the {@link eu.etaxonomy.cdm.model.common.RelationshipBase#getRelatedFrom() first taxon name}
193
	 * involved in a name relationship with <i>this</i> name relationship type should
194
	 * be "illegitimate" (true) or not (false). Returns false if <i>this</i> name
195
	 * relationship status type is null.
196
	 *
197
	 * @see  #isInvalidType()
198
	 * @see  #isLegitimateType()
199
	 * @see  NomenclaturalStatusType#isIllegitimateType()
200
	 * @see  eu.etaxonomy.cdm.model.common.RelationshipBase#getRelatedFrom()
201
	 */
202
	@Transient
203
	public boolean isIllegitimateType(){
204
		//TODO: implement isX method. Maybe as persistent class attribute?
205
		//TODO: RejectedInFavour,
206
		if (this.equals(LATER_HOMONYM()) ||
207
				this.equals(TREATED_AS_LATER_HOMONYM())
208
			){
209
			return true;
210
		}else{
211
			return false;
212
		}
213
	}
214

    
215
	/**
216
	 * @param type
217
	 * @return
218
	 */
219
	@Transient
220
	protected boolean isRelationshipType(NameRelationshipType type) {
221
	    if (type == null){
222
	        throw new IllegalStateException("NameRelationships have not been initialized yet. Please initialize DefinedTerms first");
223
	    }
224
	    return this.equals(type);
225
	}
226

    
227
	@Transient
228
	public boolean isBasionymRelation(){
229
        return isRelationshipType(BASIONYM());
230
	}
231

    
232
	@Transient
233
	public boolean isReplacedSynonymRelation(){
234
        return isRelationshipType(REPLACED_SYNONYM());
235
	}
236

    
237

    
238
	/**
239
	 * Returns the "orthographic variant" name relationship type. The first
240
	 * {@link TaxonName taxon name} involved in such a relationship is an
241
	 * orthographic variant of the second taxon name. The two {@link TaxonName taxon names}
242
	 * involved in such a relationship must have the same {@link NonViralName#getAuthorshipCache() authorship}
243
	 * and {@link Rank rank}, belong to the same {@link HomotypicalGroup homotypical group} and their name parts
244
	 * must be almost identical (so one usually does not differentiate them).<BR>
245
	 * For instance <i>Angelica silvestris</i> L. is an orthographic variant of
246
	 * <i>Angelica sylvestris</i> L.<BR>
247
	 * This type is symmetric and transitive but usually orthographic variant relationships should be organized
248
	 * in a star schema with the correct variant in the middle and other variants pointing to it.
249
	 * @see #ORIGINAL_SPELLING()()
250
	 */
251
	public static final NameRelationshipType ORTHOGRAPHIC_VARIANT(){
252
		  return findTermByUuid(uuidOrthographicVariant);
253
	}
254

    
255
	/**
256
	 * Returns the {@link TaxonName taxon name} as it is spelled in the original
257
	 * publication of the given name. The first (left) name in the relationship takes the role
258
	 * of the original spelling whereas the second (right) name takes the role of the
259
	 * current/correct spelling.<BR>
260
	 * Original spelling is a specialization of {@link #ORTHOGRAPHIC_VARIANT()}.
261
	 * <BR>
262
	 * @see #ORTHOGRAPHIC_VARIANT()
263
	 * @see #MISSPELLING()
264
	 */
265
	public static final NameRelationshipType ORIGINAL_SPELLING(){
266
		return findTermByUuid(uuidOriginalSpellingFor);
267
	}
268

    
269
	/**
270
	 * Returns the "misspelling" name relationship type. The first
271
	 * {@link TaxonName taxon name} involved in such a relationship is a
272
	 * misspelling of the second taxon name. The two {@link TaxonName taxon names}
273
	 * involved in such a relationship must have the same {@link NonViralName#getAuthorshipCache() authorship}
274
	 * and {@link Rank rank}, belong to the same {@link HomotypicalGroup homotypical group} and their name parts
275
	 * must be almost identical (so one usually does not differentiate them).<BR>
276
	 * For instance <i>Anhelica silvestris</i> L. is a misspelling of
277
	 * <i>Angelica silvestris</i> L.<BR>
278
	 * A misspelling is always accicentally (not on purpose). Therefore misspellings are a
279
	 * subset of {@link #ORTHOGRAPHIC_VARIANT orthographic variants} and are complementary to
280
	 * emendations. A misspelling is always an {@link #ORTHOGRAPHIC_VARIANT orthographic variant}, too.
281
	 * This type is symmetric and transitive but usually the misspelling relationships should be organized
282
	 * in a star schema with the correct variant in the middle and the misspellings pointing to it.
283
	 * @see #ORTHOGRAPHIC_VARIANT()
284
	 * @see #ORIGINAL_SPELLING()
285
	 */
286
	public static final NameRelationshipType MISSPELLING(){
287
		  return findTermByUuid(uuidMisspelling);
288
	}
289
	/**
290
	 * Returns the "emendation" name relationship type. The first
291
	 * {@link TaxonName taxon name} involved in such a relationship is a
292
	 * misspelling of the second taxon name. The two {@link TaxonName taxon names}
293
	 * involved in such a relationship must have the same {@link NonViralName#getAuthorshipCache() authorship}
294
	 * and {@link Rank rank}, belong to the same {@link HomotypicalGroup homotypical group} and their name parts
295
	 * must be almost identical (so one usually does not differentiate them).<BR>
296
	 * For instance <i>Angelica silvestris</i> L. is a emendation of
297
	 * <i>Angelica sylvestris</i> L.<BR>
298
	 * The name corrected by an emendation has originally been used on purpose (not accidentially)
299
	 * Therefore emendations are a subset of {@link #ORTHOGRAPHIC_VARIANT orthographic variants} and are
300
	 * complementary to {@link #MISSPELLING missepllings}. An emendation is always an
301
	 * {@link #ORTHOGRAPHIC_VARIANT orthographic variant}, too.<BR>
302
	 * This type is symmetric and transitive but usually the misspelling relationships should be organized
303
	 * in a star schema with the correct variant in the middle and the misspellings pointing to it.
304
	 */
305
	public static final NameRelationshipType EMENDATION(){
306
		  return findTermByUuid(uuidEmendation);
307
	}
308
	/**
309
	 * Returns the "later homonym" name relationship type. The first
310
	 * {@link TaxonName taxon name} involved in such a relationship should
311
	 * have been published after the second taxon name. The two {@link TaxonName taxon names}
312
	 * involved in such a relationship must belong to different
313
	 * {@link HomotypicalGroup homotypical groups}, have in general different
314
	 * {@link NonViralName#getAuthorshipCache() authorship} and their name parts (excluding infraspecific
315
	 * {@link Rank ranks}) must be (almost) identical, so one could be mistaken for
316
	 * the other one. The first taxon name is "illegitimate" and the second one
317
	 * is "legitimate" (this corresponds to "invalid" and "valid" in case of
318
	 * {@link IZoologicalName zoological names}).<BR>
319
	 * For instance <i>Astragalus rhizanthus</i> Boiss. is a later homonym of
320
	 * <i>Astragalus rhizanthus</i> Royle.<BR>
321
	 * This type is not symmetric but transitive.
322
	 *
323
	 * @see	NomenclaturalStatusType#isIllegitimateType()
324
	 * @see	NomenclaturalStatusType#isLegitimateType()
325
	 */
326
	public static final NameRelationshipType LATER_HOMONYM(){
327
	  return findTermByUuid(uuidLaterHomonym);
328
	}
329

    
330

    
331
	/**
332
	 * Returns the "treated as later homonym" name relationship type. The first
333
	 * {@link TaxonName taxon name} involved in such a relationship is
334
	 * treated as an homonym although it has been published before the second
335
	 * taxon name. The two taxon names involved must belong to different
336
	 * {@link HomotypicalGroup homotypical groups} and their name parts (excluding
337
	 * {@link Rank#isInfraSpecific() infraspecific ranks} and {@link NonViralName#getAuthorshipCache() authorship}) must be
338
	 * almost identical (so one could be mistaken for the other). The first
339
	 * taxon name is "illegitimate" and the second one is "legitimate" (this
340
	 * corresponds to "invalid" and "valid" in case of {@link IZoologicalName zoological names}).<BR>
341
	 * This type is not symmetric but transitive.
342
	 *
343
	 * @see	#LATER_HOMONYM()
344
	 * @see	NomenclaturalStatusType#isIllegitimateType()
345
	 * @see	NomenclaturalStatusType#isLegitimateType()
346
	 */
347
	public static final NameRelationshipType TREATED_AS_LATER_HOMONYM(){
348
	  return findTermByUuid(uuidTreatedAsLaterHomonym);
349
	}
350

    
351
	/**
352
	 * Returns the "later isonym" name relationship type where the first
353
	 * {@link TaxonName taxon name} involved has been published after the second taxon name.<BR>
354
	 * In contrast to the {@link #LATER_HOMONYM() later homonym} relationship the two
355
	 * {@link TaxonName taxon names} involved have the type(s) so they belong to the
356
	 * same {@link HomotypicalGroup homotypical groups}. As later homonyms they have in general
357
	 * different {@link NonViralName#getAuthorshipCache() authorship} and their name parts
358
	 * must be (almost) identical, so one could be mistaken for the other one.<BR>
359
	 * Later isonyms are validly published names but with a wrong citation. So there are rather errors
360
	 * then independent names.<BR>
361
	 * Isonyms are handled in Article 6, Note 2 of the ICNAFP (Melbourne Code):
362
	 * <code>When the same name, based on the same type, has been published independently at different
363
	 *  times perhaps by different authors, then only the earliest of these �isonyms� has
364
	 *  nomenclatural status. The name is always to be cited from its original
365
	 *  place of valid publication, and later isonyms may be disregarded (but see Art. 14.15).</code>
366
	 * <BR><BR>
367
	 * See discussion at: <a href=http://dev.e-taxonomy.eu/trac/ticket/2901>#2901</a>
368
	 *
369
	 */
370
	public static final NameRelationshipType LATER_ISONYM(){
371
		return findTermByUuid(uuidLaterIsonym);
372
	}
373

    
374
	/**
375
	 * Returns the "alternative name" name relationship type. Both {@link TaxonName taxon names}
376
	 * involved in such a relationship are family names. The first one is a
377
	 * classical name long in use, in some cases, even before 1753 and is considered as
378
	 * {@link NomenclaturalStatusType#VALID() valid} and also {@link NomenclaturalStatusType#isLegitimateType() legitimate}
379
	 * although it does not follow the rules for family names (see Article 18 of
380
	 * the ICBN). An alternative name is typified by the type of the name
381
	 * it is alternative to (so both must belong to the same
382
	 * {@link HomotypicalGroup homotypical group}).<BR>
383
	 * For instance <i>Cruciferae</i> Adans is an alternative name to
384
	 * <i>Brassicaceae</i> Lindl.<BR>
385
	 * This type is neither symmetric nor transitive.
386
	 */
387
	public static final NameRelationshipType ALTERNATIVE_NAME(){
388
	  return findTermByUuid(uuidAlternativeName);
389
	}
390
	/**
391
	 * Returns the "basionym" name relationship type. The first {@link TaxonName taxon name}
392
	 * involved in such a relationship is the "basionym" of the second taxon
393
	 * name. Both taxon names belong to the same {@link HomotypicalGroup homotypical group}).
394
	 * The basionym is the epithet-bringing taxon name (first taxon name
395
	 * ever validly published given to the same {@link Rank#isInfraGeneric() infrageneric}
396
	 * taxon, the epithet of which is the same as in the second taxon name
397
	 * originated through a reclassification).<BR>
398
	 * According to the ICBN the author of the basionym must be mentioned in the
399
	 * later taxon name (by placing it in parentheses before the authority of
400
	 * the new combination). For instance <i>Pinus abies</i> L. is the basionym of
401
	 * <i>Picea abies</i> (L.) H. Karst.<BR>
402
	 * This type is neither symmetric nor transitive.
403
	 */
404
	public static final NameRelationshipType BASIONYM(){
405
	  return findTermByUuid(uuidBasionym);
406
	}
407
	/**
408
	 * Returns the "replaced synonym" name relationship type. The first
409
	 * {@link TaxonName taxon name} involved in such a relationship is the
410
	 * "replaced synonym" of the second taxon name. Both taxon names belong to
411
	 * the same {@link HomotypicalGroup homotypical group}. The replaced synonym is the
412
	 * first taxon name ever validly published given to the same
413
	 * {@link Rank#isInfraGeneric() infrageneric} taxon that is either itself a
414
	 * "later homonym" or the epithet of which could not be used in the new
415
	 * taxon name originated through a reclassification. A new epithet must be
416
	 * proposed if the use of the original epithet leads to an already existing
417
	 * taxon name (for another taxon) or in botany to autonyms (since the ICBN
418
	 * does not allow such names where epithet and genus name are the same).<BR>
419
	 * For instance <i>Spartium biflorum</i> Desf. is the replaced synonym of
420
	 * of <i>Cytisus fontanesii</i> Spach ("novum" taxon name) because at the time
421
	 * of reclassification a taxon name <i>Cytisus biflorum</i> had been already
422
	 * published by L'H�r.<BR>
423
	 * This type is neither symmetric nor transitive.
424
	 *
425
	 * @see #BASIONYM()
426
	 * @see #LATER_HOMONYM()
427
	 * @see NomenclaturalStatusType#NOVUM()
428
	 */
429
	public static final NameRelationshipType REPLACED_SYNONYM(){
430
	  return findTermByUuid(uuidReplacedSynonym);
431
	}
432
	/**
433
	 * Returns the "conserved against" name relationship type. Both {@link TaxonName taxon names}
434
	 * involved in such a relationship belong to the same {@link HomotypicalGroup homotypical group}.
435
	 * Competent authorities decided, regardless of the general
436
	 * nomenclatural rules, to handle the first one as the "legitimate"
437
	 * one and the second taxon name as "illegitimate" (this corresponds to
438
	 * "valid" and "invalid" in case of {@link IZoologicalName zoological names}).<BR>
439
	 * For instance <i>Cephaloziella</i> (Spruce) Schiffn. is conserved against
440
	 * <i>Dichiton</i> Mont.<BR>
441
	 * This type is neither symmetric nor transitive.
442
	 *
443
	 * @see NomenclaturalStatusType#CONSERVED()
444
	 * @see NomenclaturalStatusType#REJECTED()
445
	 * @see NomenclaturalStatusType#isLegitimateType()
446
	 * @see NomenclaturalStatusType#isIllegitimateType()
447
	 */
448
	public static final NameRelationshipType CONSERVED_AGAINST(){
449
	  return findTermByUuid(uuidConservedAgainst);
450
	}
451
	/**
452
	 * Returns the "validated by name" name relationship type. The two
453
	 * {@link TaxonName taxon names} involved in such a relationship were published
454
	 * in order to define the same taxonomical group but the first
455
	 * (earlier) taxon name was invalidly published whereas the second (later)
456
	 * taxon name is the one which was validly published for the first time.<BR>
457
	 * This type is neither symmetric nor transitive.
458
	 *
459
	 * @see		NomenclaturalStatusType#isInvalidType()
460
	 * @see		NomenclaturalStatusType#VALID()
461
	 */
462
	public static final NameRelationshipType VALIDATED_BY_NAME(){
463
	  return findTermByUuid(uuidValidatedByName);
464
	}
465
	/**
466
	 * Returns the "later validated by name" name relationship type. The two
467
	 * {@link TaxonName taxon names} involved in such a relationship were published
468
	 * in order to define the same taxonomical group but the first
469
	 * (earlier) taxon name was invalidly published whereas the second (later)
470
	 * taxon name is the one which was validly published for the first time.<BR>
471
	 * This type is neither symmetric nor transitive.
472
	 *
473
	 * @see		NomenclaturalStatusType#isInvalidType()
474
	 * @see		NomenclaturalStatusType#VALID()
475
	 */
476
	public static final NameRelationshipType LATER_VALIDATED_BY_NAME(){
477
	  return findTermByUuid(uuidLaterValidatedByName);
478
	}
479
	/**
480
	 * Returns the "blocking name" name relationship type. The first
481
	 * {@link TaxonName taxon name} involved in such a relationship is the
482
	 * "blocking name" for the second taxon name. Both taxon names belong to
483
	 * different {@link HomotypicalGroup homotypical groups}). The blocking taxon name is the
484
	 * {@link Rank#isInfraGeneric() infrageneric} taxon name, already published at the time of
485
	 * reclassification, which makes illegitim (because of homonymy) the use of
486
	 * the epithet in the second taxon name originated through a reclassification.
487
	 * Therefore a "replaced synonym" name relationship arises.<BR>
488
	 * For instance  <i>Cytisus biflorum</i> L'H�r. is the blocking name for
489
	 * <i>Cytisus fontanesii</i> Spach ("novum" taxon name) when reclassifying
490
	 * <i>Spartium biflorum</i> Desf. from <i>Spartium</i> to <i>Cytisus</i>.<BR>
491
	 * This type is neither symmetric nor transitive.
492
	 *
493
	 * @see #REPLACED_SYNONYM()
494
	 * @see #LATER_HOMONYM()
495
	 * @see NomenclaturalStatusType#NOVUM()
496
	 */
497
	public static final NameRelationshipType BLOCKING_NAME_FOR(){
498
	  return  findTermByUuid(uuidBlockingNameFor);
499
	}
500

    
501
	@Override
502
	protected void setDefaultTerms(TermVocabulary<NameRelationshipType> termVocabulary) {
503
		termMap = new HashMap<UUID, NameRelationshipType>();
504
		for (NameRelationshipType term : termVocabulary.getTerms()){
505
			termMap.put(term.getUuid(), term);
506
		}
507
	}
508

    
509
	@Override
510
	public NameRelationshipType readCsvLine(Class<NameRelationshipType> termClass, List<String> csvLine, TermType termType,
511
	        Map<UUID,DefinedTermBase> terms, boolean abbrevAsId) {
512
		NameRelationshipType result = super.readCsvLine(termClass, csvLine, termType, terms, abbrevAsId);
513
		String kindOfString = csvLine.get(10).trim();
514
		if (isNotBlank(kindOfString)){
515
			UUID uuidKindOf = UUID.fromString(kindOfString);
516
			DefinedTermBase<?> kindOf = terms.get(uuidKindOf);
517
			result.setKindOf((NameRelationshipType)kindOf);
518
		}
519
		return result;
520
	}
521
}
(18-18/40)