lib/adiwg/mdtranslator/readers/fgdc/modules/module_taxonSystem.rb in adiwg-mdtranslator-2.9.2 vs lib/adiwg/mdtranslator/readers/fgdc/modules/module_taxonSystem.rb in adiwg-mdtranslator-2.10.0
- old
+ new
@@ -19,27 +19,30 @@
def self.unpack(xSystem, hTaxonomy, hResponseObj)
# instance classes needed in script
intMetadataClass = InternalMetadata.new
- # taxonomy bio.2.1 (classsys) - taxonomic classification authority []
+ # taxonomy bio.2.1 (classsys) - taxonomic classification authority [] (required)
# -> resourceInfo.taxonomy.taxonSystem
axTaxClass = xSystem.xpath('./classsys')
unless axTaxClass.empty?
axTaxClass.each do |xTaxClass|
hTaxonSystem = intMetadataClass.newTaxonSystem
- # taxonomy bio.2.1.1 (classcit) - taxonomic classification citation {citation}
+ # taxonomy bio.2.1.1 (classcit) - taxonomic classification citation {citation} (required)
# -> resourceInfo.taxonomy.taxonSystem.citation
xCitation = xTaxClass.xpath('./classcit')
unless xCitation.empty?
hCitation = Citation.unpack(xCitation, hResponseObj)
unless hCitation.nil?
hTaxonSystem[:citation] = hCitation
end
end
+ if xCitation.empty?
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: BIO taxonomy classification system citation missing'
+ end
# taxonomy bio.2.1.2 (classmod) - taxonomic classification modifications
# -> resourceInfo.taxonomy.taxonSystem.modifications
modifications = xTaxClass.xpath('./classmod').text
unless modifications.empty?
@@ -48,10 +51,13 @@
hTaxonomy[:taxonSystem] << hTaxonSystem
end
end
+ if axTaxClass.empty?
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: BIO taxonomy classification system is missing'
+ end
# taxonomy bio.2.2 (idref) - taxonomic identification reference [] {identifier}
# -> resourceInfo.taxonomy.idReferences.authority
axTaxRef = xSystem.xpath('./idref')
unless axTaxRef.empty?
@@ -77,16 +83,19 @@
hTaxonomy[:observers] << hResponsibility
end
end
end
- # taxonomy bio.2.4 (taxonpro) - taxonomic procedures
+ # taxonomy bio.2.4 (taxonpro) - taxonomic procedures (required)
# -> resourceInfo.taxonomy.idProcedure
procedures = xSystem.xpath('./taxonpro').text
unless procedures.empty?
hTaxonomy[:idProcedure] = procedures
end
+ if procedures.empty?
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: BIO taxonomy classification procedures are missing'
+ end
# taxonomy bio.2.5 (taxoncom) - taxonomic completeness
# -> resourceInfo.taxonomy.idCompleteness
completeness = xSystem.xpath('./taxoncom').text
unless completeness.empty?
@@ -99,25 +108,31 @@
unless axVoucher.empty?
axVoucher.each do |xVoucher|
hVoucher = intMetadataClass.newTaxonVoucher
- # taxonomy bio.2.6.1 (specimen) - specimen
+ # taxonomy bio.2.6.1 (specimen) - specimen (required)
# -> resourceInfo.taxonomy.vouchers.specimen
specimen = xVoucher.xpath('./specimen').text
unless specimen.empty?
hVoucher[:specimen] = specimen
end
+ if procedures.empty?
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: BIO taxonomy voucher specimen is missing'
+ end
- # taxonomy bio.2.6.2 (reposit) - repository {contact}
+ # taxonomy bio.2.6.2 (reposit) - repository {contact} (required)
# -> resourceInfo.taxonomy.vouchers.repository
xRepository = xVoucher.xpath('./reposit')
unless xRepository.empty?
hResponsibility = Contact.unpack(xRepository, hResponseObj)
unless hResponsibility.nil?
hResponsibility[:roleName] = 'custodian'
hVoucher[:repository] = hResponsibility
end
+ end
+ if xRepository.empty?
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: BIO taxonomy voucher repository is missing'
end
hTaxonomy[:vouchers] << hVoucher
end