@@ -50,13 +50,17 @@ def convert_single_to_multi_valued_fields
5050 end
5151
5252 # Convert non-crosswalked fields via lookup tables
53+ # rubocop:disable Metrics/PerceivedComplexity
5354 def convert_non_crosswalked_fields
5455 # Keys may or may not include whitespace, so we normalize them.
5556 # Resource class is required so we default to "Other"; resource type is not required.
5657 @v2_hash [ 'gbl_resourceClass_sm' ] = RESOURCE_CLASS_MAP [ @v1_hash [ 'dc_type_s' ] &.gsub ( /\s +/ , '' ) ] || [ 'Other' ]
5758 resource_type = RESOURCE_TYPE_MAP [ @v1_hash [ 'layer_geom_type_s' ] &.gsub ( /\s +/ , '' ) ]
5859 @v2_hash [ 'gbl_resourceType_sm' ] = resource_type unless resource_type . nil?
5960
61+ # If locn_geometry is in the ENVELOPE format, also add it as dcat_bbox
62+ @v2_hash [ 'dcat_bbox' ] = @v2_hash [ 'locn_geometry' ] if @v2_hash [ 'locn_geometry' ] &.match? ( /ENVELOPE/ )
63+
6064 # If the user specified a collection id map, use it to convert the collection names to ids
6165 is_part_of = @v1_hash [ 'dct_isPartOf_sm' ] &.map { |name | @collection_id_map [ name ] } &.compact
6266 if is_part_of . present?
@@ -65,6 +69,7 @@ def convert_non_crosswalked_fields
6569 @v2_hash . delete ( 'dct_isPartOf_sm' )
6670 end
6771 end
72+ # rubocop:enable Metrics/PerceivedComplexity
6873
6974 # Remove fields that are no longer used
7075 def remove_deprecated_fields
@@ -80,7 +85,7 @@ def remove_deprecated_fields
8085 'dc_publisher_s' => 'dct_publisher_sm' , # new namespace; single to multi-valued
8186 'dct_provenance_s' => 'schema_provider_s' , # new URI name
8287 'dc_subject_sm' => 'dct_subject_sm' , # new namespace
83- 'solr_geom' => 'dcat_bbox ' , # new URI name
88+ 'solr_geom' => 'locn_geometry ' , # new URI name
8489 'solr_year_i' => 'gbl_indexYear_im' , # new URI name; single to multi-valued
8590 'dc_source_sm' => 'dct_source_sm' , # new namespace
8691 'dc_rights_s' => 'dct_accessRights_s' , # new URI name
0 commit comments