33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
# File 'lib/bolognese/readers/ris_reader.rb', line 33
def read_ris(string: nil, **options)
meta = ris_meta(string: string)
ris_type = meta.fetch("TY", nil) || "GEN"
type = RIS_TO_SO_TRANSLATIONS[ris_type] || "CreativeWork"
doi = validate_doi(meta.fetch("DO", nil))
author = Array.wrap(meta.fetch("AU", nil)).map { |a| { "name" => a } }
container_title = meta.fetch("T2", nil)
is_part_of = if container_title.present?
{ "type" => "Periodical",
"title" => container_title,
"issn" => meta.fetch("SN", nil) }.compact
else
nil
end
{ "id" => normalize_doi(doi),
"type" => type,
"citeproc_type" => RIS_TO_CP_TRANSLATIONS[type] || "misc",
"ris_type" => ris_type,
"resource_type_general" => Metadata::SO_TO_DC_TRANSLATIONS[type],
"doi" => doi,
"url" => meta.fetch("UR", nil),
"title" => meta.fetch("T1", nil),
"alternate_name" => meta.fetch("AN", nil),
"author" => get_authors(author),
"publisher" => meta.fetch("PB", nil),
"is_part_of" => is_part_of,
"date_created" => meta.fetch("Y1", nil),
"date_published" => meta.fetch("PY", nil),
"date_accessed" => meta.fetch("Y2", nil),
"description" => meta.fetch("AB", nil).present? ? { "text" => sanitize(meta.fetch("AB")) } : nil,
"volume" => meta.fetch("VL", nil),
"issue" => meta.fetch("IS", nil),
"first_page" => meta.fetch("SP", nil),
"last_page" => meta.fetch("EP", nil),
"keywords" => meta.fetch("KW", nil),
"language" => meta.fetch("LA", nil)
}
end
|