Repository navigation
Improve utilisation of ro-crate-py features - #22
Merged
Merged
Conversation
Replace hand-built JSON-LD references with the library's own APIs: - add people via rocrate.model.Person instead of a ContextEntity with a manual @type - link root and entity properties with append_to, which preserves existing values instead of overwriting them - build the CreateAction with crate.add_action, which sets the @type and takes instrument/object/result directly Root author, conformsTo and license are now arrays rather than single values, which is valid JSON-LD and is what append_to produces; three test assertions and the committed example crate are updated to match.
Root conformsTo now lists the Process Run Crate profile alongside the FL profile, with a Profile contextual entity for each as RO-Crate 1.2 requires. Validating with rocrate-validator surfaced several defects, all fixed: timestamps carried sub-second precision that failed ISO 8601 checks, the model file had no encodingFormat, File entities had no contentSize, and SoftwareApplication entities for the strategy and for dependencies outside the known-frameworks map had no url. Version is now recorded as version rather than softwareVersion, which the RO-Crate 1.2 profile requires. The crate validates against ro-crate-1.2 at REQUIRED severity with no issues. The example crate is regenerated to match.
Declare conformance to Process Run Crate and fix validation issues
stain
requested changes
Sep 15, 2026
Address review on #22: SPDX license identifiers now use the form from SPDX's RDF serialisations (http://spdx.org/licenses/MIT) rather than the .html page, in docs, examples, tests and the missing-license warning. Declare Process Run Crate 0.6, the current release.
elichad
reviewed
Oct 7, 2026
|
|
||
| author_ref = None | ||
| if author: | ||
| author_ref = _person(crate, author, "#author") |
Contributor
There was a problem hiding this comment.
thought on this fallback id - do we ensure that duplicate ids don't get created if multiple authors are added? (e.g. does it automatically become #author-2, #author-3 etc)
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.
Addresses all three suggestions in the issue.
Personhelper —_person()now buildsrocrate.model.Personinstead of aContextEntitywith a hand-written"@type": "Person".append_to— root and entity properties (conformsTo,license,author,mentions,additionalProperty) are linked withappend_torather than direct assignment, so existing values are preserved. The instrument/object/result/metric lists now collect entities directly instead of hand-built{"@id": ...}dicts — the library converts them to references.add_action— the#fl-runCreateAction is built withcrate.add_action(...), which sets the@typeand takesinstrument/object/resultas arguments (its own empty-value guards replace the manualifchecks).Closes #13