Project

General

Profile

Download (23.9 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.commons.lang.StringUtils;
25
import org.apache.log4j.Logger;
26
import org.hibernate.envers.Audited;
27

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

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

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

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

    
84

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

    
89

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

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

    
100

    
101
//********************************** Constructor *********************************/
102

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

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

    
131

    
132

    
133
//************************** METHODS ********************************
134

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

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

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

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

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

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

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

    
238

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

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

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

    
331

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

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

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

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

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