Sha256: 015fde3450cce41d0c06ae02e0c93d9bf21c9b79cee3f2cc80e28a3288fb5f36
Contents?: true
Size: 1.96 KB
Versions: 8
Compression:
Stored size: 1.96 KB
Contents
# Reader - fgdc to internal data structure # unpack fgdc entity codeSet domain # History: # Stan Smith 2017-10-31 original script require 'uuidtools' require 'nokogiri' require 'adiwg/mdtranslator/internal/internal_metadata_obj' module ADIWG module Mdtranslator module Readers module Fgdc module CodeSet def self.unpack(axDomains, code, hResponseObj) # instance classes needed in script intMetadataClass = InternalMetadata.new aDomains = [] axCodeSets = axDomains.xpath('./codesetd') unless axCodeSets.empty? axCodeSets.each do |xCodeSet| hDomain = intMetadataClass.newDictionaryDomain hDomain[:domainId] = UUIDTools::UUID.random_create.to_s hDomain[:domainCode] = code hDomain[:domainDescription] = 'FGDC codeSet domain' # entity attribute 5.1.2.4.3.1 (codesetn) - codeset name # -> dataDictionary.domains.commonName name = xCodeSet.xpath('./codesetn').text unless name.empty? hDomain[:domainName] = name end # entity attribute 5.1.2.4.3.2 (codesets) - codeset source {citation} # -> dataDictionary.domains.domainReference.title hCitation = intMetadataClass.newCitation title = xCodeSet.xpath('./codesets').text unless title.empty? hCitation[:title] = title hDomain[:domainReference] = hCitation end aDomains << hDomain end end return aDomains end end end end end end
Version data entries
8 entries across 8 versions & 1 rubygems