Skip to content

Commit ddf8e92

Browse files
committed
include the ror url as identifier for Institution schema.org #2379
1 parent ce265d7 commit ddf8e92

File tree

5 files changed

+12
-4
lines changed

5 files changed

+12
-4
lines changed

app/helpers/institutions_helper.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ def can_create_institutions?
33
Institution.can_create?
44
end
55

6-
def ror_link(ror_id)
7-
ror_id.blank? ? text_or_not_specified(nil) : link_to("https://ror.org/#{ror_id}", "https://ror.org/#{ror_id}", target: "_blank", rel: "noopener")
6+
def ror_link(ror_url)
7+
ror_url.blank? ? text_or_not_specified(nil) : link_to(ror_url, ror_url, target: "_blank", rel: "noopener")
88
end
99

1010
def other_departments(institution)

app/models/institution.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@ def typeahead_hint
6666
end
6767
end
6868

69+
def ror_url
70+
return nil unless ror_id.present?
71+
72+
"https://ror.org/#{ror_id}"
73+
end
74+
6975
private
7076

7177
def validate_base_title_presence

app/views/institutions/_resource_list_item.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<%= list_item_attribute "ROR ID", ror_link(resource.ror_id) %>
1+
<%= list_item_attribute "ROR ID", ror_link(resource.ror_url) %>
22
<%= list_item_attribute "Department", text_or_not_specified(resource.department) %>
33
<%= list_item_attribute "Country", (country_text_or_not_specified resource.country) %>
44
<%= list_item_optional_attribute "City", h(resource.city) %>

lib/seek/bio_schema/resource_decorators/institution.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ module ResourceDecorators
44
# Decorator that provides extensions for an Institution
55
class Institution < Thing
66
schema_mappings full_address: :address,
7-
image: :logo
7+
image: :logo,
8+
ror_url: :identifier
89

910
def schema_type
1011
'ResearchOrganization'

test/unit/bio_schema/schema_ld_generation_test.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -698,6 +698,7 @@ def setup
698698
'@id' => "http://localhost:3000/institutions/#{institution.id}",
699699
"name"=>"Manchester Institute of Biotechnology, University of Manchester",
700700
'url' => 'http://www.manchester.ac.uk/',
701+
'identifier' => 'https://ror.org/027m9bs27',
701702
"address"=>{"address_country"=>"GB", "address_locality"=>"Manchester", "street_address"=>"Manchester Centre for Integrative Systems Biology, MIB/CEAS, The University of Manchester Faraday Building, Sackville Street, Manchester M60 1QD United Kingdom"}
702703
}
703704

0 commit comments

Comments
 (0)