Skip to content

Bioschemas dumps - #1406

Open
fbacall wants to merge 7 commits into
masterfrom
bioschemas-dumps
Open

fbacall wants to merge 7 commits into
masterfrom
bioschemas-dumps

Conversation

@fbacall

@fbacall fbacall commented Nov 24, 2026

Copy link
Copy Markdown
Member

Summary of changes

  • Generates a dump of all Bioschemas JSON-LD for events and materials (for each space) on a schedule.
  • Serves the generated dumps if JSON-LD is requested at the events and materials indexes.

Motivation and context

For building knowledge graphs.

Checklist

  • I have read and followed the CONTRIBUTING guide.
  • I confirm that I have the authority necessary to make this contribution on behalf of its copyright owner and agree to license it to the TeSS codebase under the BSD license.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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|
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants