Skip to content

Releases: samvera/bulkrax

v.2.0.1

27 Jan 23:28
fbfe396
Compare
Choose a tag to compare

Bug fix

  • removes the sorting of records when mapping the metadata fields so the correct model is created

2.0.0

14 Jan 05:37
f76b0bf
Compare
Choose a tag to compare

Bulkrax Release Notes

Features

Metadata

  • Ability to import and export single-valued properties that are children of other properties, by adding an “object” key to the field mapping (Wiki)
  • Ability to import and export multi-valued properties that are children of other properties, by adding “object” and “nested” keys to the field mapping (Wiki)
  • Single and multi-valued properties that are children of other properties are represented with numerated headers on the exported CSV (Wiki)
  • The Metadata-Only update now can be run without having to re-upload the files associated with it.
  • On import, a blank cell value will remove the existing value for that header, instead of skipping over the property
    • Both metadata and files can be removed this way

Relationships

  • Full documentation in Wiki
  • Adds the ability to import relationships from child records
  • Supports numerated headers for parent-child relationship imports
  • Adds #related_parents_parsed_mapping and #related_parents_parsed_mapping to new #supported_bulkrax_fields method so they can be processed by #add_metadata
  • Respects the presence of index in #set_parsed_data for non-object data

Collections

  • When exporting works as CSV, collection ids were not being exported. Collection ids are now included in export by default
  • Importing collections with metadata was not supported previously. Only importing collections by title was supported. Collections with metadata can now be imported like so:
source_identifier model title description
collection_1 Collection First Collection This will be the collection's description

Other notable feature updates

  • “Update Importer” is the only editable option on an importer edit page instead of the row of buttons. Clicking that button opens a modal that shows the actual updatable options along with descriptions
  • Ability to export a CSV from an individual exporter show page
  • The total works count is fixed on the index and show pages
  • Exported CSV titles reference whether the export was from a work type, collection or importer
    • Exporting from a work type uses the model name
    • Exporting from a collection uses the collection id
    • Exporting from an importer uses the importer id

Upgrade Path:

  • collection_field_mapping is now required to be set (per entry class) in config/initializers/bulkrax.rb in order to import collections by title

    • See here for how to set collection_field_mapping
  • parent_child_field_mapping has been renamed to related_children_field_mapping and merged into the field_mappings hash in config/initializers/bulkrax.rb

    • For full documentation and examples, see the Wiki

    • Example:

      • Previous:
        Bulkrax.setup do | config |
          config.parent_child_field_mapping = {
            'Bulkrax::CsvEntry' => 'children'
          }
        end
      • New equivalent:
        Bulkrax.setup do |config|
          config.field_mappings = {
            'Bulkrax::CsvEntry' = {
          	  'children' => { from: ['children'], related_children_field_mapping: true }
            }
          }
        end

Deprecation's

Features that will be removed in Bulkrax version 3.0:

Bug and error fixes:

  • Attaching collections to works was throwing an exception. member_of_collection_attributes was getting integers as keys, which is no longer supported. Convert these keys to a string instead.
  • Make sure remote files get file_name set, or Hyrax after 2.5 will fail
  • Fixes export error when there are colons in the values in the identifier
  • Avoid "data too long for column" SQL errors
  • Removing a column with a foreign key constraint fails in some versions of Mysql. Make removing the key constraint and index explicit to work around this limitation.
  • Fixes TypeError when parsing metadata

1.0.0 - A Time for Releases

18 Aug 21:21
134cc77
Compare
Choose a tag to compare

As more community members begin to use Bulkrax in earnest, it is time for the rapid and often breaking changes to Bulkrax to come to a close. This will be the first of regular releases going forward.

Recent Breaking Changes:

  • Source Identifiers and Work Identifiers (previously system identifier)
    There has been a lot of confusion in the code between these two items. Some of that confusion stemed from the names being to similar, but the majority of it came from the idea of specifying them separately. Instead of two seperate variables, we now specify which field is the source_identifier in the field hash. This simplifies the specification and makes it more flexible to overriding.

    # Was
    config.system_identifier_field = 'source'
    config.source_identifier_field_mapping = { 'Bulkrax::CsvEntry'  => 'MyIdentifierField' }
    
    # Now
    config.field_mappings["Bulkrax::CsvParser"]["source"] = { from: ["MyIdentifierField"], source_identifier: true  }
    
  • Fill in missing identifier functionality

      # Should Bulkrax make up source identifiers for you? This allows round tripping and downloaded errored entries to still work, but does
      # mean if you upload the same source record in two different files you WILL get duplicates.
      # for the importer id and the row in the file
      #    config.fill_in_blank_source_identifiers.call = -> { "b-#{importer.id}-#{_index}"}
      # or use a uuid
      #    config.fill_in_blank_source_identifiers.call = -> { SecureRandom.uuid }
    
  • Refactored ObjectFactory initializer to use named arguments

    ObjectFactory.new(attrs, source_identifier, work_id, false, user)
    
    # Now
    ObjectFactory.new(attributes: attrs, source_identifier_value: source_identifier, work_identifier: work_id, user: user, replace_files: false)
    

New Features

  • Parsers handle numerated notation
    1_value
    # or
    value_1
    
  • Parsers handle fields that are prefixed or not prefixed with the object name
    "creator_first_name" => { from: ["creator_first_name"], object: "creator" }
    # or
    "first_name" => { from: ["creator_first_name"], object: "creator" }
    
  • Parsers handle values nested in an object
    # ['Queen'] is the nested value within the "creator" object below
    
    [{
        creator: {
            position: ['Queen']
        }
    }]
    
  • Updating an importer has a new option. Instead of only a destructive update, whereby all FileSets are destroyed and then re-created, there is now a nondestructive option that uses fedora/hyrax's versioning tools to create a version of the FileSet then update it.
  • We have also made great strides in setting up the ability to round-trip. Now when a new importer is created, if any of the works imported already exist in the system, it will match and update the work rather than duplicating it. This matching is based on the source identifiers and work identifiers (mentioned above).

Bug Fixes

Many bug fixes around exports, field sizes and the way file updates are handled.