Repository navigation
Bioschemas dumps - #1406
Open
fbacall wants to merge 7 commits into
Open
Bioschemas dumps#1406fbacall wants to merge 7 commits into
fbacall wants to merge 7 commits into
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Anonymous exports can expose private-space and shadowbanned users’ content, and publicly stored dump files bypass space authorization.
4 open issues
What changed in this PR
Adds scheduled Bioschemas JSON-LD exports for TeSS events and materials, supporting bulk ingestion into knowledge graphs.
Changes:
- Generates per-space dumps and serves them through JSON-LD index requests.
- Adds a dump-generation rake task and configurable weekly schedule.
- Distinguishes default-space filtering from global access and updates related tests.
| File | Description |
|---|---|
test/unit/bioschemas/data_dump_test.rb |
Tests dump contents, metadata, filenames, and space selection. |
test/models/space_test.rb |
Tests space filtering and assignment. |
test/controllers/users_controller_test.rb |
Updates tab counts to use current-space filtering. |
test/controllers/oai_controller_test.rb |
Expects default exports to exclude another space’s materials. |
test/controllers/content_providers_controller_test.rb |
Scopes expected material counts to the current space. |
lib/tasks/tess.rake |
Adds the Bioschemas dump task. |
lib/bioschemas/generator.rb |
Allows omitting per-record JSON-LD context. |
lib/bioschemas/data_dump.rb |
Implements dump generation, storage, and metadata access. |
config/schedule.rb |
Schedules dump generation, defaulting to Sunday evenings. |
config/schedule.example.yml |
Documents the dump schedule configuration. |
app/models/space.rb |
Marks regular spaces as non-global. |
app/models/global_space.rb |
Identifies global access explicitly. |
app/models/default_space.rb |
Distinguishes the default space from global access. |
app/models/concerns/in_space.rb |
Updates filtering and assignment for space types. |
app/controllers/materials_controller.rb |
Serves material dumps for JSON-LD requests. |
app/controllers/events_controller.rb |
Serves event dumps for JSON-LD requests. |
Review effort: Balanced
| @name = name || model.model_name.plural | ||
| @space = space | ||
| Space.with_current_space(space) do | ||
| @records = records || model.in_current_space.from_verified_users |
| @space = space | ||
| Space.with_current_space(space) do | ||
| @records = records || model.in_current_space.from_verified_users | ||
| end |
| end | ||
|
|
||
| def self.file_path_base | ||
| Rails.root.join('public', 'bioschemas_dumps') |
|
|
||
| def bioschemas | ||
| if block_given? | ||
| @records.each do |record| |
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
Motivation and context
For building knowledge graphs.
Checklist