Module: Export::Coldp::Files::Synonym
- Defined in:
- lib/export/coldp/files/synonym.rb
Overview
Bigger picture: understand how this maps to core name usage table in CoL
Class Method Summary collapse
- .generate(otus, reference_csv = nil) ⇒ Object
- .reference_id_field(otu) ⇒ Object
- .remarks_field ⇒ Object
-
.status(o, t) ⇒ Object
Last 3 of api.catalogue.life/vocab/taxonomicstatus.
Class Method Details
.generate(otus, reference_csv = nil) ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/export/coldp/files/synonym.rb', line 29 def self.generate(otus, reference_csv = nil) CSV.generate(col_sep: "\t") do |csv| csv << %w{taxonID nameID status remarks referenceID} # reddis? unique = {} # otus are valid and invalid otus.each do |o| next unless o.taxon_name && o.taxon_name.is_valid? name = o.taxon_name data = ::Catalog::Nomenclature::Entry.new(name) data.names.each do |t| # not valid, not a combioantion # reified = !(t.is_valid? || t.is_combination?) id = t.reified_id next if unique[[o.id, id]] == true unique[[o.id, id]] = true references = reference_id_field(o) csv << [ o.id, # taxonID attached to the current valid concept id, # nameID nil, # status TODO def status(taxon_name_id) remarks_field, references # unclear what this means in TW ] end end end end |
.reference_id_field(otu) ⇒ Object
25 26 27 |
# File 'lib/export/coldp/files/synonym.rb', line 25 def self.reference_id_field(otu) nil end |
.remarks_field ⇒ Object
21 22 23 |
# File 'lib/export/coldp/files/synonym.rb', line 21 def self.remarks_field nil end |
.status(o, t) ⇒ Object
Last 3 of api.catalogue.life/vocab/taxonomicstatus
11 12 13 14 15 16 17 18 19 |
# File 'lib/export/coldp/files/synonym.rb', line 11 def self.status(o, t) #'accepted' #'provisionally accepted' #'synonym' #'ambiguous synonym' #'missaplied' 'synonym' end |