diff --git a/lib/geo_combine/migrators/v1_aardvark_migrator.rb b/lib/geo_combine/migrators/v1_aardvark_migrator.rb index 608b3fb..65b014f 100644 --- a/lib/geo_combine/migrators/v1_aardvark_migrator.rb +++ b/lib/geo_combine/migrators/v1_aardvark_migrator.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true +require 'active_support/core_ext' + module GeoCombine module Migrators # migrates the v1 schema to the aardvark schema @@ -51,9 +53,9 @@ def convert_single_to_multi_valued_fields def convert_non_crosswalked_fields # Keys may or may not include whitespace, so we normalize them. # Resource class is required so we default to "Other"; resource type is not required. - @v2_hash['gbl_resourceClass_s'] = RESOURCE_CLASS_MAP[@v1_hash['dc_type_s']&.gsub(/\s+/, '')] || ['Other'] + @v2_hash['gbl_resourceClass_sm'] = RESOURCE_CLASS_MAP[@v1_hash['dc_type_s']&.gsub(/\s+/, '')] || ['Other'] resource_type = RESOURCE_TYPE_MAP[@v1_hash['layer_geom_type_s']&.gsub(/\s+/, '')] - @v2_hash['gbl_resourceType_s'] = resource_type unless resource_type.nil? + @v2_hash['gbl_resourceType_sm'] = resource_type unless resource_type.nil? # If the user specified a collection id map, use it to convert the collection names to ids is_part_of = @v1_hash['dct_isPartOf_sm']&.map { |name| @collection_id_map[name] }&.compact diff --git a/spec/fixtures/docs/full_geoblacklight_aardvark.json b/spec/fixtures/docs/full_geoblacklight_aardvark.json index b0ee9e5..bc3f837 100644 --- a/spec/fixtures/docs/full_geoblacklight_aardvark.json +++ b/spec/fixtures/docs/full_geoblacklight_aardvark.json @@ -12,7 +12,7 @@ "dct_references_s":"{\"http://schema.org/url\":\"http://purl.stanford.edu/cz128vq0535\",\"http://schema.org/downloadUrl\":\"http://stacks.stanford.edu/file/druid:cz128vq0535/data.zip\",\"http://www.loc.gov/mods/v3\":\"http://purl.stanford.edu/cz128vq0535.mods\",\"http://www.isotc211.org/schemas/2005/gmd/\":\"http://opengeometadata.stanford.edu/metadata/edu.stanford.purl/druid:cz128vq0535/iso19139.xml\",\"http://www.w3.org/1999/xhtml\":\"http://opengeometadata.stanford.edu/metadata/edu.stanford.purl/druid:cz128vq0535/default.html\",\"http://www.opengis.net/def/serviceType/ogc/wfs\":\"https://geowebservices.stanford.edu/geoserver/wfs\",\"http://www.opengis.net/def/serviceType/ogc/wms\":\"https://geowebservices.stanford.edu/geoserver/wms\"}", "gbl_wxsIdentifier_s":"druid:cz128vq0535", "id":"stanford-cz128vq0535", - "gbl_resourceType_s": [ + "gbl_resourceType_sm": [ "Polygon data" ], "gbl_mdModified_dt":"2015-01-13T18:46:38Z", @@ -20,7 +20,7 @@ "dct_language_sm":[ "English" ], - "gbl_resourceClass_s":[ + "gbl_resourceClass_sm":[ "Datasets" ], "dct_publisher_sm":[