Support RO-Crate spec 1.2#38
Merged
Merged
Conversation
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.
fbacall
reviewed
May 7, 2026
Collaborator
fbacall
left a comment
There was a problem hiding this comment.
Hi, thanks so much for this. A few comments.
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.
c7eed72 to
5252ed3
Compare
fbacall
approved these changes
May 7, 2026
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.
Support RO-Crate spec 1.2
version:kwarg and anSUPPORTED_VERSIONSallow-list, defaulting to '1.2'.@contextandconformsToURLs are derived from the version. Mirrors the pattern in ro-crate-py.