A Java library to create and modify RO-Crates. The aim of this implementation is to not require too deep knowledge of the specification, and avoiding crates which do not fully comply to the specification, at the same time.
- Instructions for your build manager (e.g., Gradle, Maven, etc.)
- Quick-Start
- JavaDoc Documentation
- Related Publications
- Building (with tests):
./gradlew clean build
- Building (without tests):
./gradlew clean build -x test
- Building with release profile:
./gradlew -Dprofile=release clean build
- Doing a release:
./gradlew -Dprofile=release clean build release
- Will prompt you about version number to use and next version number
- Will make a git tag which can later be used in a GitHub release
- A GitHub release will trigger the CI for publication. See also
.github/workflows/publishRelease.yml
.
- A GitHub release will trigger the CI for publication. See also
- Build documentation:
./gradlew javadoc
On Windows, replace ./gradlew
with gradlew.bat
.
- ✅ Version 1.1 (Extracted examples as well-described unit tests/guide)
- 🛠️ Version 1.2-DRAFT
- ✅ Reading and writing crates with additional profiles or specifications (examples for reading, examples for writing)
- ✅ Adding profiles or other specifications to a crate (examples)
ro-crate-java
makes use of the builder pattern to guide the user to create a valid RO-Crate, similar to:
RoCrate myFirstCrate = STARTER_CRATE
.addDataEntity(
new FileEntity.FileEntityBuilder()
.setId("path/within/crate/survey-responses-2019.csv")
.setLocation(Paths.get("path/to/current/location/experiment.csv"))
.addProperty("name", "Survey responses")
.addProperty("contentSize", "26452")
.addProperty("encodingFormat", "text/csv")
.build()
)
.addDataEntity(/*...*/)
.addContextualEntity(/*...*/)
.build();
A built or imported crate can of course also be modified afterwards. Take a look at our further documentation:
- There is a well-documented example-driven guide in LearnByExampleTest.java to help you get started.
- You may also be interested in the examples we extracted from the specification in version 1.1, which are available in ExamplesOfSpecificationV1p1Test.java.
- There is a module with all well-described guiding tests available.
- The JavaDoc Documentation is also available online.