lib/bolognese/utils.rb in bolognese-1.3.2 vs lib/bolognese/utils.rb in bolognese-1.3.3

- old
+ new

@@ -577,19 +577,19 @@ def to_schema_org_creators(element) element = Array.wrap(element).map do |c| c["affiliation"] = Array.wrap(c["affiliation"]).map do |a| if a.is_a?(String) name = a - id = nil + affiliation_identifier = nil else name = a["name"] - id = a["affiliationIdentifier"] + affiliation_identifier = a["affiliationIdentifier"] end { "@type" => "Organization", - "@id" => id, + "@id" => affiliation_identifier, "name" => name }.compact end.unwrap c["@type"] = c["nameType"].present? ? c["nameType"][0..-3] : nil c["@id"] = Array.wrap(c["nameIdentifiers"]).first.to_h.fetch("nameIdentifier", nil) c["name"] = c["familyName"].present? ? [c["givenName"], c["familyName"]].join(" ") : c["name"] @@ -600,18 +600,18 @@ def to_schema_org_contributors(element) element = Array.wrap(element).map do |c| c["affiliation"] = Array.wrap(c["affiliation"]).map do |a| if a.is_a?(String) name = a - id = nil + affiliation_identifier = nil else name = a["name"] - id = a["affiliationIdentifier"] + affiliation_identifier = a["affiliationIdentifier"] end { "@type" => "Organization", - "@id" => id, + "@id" => affiliation_identifier, "name" => name }.compact end.unwrap c["@type"] = c["nameType"].present? ? c["nameType"][0..-3] : nil c["@id"] = Array.wrap(c["nameIdentifiers"]).first.to_h.fetch("nameIdentifier", nil) c["name"] = c["familyName"].present? ? [c["givenName"], c["familyName"]].join(" ") : c["name"]