From f5b3e87e8ecdf70e09dfbed4d580e05e3b1c5a6d Mon Sep 17 00:00:00 2001 From: Jasper Date: Wed, 17 Sep 2025 11:39:03 +0000 Subject: [PATCH 1/4] institution rdf page --- app/controllers/institutions_controller.rb | 1 + app/models/institution.rb | 1 + 2 files changed, 2 insertions(+) diff --git a/app/controllers/institutions_controller.rb b/app/controllers/institutions_controller.rb index c076847269..fc2c3654d3 100644 --- a/app/controllers/institutions_controller.rb +++ b/app/controllers/institutions_controller.rb @@ -24,6 +24,7 @@ def show # format.json { render layout: false, json: JSON.parse(JbuilderTemplate.new(view_context).api_format!(@institution).target!) } #format.json { render json: @institution } #normal json format.json {render json: @institution, include: [params[:include]]} + format.rdf { render template: 'rdf/show' } end end diff --git a/app/models/institution.rb b/app/models/institution.rb index b44f65504f..305962221f 100644 --- a/app/models/institution.rb +++ b/app/models/institution.rb @@ -1,4 +1,5 @@ class Institution < ApplicationRecord + include Seek::Rdf::RdfGeneration acts_as_yellow_pages From 1654bf456eeca36117c14b75d92e6943787b5239 Mon Sep 17 00:00:00 2001 From: Jasper Date: Wed, 17 Sep 2025 12:19:17 +0000 Subject: [PATCH 2/4] missed the Institution => :Institution in jerm_vocab! --- lib/seek/rdf/jerm_vocab.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/seek/rdf/jerm_vocab.rb b/lib/seek/rdf/jerm_vocab.rb index db8a381d1a..bfd34bdc87 100644 --- a/lib/seek/rdf/jerm_vocab.rb +++ b/lib/seek/rdf/jerm_vocab.rb @@ -37,7 +37,8 @@ def self.defined_types Investigation => :Investigation, Publication => :Publication, Strain => :Strain, - Sample => :Sample + Sample => :Sample, + Institution => :Institution } end From 03fe9768149905ecbd93bd675f7195e68c2e43a4 Mon Sep 17 00:00:00 2001 From: Jasper Date: Wed, 17 Sep 2025 12:20:04 +0000 Subject: [PATCH 3/4] removing include line --- app/models/institution.rb | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/models/institution.rb b/app/models/institution.rb index 305962221f..70efb97b2d 100644 --- a/app/models/institution.rb +++ b/app/models/institution.rb @@ -1,6 +1,4 @@ class Institution < ApplicationRecord - include Seek::Rdf::RdfGeneration - acts_as_yellow_pages auto_strip_attributes :web_page, :title From e921cac809050fb925497333912aa994718bca5c Mon Sep 17 00:00:00 2001 From: Jasper Date: Wed, 17 Sep 2025 12:52:53 +0000 Subject: [PATCH 4/4] added Institution to rdf capable types --- test/unit/util_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/unit/util_test.rb b/test/unit/util_test.rb index 557296b7ed..5605ca1281 100644 --- a/test/unit/util_test.rb +++ b/test/unit/util_test.rb @@ -34,7 +34,7 @@ def teardown test 'rdf capable types' do types = Seek::Util.rdf_capable_types expected = %w[Assay DataFile Investigation Model ObservationUnit Organism Person Programme Project Publication -Sample Sop Strain Study] +Sample Sop Strain Study Institution] assert_equal expected, types.collect(&:name).sort end