def update_field(field_name, *obj)
      # Should be an Array of RDF::Term objects
      return unless obj

      if fields[field_name] && fields[field_name].localized?
        trans = {}

        obj.each do |item|
          lang = item.is_a?(RDF::Literal) && item.has_language? ? item.language.to_s : I18n.locale.to_s
          value = item.is_a?(RDF::URI) ? item.to_s : item.object # TODO: tidy this up
          trans[lang] = trans[lang] ? [*trans[lang]] << value : value
        end

        send("#{field_name}_translations=", trans) unless trans.empty?
      else
        objects = obj.map { |item| item.is_a?(RDF::URI) ? item.to_s : item.object } # TODO: tidy this up
        send("#{field_name}=", objects.size > 1 ? objects : objects.first)
      end
    end
def update_field(field_name, *obj)
      # Should be an Array of RDF::Term objects
      return unless obj

      if fields[field_name] && fields[field_name].localized?
        trans = {}

        obj.each do |item|
          lang = item.is_a?(RDF::Literal) && item.has_language? ? item.language.to_s : I18n.locale.to_s
          value = item.is_a?(RDF::URI) ? item.to_s : item.object # TODO: tidy this up
          trans[lang] = trans[lang] ? [*trans[lang]] << value : value
        end

        send("#{field_name}_translations=", trans) unless trans.empty?
      else
        objects = obj.map { |item| item.is_a?(RDF::URI) ? item.to_s : item.object } # TODO: tidy this up
        send("#{field_name}=", objects.size > 1 ? objects : objects.first)
      end
    end
Set values on a field; this will cast values
 from RDF types to persistable Mongoid types

 @param [String] field_name ActiveModel attribute name for the field
 @param [Array<Object>] obj objects (usually RDF::Terms) to be set
 @return [Object, nil]