Store origin URI when exchanging#1342
Open
fbacall wants to merge 7 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds first-class “origin instance” attribution for exchanged Events/Materials by persisting an origin_uri, surfacing it in the UI, and enriching OAI-PMH identify/ingestion so TeSS instances can be detected and credited.
Changes:
- Adds
origin_uritoeventsandmaterials, displays “Original entry” UI, and shows an exchange icon in listings. - Extends OAI-PMH provider Identify response to mark the instance as TeSS, and updates the OAI-PMH ingestor to populate
origin_uriwhen ingesting from a TeSS instance. - Refactors OAI-PMH tests to use WebMock/VCR-recorded HTTP responses instead of a mocked OAI client.
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| test/vcr_cassettes/ingestors/tess_oai_pmh_listrecords.yml | Adds recorded TeSS ListRecords response fixture for replayable ingestion testing. |
| test/vcr_cassettes/ingestors/tess_oai_pmh_identify.yml | Adds recorded TeSS Identify response fixture including the TeSS marker description. |
| test/unit/ingestors/oai_pmh_ingestor_test.rb | Switches OAI-PMH tests to HTTP stubs/VCR and adds coverage for origin_uri population. |
| test/controllers/materials_controller_test.rb | Verifies origin-info link is conditionally displayed on material show page. |
| test/controllers/events_controller_test.rb | Verifies origin-info link is conditionally displayed on event show page. |
| lib/ingestors/oai_pmh_ingestor.rb | Detects TeSS instances via Identify and injects origin_uri during RDF ingestion. |
| lib/ingestors/material_ingestion.rb | Simplifies material ingestion param extraction. |
| lib/ingestors/event_ingestion.rb | Simplifies event ingestion param extraction. |
| db/schema.rb | Updates schema to include origin_uri columns. |
| db/migrate/20260710154329_add_origin_uri_to_tables.rb | Adds origin_uri columns to materials and events. |
| config/locales/en.yml | Adds i18n strings for origin attribution UI. |
| config/initializers/oai_provider.rb | Adds TeSS marker Identify description and customizes OAI identifiers to include route keys. |
| app/views/materials/show.html.erb | Renders shared origin-info block on material pages. |
| app/views/materials/_material.html.erb | Displays exchange icon for exchanged materials in lists/cards. |
| app/views/events/show.html.erb | Renders shared origin-info block on event pages. |
| app/views/events/_event.html.erb | Displays exchange icon for exchanged events in lists/cards. |
| app/views/common/_origin_info.erb | New shared sidebar block that links to the origin instance entry. |
| app/models/application_record.rb | Adds a default oai_identifier used by OAI-PMH provider identifier rendering. |
| app/helpers/application_helper.rb | Adds exchanged icon type and helper to render the exchange icon. |
| app/controllers/materials_controller.rb | Permits origin_uri in strong params for materials. |
| app/controllers/events_controller.rb | Permits origin_uri in strong params for events. |
| app/assets/stylesheets/application.scss | Styles the exchange icon. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+94
to
+95
| origin_uri = metadata_tag.at_xpath('//rdf:RDF/*/@rdf:about', 'rdf' => 'http://www.w3.org/1999/02/22-rdf-syntax-ns#')&.to_s | ||
| extra_metadata[:origin_uri] = origin_uri |
| @@ -0,0 +1,12 @@ | |||
| <% unless resource.origin_uri.blank? %> | |||
eilmiv
approved these changes
Jul 23, 2026
| sample_id 'materials/142' # so that example id is oai:domain:materials/142 | ||
| extra_description %( | ||
| <description> | ||
| <tess-instance xmlns="http://tess.elixir-europe.org/xmlns" /> |
Collaborator
There was a problem hiding this comment.
Suggested change
| <tess-instance xmlns="http://tess.elixir-europe.org/xmlns" /> | |
| <tess-instance xmlns="http://tesshub.org/xmlns" /> |
Of course, it does not matter, but given that this domain exists I think it is cooler in this case.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of changes
origin_urito events and materials, which should point back to the URI of the resource on the original instance it was exchanged from.<description>to the OAI-PMHidentifyresponse to indicate that this is a TeSS instance.origin_uriwhen ingesting via OAI-PMH from a TeSS instance.Motivation and context
Needed a way to credit origin instance for exchanged content, since metadata may be stale/incomplete.
Screenshots
Checklist