Sha256: fe69b52c51f0a7c3a330c11d8f782ff086b3bb6010f2d0a65ef1f172d5059fd8
Contents?: true
Size: 1.96 KB
Versions: 45
Compression:
Stored size: 1.96 KB
Contents
# Reader - fgdc to internal data structure # unpack fgdc entity and attribute overview # History: # Stan Smith 2017-09-06 original script require 'uuidtools' require 'nokogiri' require 'adiwg/mdtranslator/internal/internal_metadata_obj' module ADIWG module Mdtranslator module Readers module Fgdc module EntityOverview def self.unpack(xOverview, hResponseObj) # instance classes needed in script intMetadataClass = InternalMetadata.new hEntity = intMetadataClass.newEntity hEntity[:entityId] = UUIDTools::UUID.random_create.to_s hEntity[:entityName] = 'Entity Overview' hEntity[:entityCode] = 'overview' # entity attribute 5.2.1 (eaover) - entity attribute overview (required) # -> dataDictionary.entities.entityDefinition definition = xOverview.xpath('./eaover').text unless definition.empty? hEntity[:entityDefinition] = definition end if definition.empty? hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: entityAttribute overview definition is missing' end # entity attribute 5.2.2 (eadetcit) - entity attribute detail citation [] # -> dataDictionary.entities.entityReference.title axReference = xOverview.xpath('./eadetcit') axReference.each do |xReference| reference = xReference.text unless reference.empty? hCitation = intMetadataClass.newCitation hCitation[:title] = reference hEntity[:entityReferences] << hCitation end end return hEntity end end end end end end
Version data entries
45 entries across 45 versions & 1 rubygems