Module: Bolognese::Readers::HyraxWorkReader
- Defined in:
- app/services/bolognese/readers/hyrax_work_reader.rb
Overview
Use this with Bolognese like the following: m = Bolognese::Metadata.new(input: work.attributes.merge(has_model: work.has_model.first).to_json, from: ‘hyrax_work’) Then crosswalk it with: m.datacite Or: m.ris
Instance Method Summary collapse
-
#read_hyrax_work(string: nil, **options) ⇒ Object
Not usable right now given how Metadata#initialize works def get_hyrax_work(id: nil, **options) work = ActiveFedora::Base.find(id) { “string” => work.attributes.merge(has_model: work.has_model).to_json } end.
Instance Method Details
#read_hyrax_work(string: nil, **options) ⇒ Object
Not usable right now given how Metadata#initialize works def get_hyrax_work(id: nil, **options)
work = ActiveFedora::Base.find(id)
{ "string" => work.attributes.merge(has_model: work.has_model).to_json }
end
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'app/services/bolognese/readers/hyrax_work_reader.rb', line 19 def read_hyrax_work(string: nil, **) = ActiveSupport::HashWithIndifferentAccess.new(.except(:doi, :id, :url, :sandbox, :validate, :ra)) = string.present? ? Maremma.from_json(string) : {} { # "id" => meta.fetch('id', nil), "identifiers" => read_hyrax_work_identifiers(), "types" => read_hyrax_work_types(), "doi" => normalize_doi(.fetch('doi', nil)&.first), # "url" => normalize_id(meta.fetch("URL", nil)), "titles" => read_hyrax_work_titles(), "creators" => read_hyrax_work_creators(), "contributors" => read_hyrax_work_contributors(), # "container" => container, "publisher" => read_hyrax_work_publisher(), # "related_identifiers" => related_identifiers, # "dates" => dates, "publication_year" => read_hyrax_work_publication_year(), "descriptions" => read_hyrax_work_descriptions(), # "rights_list" => rights_list, # "version_info" => meta.fetch("version", nil), "subjects" => read_hyrax_work_subjects() # "state" => state }.merge() end |