lib/bolognese/readers/schema_org_reader.rb in bolognese-0.9.11 vs lib/bolognese/readers/schema_org_reader.rb in bolognese-0.9.13
- old
+ new
@@ -19,16 +19,15 @@
id = normalize_id(meta.fetch("@id", nil))
type = meta.fetch("@type", nil)
resource_type_general = Bolognese::Utils::SO_TO_DC_TRANSLATIONS[type]
author = get_authors(from_schema_org(Array.wrap(meta.fetch("author", nil))))
editor = get_authors(from_schema_org(Array.wrap(meta.fetch("editor", nil))))
- publisher = meta.dig("publisher", "name")
- container_title = if publisher.is_a?(Hash)
- publisher.fetch("name", nil)
- elsif publisher.is_a?(String)
- publisher
- end
+ publisher = if meta.dig("publisher").is_a?(Hash)
+ meta.dig("publisher", "name")
+ elsif publisher.is_a?(String)
+ meta.dig("publisher")
+ end
date_published = meta.fetch("datePublished", nil)
{ "id" => id,
"type" => type,
"additional_type" => meta.fetch("additionalType", nil),
@@ -39,10 +38,9 @@
"doi" => validate_doi(id),
"url" => normalize_id(meta.fetch("url", nil)),
"title" => meta.fetch("name", nil),
"alternate_name" => meta.fetch("alternateName", nil),
"author" => author,
- "container_title" => container_title,
"publisher" => meta.dig("publisher", "name"),
"provider" => meta.fetch("provider", nil),
"is_identical_to" => schema_org_is_identical_to(meta),
"is_part_of" => schema_org_is_part_of(meta),
"has_part" => schema_org_has_part(meta),