lib/relaton_bipm/data_fetcher.rb in relaton-bipm-1.13.10 vs lib/relaton_bipm/data_fetcher.rb in relaton-bipm-1.13.11

- old
+ new

@@ -199,11 +199,11 @@ has_part_item.relation << RelatonBib::DocumentRelation.new(type: "partOf", bibitem: item) write_file path, has_part_item, warn_duplicate: false path = File.join dir, "#{num}-#{part}.yaml" elsif part hash[:title].each { |t| t[:content] = t[:content].sub(/\s\(.+\)$/, "") } - hash[:link] = [{ type: "src", content: link }] + # hash[:link] = [{ type: "src", content: link }] h = bibitem body: body, type: type, en: en_md, fr: fr_md, id: id, num: num, src: src, pdf: en["pdf"] add_part h, part part_item = RelatonBipm::BipmBibliographicItem.new(**h) part_item_path = File.join dir, "#{num}-#{part}.yaml" write_file part_item_path, part_item @@ -233,15 +233,18 @@ hash = { type: "proceedings", title: [], doctype: r["type"], place: [RelatonBib::Place.new(city: "Paris")] } hash[:title] << title(r["title"], "en") if r["title"] - fr_resolution = args[:fr]["resolutions"].fetch(i, nil) - if fr_resolution - fr_title = fr_resolution["title"] - hash[:title] << title(fr_title, "fr") if fr_title + fr_r = args[:fr]["resolutions"].fetch(i, nil) + hash[:link] = [{ type: "citation", content: r["url"], language: "en", script: "Latn" }] + if fr_r + hash[:title] << title(fr_r["title"], "fr") if fr_r["title"] + hash[:link] << { type: "citation", content: fr_r["url"], language: "fr", script: "Latn" } end + hash[:link] += args[:src] + hash[:link] << { type: "pdf", content: r["reference"] } if r["reference"] date = r["dates"].first.to_s hash[:date] = [{ type: "published", on: date }] num = r["identifier"].to_s.split("-").last year = date.split("-").first num = "0" if num == year @@ -258,12 +261,10 @@ make_docid(id: id, type: "BIPM", primary: true), make_docid(id: id, type: "BIPM", primary: true, language: "en", script: "Latn"), id_fr(id), ] hash[:docnumber] = id - hash[:link] = [{ type: "src", content: r["url"] }] + args[:src] - hash[:link] << { type: "pdf", content: r["reference"] } if r["reference"] hash[:language] = %w[en fr] hash[:script] = ["Latn"] hash[:contributor] = contributors date, args[:body] hash[:structuredidentifier] = RelatonBipm::StructuredIdentifier.new docnumber: num item = RelatonBipm::BipmBibliographicItem.new(**hash) @@ -416,10 +417,13 @@ make_docid(id: args[:id], type: "BIPM", primary: true, language: "en", script: "Latn"), id_fr(args[:id]), ] hash[:id] = args[:id].gsub " ", "-" hash[:docnumber] = args[:id] - hash[:link] = [{ type: "src", content: args[:en]["url"] }] + hash[:link] = [ + { type: "citation", content: args[:en]["url"], language: "en", script: "Latn" }, + { type: "citation", content: args[:fr]["url"], language: "fr", script: "Latn" }, + ] RelatonBib.array(args[:pdf]).each { |pdf| hash[:link] << { type: "pdf", content: pdf } } hash[:link] += args[:src] if args[:src]&.any? hash[:language] = %w[en fr] hash[:script] = ["Latn"] hash[:contributor] = contributors args[:en]["date"], args[:body]