Skip to content

Commit

Permalink
Correct typos in field names
Browse files Browse the repository at this point in the history
  • Loading branch information
thatbudakguy committed Jan 29, 2024
1 parent 97fe4b9 commit 9338a89
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions lib/geo_combine/migrators/v1_aardvark_migrator.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions spec/fixtures/docs/full_geoblacklight_aardvark.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
"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",
"dct_format_s":"Shapefile",
"dct_language_sm":[
"English"
],
"gbl_resourceClass_s":[
"gbl_resourceClass_sm":[
"Datasets"
],
"dct_publisher_sm":[
Expand Down

0 comments on commit 9338a89

Please sign in to comment.