lib/bolognese/readers/datacite_reader.rb in bolognese-0.9.33 vs lib/bolognese/readers/datacite_reader.rb in bolognese-0.9.34
- old
+ new
@@ -4,11 +4,11 @@
def get_datacite(id: nil, **options)
return nil unless id.present?
doi = doi_from_url(id)
url = options.fetch(:search_url, nil).presence || "https://search.datacite.org/api"
- url += "?q=doi:#{doi}&fl=doi,xml,allocator_symbol,datacentre_symbol,media,updated&wt=json"
+ url += "?q=doi:#{doi}&fl=doi,xml,allocator_symbol,datacentre_symbol,media,minted,updated&wt=json"
response = Maremma.get url
attributes = response.body.dig("data", "response", "docs").first
return nil unless attributes.present?
@@ -18,11 +18,12 @@
response = Maremma.head(id, limit: 0)
url = response.headers.present? ? response.headers["location"] : nil
{ "string" => string,
- "date_modified" => attributes.fetch("updated", nil),
- "allocator_id" => attributes.fetch("allocator_symbol", nil),
+ "date_registered" => attributes.fetch("minted", nil),
+ "date_updated" => attributes.fetch("updated", nil),
+ "member_id" => attributes.fetch("allocator_symbol", nil),
"data_center_id" => attributes.fetch("datacentre_symbol", nil),
"url" => url }
end
def read_datacite(string: nil)