lib/bolognese/readers/schema_org_reader.rb in bolognese-2.0.3 vs lib/bolognese/readers/schema_org_reader.rb in bolognese-2.1.0

- old
+ new

@@ -72,11 +72,14 @@ # Authors should be an object, if it's just a plain string don't try and parse it. if not authors.is_a?(String) creators = get_authors(from_schema_org_creators(Array.wrap(authors))) end contributors = get_authors(from_schema_org_contributors(Array.wrap(meta.fetch("editor", nil)))) - publisher_name = parse_attributes(meta.fetch("publisher", nil), content: "name", first: true) - publisher = { "name" => publisher_name } if publisher_name.present? + + publisher = { + "name" => parse_attributes(meta.fetch("publisher", nil), content: "name", first: true), + "publisherIdentifier" => parse_attributes(meta.fetch("publisher", nil), content: "@id", first: true), + }.compact if meta.fetch("publisher", nil).present? ct = (schema_org == "Dataset") ? "includedInDataCatalog" : "Periodical" container = if meta.fetch(ct, nil).present? url = parse_attributes(from_schema_org(meta.fetch(ct, nil)), content: "url", first: true)