Skip to content

Support RO-Crate spec 1.2#38

Merged
fbacall merged 2 commits into
ResearchObject:masterfrom
cllde8:support-ro-crate-1.2
May 7, 2026
Merged

Support RO-Crate spec 1.2#38
fbacall merged 2 commits into
ResearchObject:masterfrom
cllde8:support-ro-crate-1.2

Conversation

@cllde8
Copy link
Copy Markdown
Contributor

@cllde8 cllde8 commented May 6, 2026

Support RO-Crate spec 1.2

  • Parameterize the metadata version with a version: kwarg and an SUPPORTED_VERSIONS allow-list, defaulting to '1.2'. @context and conformsTo URLs are derived from the version. Mirrors the pattern in ro-crate-py.
  • Reader is unchanged and remains version-tolerant via the https://w3id.org/ro/crate/ prefix match.
  • Existing callers see no API change; freshly written crates now declare 1.2 by default.

Parameterize the metadata version with a `version:` kwarg and an `SUPPORTED_VERSIONS` allow-list, defaulting to 1.2. `@context` and `conformsTo` URLs are derived from the version. Mirrors the pattern in ro -crate-py.

Reader is unchanged and remains version-tolerant via the [https://w3id.org/ro/crate/](https://w3id.org/ro/crate/%60) prefix match. Existing callers see no API change; freshly written crates now declare 1.2 by default.
Copy link
Copy Markdown
Collaborator

@fbacall fbacall left a comment

Choose a reason for hiding this comment

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

Hi, thanks so much for this. A few comments.

Comment thread lib/ro_crate/model/crate.rb Outdated
Comment thread lib/ro_crate/model/metadata.rb Outdated
Comment thread test/crate_test.rb
cllde8 added a commit to cllde8/ro-crate-ruby that referenced this pull request May 7, 2026
…parsed version

- Crate#initialize and Metadata#initialize now warn (not raise) on
  unrecognized version, allowing forward-compat with future spec versions
  that need no structural changes.
- Add Metadata#version= setter.
- Reader extracts version from parsed conformsTo and applies it via the
  setter, so reading a 1.1 crate yields crate.metadata.version == "1.1"
  instead of being silently re-stamped to the default.
- Adjust crate_test to assert warn behavior; add reader_test for 1.1.
…parsed version

- Crate#initialize and Metadata#initialize now warn (not raise) on
  unrecognized version, allowing forward-compat with future spec versions
  that need no structural changes.
- Add Metadata#version= setter.
- Reader extracts version from parsed conformsTo and applies it via the
  setter, so reading a 1.1 crate yields crate.metadata.version == "1.1"
  instead of being silently re-stamped to the default.
- Adjust crate_test to assert warn behavior; add reader_test for 1.1.
@cllde8 cllde8 force-pushed the support-ro-crate-1.2 branch from c7eed72 to 5252ed3 Compare May 7, 2026 14:47
@cllde8 cllde8 requested a review from fbacall May 7, 2026 15:03
@fbacall fbacall merged commit db4a11c into ResearchObject:master May 7, 2026
5 checks passed
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