Class: TaxonName

Inherits:
ActiveRecord::Base
  • Object
show all
Includes:
Housekeeping, Shared::Citable, Shared::Identifiable, SoftValidation
Defined in:
app/models/taxon_name.rb

Direct Known Subclasses

Combination, Protonym

Instance Method Summary collapse

Methods included from SoftValidation

#clear_soft_validations, #fix_soft_validations, #soft_fixed?, #soft_valid?, #soft_validate, #soft_validated?, #soft_validations

Methods included from Housekeeping

#has_polymorphic_relationship?

Instance Method Details

#all_generic_placementsObject

array of genera where the species was placed



254
255
256
257
258
259
260
# File 'app/models/taxon_name.rb', line 254

def all_generic_placements #array of genera where the species was placed
  valid_name = self.get_valid_taxon_name
  return nil unless valid_name.rank_class.to_s !=~ /Species/
  descendants_and_self = valid_name.descendants + [self]
  relationships = TaxonNameRelationship.where_object_in_taxon_names(descendants_and_self).with_two_type_bases('TaxonNameRelationship::OriginalCombination::OriginalGenus', 'TaxonNameRelationship::Combination::Genus')
  relationships.collect{|r| r.subject_taxon_name.name} + [self.ancestor_at_rank('genus').name]
end

#all_taxon_name_relationshipsObject



86
87
88
89
90
91
92
# File 'app/models/taxon_name.rb', line 86

def all_taxon_name_relationships
  # (self.taxon_name_relationships & self.related_taxon_name_relationships)

  # !! If self relatinships are every made possiblepossible this needs a DISTINCT clause
  TaxonNameRelationship.find_by_sql("SELECT taxon_name_relationships.* FROM taxon_name_relationships WHERE taxon_name_relationships.subject_taxon_name_id = #{self.id} UNION
                       SELECT taxon_name_relationships.* FROM taxon_name_relationships WHERE taxon_name_relationships.object_taxon_name_id = #{self.id}")
end

#ancestor_at_rank(rank) ⇒ Object



159
160
161
# File 'app/models/taxon_name.rb', line 159

def ancestor_at_rank(rank)
 TaxonName.ancestors_of(self).with_rank_class( Ranks.lookup(self.rank_class.nomenclatural_code, rank)).first
end

#cached_name_and_author_yearObject



151
152
153
154
155
156
157
# File 'app/models/taxon_name.rb', line 151

def cached_name_and_author_year
  if self.rank_class.to_s =~ /::(Species|Genus)/
    (self.cached_name.to_s + ' ' + self.cached_author_year.to_s).squish!
  else
    (self.name.to_s + ' ' + self.cached_author_year.to_s).squish!
  end
end

#gender_classObject



131
132
133
134
# File 'app/models/taxon_name.rb', line 131

def gender_class
  c = TaxonNameClassification.where_taxon_name(self).with_type_base('TaxonNameClassification::Latinized::Gender').first
  c.nil? ? nil : c.type_class
end

#gender_nameObject



136
137
138
139
# File 'app/models/taxon_name.rb', line 136

def gender_name
  c = self.gender_class
  c.nil? ? nil : c.class_name
end

#get_author_and_yearObject



505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
# File 'app/models/taxon_name.rb', line 505

def get_author_and_year
  if self.rank.nil?
    ay = ([self.verbatim_author] + [self.year_of_publication]).compact.join(', ')
  else
    rank = Object.const_get(self.rank_class.to_s)
    if rank.nomenclatural_code == :iczn
      misapplication = TaxonNameRelationship.where_subject_is_taxon_name(self).
          with_type_string('TaxonNameRelationship::Iczn::Invalidating::Usage::Misapplication')
      ay = ([self.verbatim_author] + [self.year_of_publication]).compact.join(', ')
      obj = misapplication.empty? ? nil : misapplication.first.object_taxon_name
      unless (misapplication.empty? || obj.verbatim_author.blank?)
        ay += ' nec ' + ([obj.verbatim_author] + [obj.year_of_publication]).compact.join(', ')
      end
      if NomenclaturalRank::Iczn::SpeciesGroup.ancestors.include?(self.rank_class)
        if self.original_combination_genus.name != self.ancestor_at_rank('genus').name and !self.original_combination_genus.name.to_s.empty?
          ay = '(' + ay + ')' unless ay.empty?
        end
      end
    elsif rank.nomenclatural_code == :icn
      t = [self.verbatim_author]
      t += ['(' + self.year_of_publication.to_s + ')'] unless self.year_of_publication.nil?
      ay = t.compact.join(' ')
    else
      ay = ([self.verbatim_author] + [self.year_of_publication]).compact.join(' ')
    end
  end
  ay
end

#get_cached_misspellingObject



338
339
340
341
# File 'app/models/taxon_name.rb', line 338

def get_cached_misspelling
  misspelling = TaxonName.as_subject_with_taxon_name_relationship_containing('::Usage::Misspelling')
  misspelling.empty? ? nil : true
end

#get_classified_asObject



539
540
541
542
543
544
545
546
547
548
549
# File 'app/models/taxon_name.rb', line 539

def get_classified_as
  unless self.class == Combination || self.class == Protonym
    return nil
  end
  c = self.source_classified_as
  if c.nil?
    nil
  else
    ' (as ' + c.name + ')'
  end
end

#get_combinationObject



436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
# File 'app/models/taxon_name.rb', line 436

def get_combination
  unless self.class == Combination
    cached_name = nil
  else
    relationships = self.combination_relationships
    relationships.sort!{|r| r.type_class.order_index}
    genus = ''
    subgenus = ''
    superspecies = ''
    species = ''
    gender = nil
    relationships.each do |i|
      case i.type_class.object_relationship_name
        when 'genus'
          genus = '<em>' + i.subject_taxon_name.name_with_misspelling(nil) + '</em> '
          gender = i.subject_taxon_name.gender_name
        when 'subgenus' then subgenus += '<em>' + i.subject_taxon_name.name_with_misspelling(nil) + '</em> '
        when 'section' then subgenus += 'sect. <em>' + i.subject_taxon_name.name_with_misspelling(nil) + '</em> '
        when 'subsection' then subgenus += 'subsect. <em>' + i.subject_taxon_name.name_with_misspelling(nil) + '</em> '
        when 'series' then subgenus += 'ser. <em>' + i.subject_taxon_name.name_with_misspelling(nil) + '</em> '
        when 'subseries' then subgenus += 'subser. <em>' + i.subject_taxon_name.name_with_misspelling(nil) + '</em> '
        when 'species' then species += '<em>' + i.subject_taxon_name.name_with_misspelling(gender) + '</em> '
        when 'subspecies' then species += '<em>' + i.subject_taxon_name.name_with_misspelling(gender) + '</em> '
        when 'variety' then species += 'var. <em>' + i.subject_taxon_name.name_with_misspelling(gender) + '</em> '
        when 'subvariety' then species += 'subvar. <em>' + i.subject_taxon_name.name_with_misspelling(gender) + '</em> '
        when 'form' then species += 'f. <em>' + i.subject_taxon_name.name_with_misspelling(gender) + '</em> '
        when 'subform' then species += 'subf. <em>' + i.subject_taxon_name.name_with_misspelling(gender) + '</em> '
        else
      end
    end

#      parent_rank = self.parent.rank_class.to_s
#      if parent_rank =~ /Genus/
#        if genus.blank?
#          genus += '<em>' + self.parent.name_with_misspelling(nil) + '</em> '
#        else
#          subgenus += '<em>' + self.parent.name_with_misspelling(nil) + '</em> '
#        end
#      elsif parent_rank =~ /Species/
#        species += '<em>' + self.parent.name_with_misspelling(nil) + '</em> '
#      end
    subgenus = '(' + subgenus.squish + ') ' unless subgenus.empty?
    cached_name = (genus + subgenus + superspecies + species).squish.gsub('</em> <em>', ' ')
    cached_name.blank? ? nil : cached_name
  end
end

#get_full_nameObject



343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
# File 'app/models/taxon_name.rb', line 343

def get_full_name
  # see config/initializers/ranks for GENUS_AND_SPECIES_RANKS
  unless GENUS_AND_SPECIES_RANK_NAMES.include?(self.rank_class.to_s)
    cached_name = nil
  else
    genus = ''
    subgenus = ''
    superspecies = ''
    species = ''
    gender = nil
    (self.ancestors + [self]).each do |i|
      if GENUS_AND_SPECIES_RANK_NAMES.include?(i.rank_class.to_s)
        case i.rank_class.rank_name
          when 'genus'
            genus = '<em>' + i.name + '</em> '
            gender = i.gender_name
          when 'subgenus' then subgenus += '<em>' + i.name + '</em> '
          when 'section' then subgenus += 'sect. <em>' + i.name + '</em> '
          when 'subsection' then subgenus += 'subsect. <em>' + i.name + '</em> '
          when 'series' then subgenus += 'ser. <em>' + i.name + '</em> '
          when 'subseries' then subgenus += 'subser. <em>' + i.name + '</em> '
          when 'species group' then superspecies += '<em>' + i.name_in_gender(gender) + '</em> '
          when 'species' then species += '<em>' + i.name_in_gender(gender) + '</em> '
          when 'subspecies' then species += '<em>' + i.name_in_gender(gender) + '</em> '
          when 'variety' then species += 'var. <em>' + i.name_in_gender(gender) + '</em> '
          when 'subvariety' then species += 'subvar. <em>' + i.name_in_gender(gender) + '</em> '
          when 'form' then species += 'f. <em>' + i.name_in_gender(gender) + '</em> '
          when 'subform' then species += 'subf. <em>' + i.name_in_gender(gender) + '</em> '
          else
        end
      end
    end
    subgenus = '(' + subgenus.squish + ') ' unless subgenus.empty?
    superspecies = '(' + superspecies.squish + ') ' unless superspecies.empty?
    cached_name = (genus + subgenus + superspecies + species).squish.gsub('</em> <em>', ' ')
    cached_name.blank? ? nil : cached_name
  end
end

#get_genus_species(genus_option, self_option) ⇒ Object



483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
# File 'app/models/taxon_name.rb', line 483

def get_genus_species(genus_option, self_option)
  genus = nil
  name1 = nil
  if self.rank_class.nil?
    return nil
  elsif genus_option == :original
    genus = self.original_genus
  elsif genus_option == :curent
    genus = self.ancestor_at_rank('genus')
  end
  genus = genus.name unless genus.blank?

  if self.rank_class.to_s =~ /Species/ && genus.blank?
    return nil
  elsif self_option == :self
    name1 = self.name
  elsif self_option == :alternative
    name1 = self.name_with_alternative_spelling
  end
  (genus.to_s + ' ' + name1.to_s).squish
end

#get_higher_classificationObject



534
535
536
537
# File 'app/models/taxon_name.rb', line 534

def get_higher_classification
  # see config/initializers/ranks for FAMILY_AND_ABOVE_RANKS
  (self.ancestors + [self]).select{|i| FAMILY_AND_ABOVE_RANK_NAMES.include?(i.rank_class.to_s)}.collect{|i| i.name}.join(':')
end

#get_original_combinationObject



392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
# File 'app/models/taxon_name.rb', line 392

def get_original_combination
  unless GENUS_AND_SPECIES_RANK_NAMES.include?(self.rank_class.to_s) && self.class == Protonym
    cached_name = nil
  else
    relationships = self.original_combination_relationships
    relationships.sort!{|r| r.type_class.order_index}
    genus = ''
    subgenus = ''
    superspecies = ''
    species = ''
    gender = nil
    relationships.each do |i|
      case i.type_class.object_relationship_name
        when 'original genus'
          genus = '<em>' + i.subject_taxon_name.name_with_misspelling(nil) + '</em> '
          gender = i.subject_taxon_name.gender_name
        when 'original subgenus' then subgenus += '<em>' + i.subject_taxon_name.name_with_misspelling(nil)  + '</em> '
        when 'original section' then subgenus += 'sect. <em>' + i.subject_taxon_name.name_with_misspelling(nil)  + '</em> '
        when 'original subsection' then subgenus += 'subsect. <em>' + i.subject_taxon_name.name_with_misspelling(nil)  + '</em> '
        when 'original series' then subgenus += 'ser. <em>' + i.subject_taxon_name.name_with_misspelling(nil)  + '</em> '
        when 'original subseries' then subgenus += 'subser. <em>' + i.subject_taxon_name.name_with_misspelling(nil)  + '</em> '
        when 'original species' then species += '<em>' + i.subject_taxon_name.name_with_misspelling(gender)  + '</em> '
        when 'original subspecies' then species += '<em>' + i.subject_taxon_name.name_with_misspelling(gender)  + '</em> '
        when 'original variety' then species += 'var. <em>' + i.subject_taxon_name.name_with_misspelling(gender)  + '</em> '
        when 'original subvariety' then species += 'subvar. <em>' + i.subject_taxon_name.name_with_misspelling(gender)  + '</em> '
        when 'original form' then species += 'f. <em>' + i.subject_taxon_name.name_with_misspelling(gender)  + '</em> '
      end
    end
    if self.rank_class.to_s =~ /Genus/
      if genus.blank?
        genus += '<em>' + self.name_with_misspelling(nil)  + '</em> '
      else
        subgenus += '<em>' + self.name_with_misspelling(nil)  + '</em> '
      end
    elsif self.rank_class.to_s =~ /Species/
      species += '<em>' + self.name_with_misspelling(nil)  + '</em> '
      genus = '<em>' + self.ancestor_at_rank('genus').name_with_misspelling(nil) + '</em> ' if genus.empty? && !self.ancestor_at_rank('genus').nil?
    end
    subgenus = '(' + subgenus.squish + ') ' unless subgenus.empty?
    cached_name = (genus + subgenus + superspecies + species).squish.gsub('</em> <em>', ' ')
    cached_name.blank? ? nil : cached_name
  end
end

#get_valid_taxon_nameObject

get valid name for any taxon



185
186
187
188
# File 'app/models/taxon_name.rb', line 185

def get_valid_taxon_name # get valid name for any taxon
  vn = TaxonNameRelationship.where_subject_is_taxon_name(self).with_type_array(TAXON_NAME_RELATIONSHIP_NAMES_INVALID)
  (vn.count == 1) ? vn.first.object_taxon_name : self
end

#name_in_gender(gender) ⇒ Object



240
241
242
243
244
245
246
247
248
249
250
251
252
# File 'app/models/taxon_name.rb', line 240

def name_in_gender(gender)
  case gender
    when 'masculine'
      n = self.masculine_name
    when 'feminine'
      n = self.feminine_name
    when 'neuter'
      n = self.neuter_name
    else
      n = nil
  end
  n.blank? ? self.name : n
end

#name_with_alternative_spellingObject



190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
# File 'app/models/taxon_name.rb', line 190

def name_with_alternative_spelling
  if self.type.to_s != 'Protonym' || self.rank_class.nil? || self.rank_class.to_s =~ /::Icn::/
    return nil
  elsif self.rank_class.to_s =~ /Species/
    n = self.name.squish # remove extra spaces and line brakes
    n = n.split(' ').last
    n = n[0..-4] + 'ae' if n =~ /^[a-z]*iae$/        # -iae > -ae in the end of word
    n = n[0..-6] + 'orum' if n =~ /^[a-z]*iorum$/    # -iorum > -orum
    n = n[0..-6] + 'arum' if n =~ /^[a-z]*iarum$/    # -iarum > -arum
    n = n[0..-3] + 'a' if n =~ /^[a-z]*um$/          # -um > -a
    n = n[0..-3] + 'a' if n =~ /^[a-z]*us$/          # -us > -a
    n = n[0..-3] + 'ra' if n =~ /^[a-z]*er$/         # -er > -ra
    n = n[0..-7] + 'ensis' if n =~ /^[a-z]*iensis$/  # -iensis > -ensis
    n = n[0..-5] + 'ana' if n =~ /^[a-z]*iana$/      # -iana > -ana
    n = n.gsub('ae', 'e').
        gsub('oe', 'e').
        gsub('ai', 'i').
        gsub('ei', 'i').
        gsub('ej', 'i').
        gsub('ii', 'i').
        gsub('ij', 'i').
        gsub('jj', 'i').
        gsub('j', 'i').
        gsub('y', 'i').
        gsub('v', 'u').
        gsub('rh', 'r').
        gsub('th', 't').
        gsub('k', 'c').
        gsub('ch', 'c').
        gsub('tt', 't').
        gsub('bb', 'b').
        gsub('rr', 'r').
        gsub('nn', 'n').
        gsub('mm', 'm').
        gsub('pp', 'p').
        gsub('ss', 's').
        gsub('ff', 'f').
        gsub('ll', 'l').
        gsub('ct', 't').
        gsub('ph', 'f').
        gsub('-', '')
    n = n[0, 3] + n[3..-4].gsub('o', 'i') + n[-3, 3] if n.length > 6  # connecting vowel in the middle of the word (nigrocinctus vs. nigricinctus)
  elsif self.rank_class.to_s =~ /Family/
    n = Protonym.family_group_base(self.name) + 'idae'
  else
    n = self.name.squish
  end
  return n
end

#name_with_misspelling(gender) ⇒ Object



382
383
384
385
386
387
388
389
390
# File 'app/models/taxon_name.rb', line 382

def name_with_misspelling(gender)
  if self.cached_misspelling
    self.name.to_s + ' [sic]'
  elsif gender.nil? || self.rank_class.to_s =~ /Genus/
    self.name.to_s
  else
    self.name_in_gender(gender)
  end
end

#nomenclature_dateObject



118
119
120
121
122
123
124
125
126
127
128
129
# File 'app/models/taxon_name.rb', line 118

def nomenclature_date
  return nil if self.id.nil?
  family_before_1961 = TaxonNameRelationship.where_subject_is_taxon_name(self).with_type_string('TaxonNameRelationship::Iczn::PotentiallyValidating::FamilyBefore1961').first
  if family_before_1961.nil?
    year = self.year_of_publication ? Time.utc(self.year_of_publication, 12, 31) : nil
    self.source ? (self.source.nomenclature_date ? self.source.nomenclature_date.to_time : year) : year
  else
    obj = family_before_1961.object_taxon_name
    year = obj.year_of_publication ? Time.utc(obj.year_of_publication, 12, 31) : nil
    obj.source ? (self.source.nomenclature_date ? obj.source.nomenclature_date.to_time : year) : year
  end
end

#part_of_speech_classObject



141
142
143
144
# File 'app/models/taxon_name.rb', line 141

def part_of_speech_class
  c = TaxonNameClassification.where_taxon_name(self).with_type_base('TaxonNameClassification::Latinized::PartOfSpeech').first
  c.nil? ? nil : c.type_class
end

#part_of_speech_nameObject



146
147
148
149
# File 'app/models/taxon_name.rb', line 146

def part_of_speech_name
  c = self.part_of_speech_class
  c.nil? ? nil : c.class_name
end

#rankObject



101
102
103
# File 'app/models/taxon_name.rb', line 101

def rank
  ::RANKS.include?(self.rank_class) ? self.rank_class.rank_name : nil
end

#rank_classObject



113
114
115
116
# File 'app/models/taxon_name.rb', line 113

def rank_class
  r = read_attribute(:rank_class)
  Ranks.valid?(r) ? r.safe_constantize : r
end

#rank_class=(value) ⇒ Object



109
110
111
# File 'app/models/taxon_name.rb', line 109

def rank_class=(value)
  write_attribute(:rank_class, value.to_s)
end

#rank_stringObject



105
106
107
# File 'app/models/taxon_name.rb', line 105

def rank_string
  self.rank_class.to_s
end


94
95
96
97
98
99
# File 'app/models/taxon_name.rb', line 94

def related_taxon_names
  TaxonName.find_by_sql("SELECT DISTINCT tn.* FROM taxon_names tn
                    LEFT JOIN taxon_name_relationships tnr1 ON tn.id = tnr1.subject_taxon_name_id
                    LEFT JOIN taxon_name_relationships tnr2 ON tn.id = tnr2.object_taxon_name_id
                    WHERE tnr1.object_taxon_name_id = #{self.id} OR tnr2.subject_taxon_name_id = #{self.id};")
end

#set_cached_author_yearObject



310
311
312
# File 'app/models/taxon_name.rb', line 310

def set_cached_author_year
  self.cached_author_year = get_author_and_year
end

#set_cached_classified_asObject



334
335
336
# File 'app/models/taxon_name.rb', line 334

def set_cached_classified_as
  self.cached_classified_as = get_classified_as
end

#set_cached_full_nameObject



294
295
296
297
298
299
300
# File 'app/models/taxon_name.rb', line 294

def set_cached_full_name
  if self.class.to_s == 'Combination'
    self.cached_name = get_combination
  elsif self.class.to_s == 'Protonym'
    self.cached_name = get_full_name
  end
end

#set_cached_higher_classificationObject



314
315
316
# File 'app/models/taxon_name.rb', line 314

def set_cached_higher_classification
  self.cached_higher_classification = get_higher_classification
end

#set_cached_misspellingObject



288
289
290
291
292
# File 'app/models/taxon_name.rb', line 288

def set_cached_misspelling
  if self.class.to_s == 'Protonym'
    self.cached_misspelling = get_cached_misspelling
  end
end

#set_cached_namesObject



268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
# File 'app/models/taxon_name.rb', line 268

def set_cached_names
  # if updated, update also sv_cached_names
  set_cached_misspelling
  set_cached_full_name
  set_cached_author_year
  set_cached_classified_as
  if self.class.to_s == 'Protonym'
    set_cached_original_combination
    set_cached_higher_classification
    set_primaty_homonym
    set_primary_homonym_alt
    if self.rank_class.to_s =~ /Species/
      set_secondary_homonym
      set_secondary_homonym_alt
    end
  elsif self.cached_original_combination.blank?
    set_cached_original_combination
  end
end

#set_cached_original_combinationObject



302
303
304
305
306
307
308
# File 'app/models/taxon_name.rb', line 302

def set_cached_original_combination
  if self.class.to_s == 'Combination'
    self.cached_original_combination = get_combination
  elsif self.class.to_s == 'Protonym'
    self.cached_original_combination = get_original_combination
  end
end

#set_primary_homonym_altObject



322
323
324
# File 'app/models/taxon_name.rb', line 322

def set_primary_homonym_alt
  self.cached_primary_homonym_alt = get_genus_species(:original, :alternative)
end

#set_primaty_homonymObject



318
319
320
# File 'app/models/taxon_name.rb', line 318

def set_primaty_homonym
  self.cached_primary_homonym = get_genus_species(:original, :self)
end

#set_secondary_homonymObject



326
327
328
# File 'app/models/taxon_name.rb', line 326

def set_secondary_homonym
  self.cached_secondary_homonym = get_genus_species(:curent, :self)
end

#set_secondary_homonym_altObject



330
331
332
# File 'app/models/taxon_name.rb', line 330

def set_secondary_homonym_alt
  self.cached_secondary_homonym_alt = get_genus_species(:curent, :alternative)
end

#set_type_if_emptyObject

region Set cached fields



264
265
266
# File 'app/models/taxon_name.rb', line 264

def set_type_if_empty
  self.type = 'Protonym' if self.type.nil?
end

#unavailable?Boolean

Returns:

  • (Boolean)


177
178
179
180
181
182
183
# File 'app/models/taxon_name.rb', line 177

def unavailable?
  if !TaxonNameClassification.where_taxon_name(self).with_type_array(TAXON_NAME_CLASS_NAMES_UNAVAILABLE_AND_INVALID).empty?
    true
  else
    false
  end
end

#unavailable_or_invalid?Boolean

Returns:

  • (Boolean)


163
164
165
166
167
168
169
170
171
172
173
174
175
# File 'app/models/taxon_name.rb', line 163

def unavailable_or_invalid?
  case self.rank_class.nomenclatural_code
    when :iczn
      if !TaxonNameRelationship::Iczn::Invalidating.where_subject_is_taxon_name(self).empty? || !TaxonNameClassification.where_taxon_name(self).with_type_array(TAXON_NAME_CLASS_NAMES_UNAVAILABLE_AND_INVALID).empty?
        return true
      end
    when :icz
      if !TaxonNameRelationship::Icn::Unaccepting.where_subject_is_taxon_name(self).empty? || !TaxonNameClassification.where_taxon_name(self).with_type_array(TAXON_NAME_CLASS_NAMES_UNAVAILABLE_AND_INVALID).empty?
        return true
      end
  end
  return false
end