KIT | KIT-Bibliothek | Impressum | Datenschutz

ro-crate-java v2.1.0

Tzochev, Nikola; Pfeil, Andreas ORCID iD icon 1; Chelbi, Sabrine ORCID iD icon 1
1 Scientific Computing Center (SCC), Karlsruher Institut für Technologie (KIT)

Abstract (englisch):

Research-Object-Crate is a flexible research data package format. It allows you to package or link to data and describe it in a machine-readable and human-readable way. It uses Linked Data (JSON-LD) to describe its content. The combination of a file-based package and a possibility to link to data on the Web makes the format useful for a number of use-cases.

Software libraries enable developers and users to create and modify such crates. They have the potential to enable valid crates without knowing the specification perfectly, and can be used to build this functionality into other applications.

Ro-crate-java is such a software library, written in the Java programming language. It has similar functionality as the existing implementations (ro-crate-py, ro-crate-ruby), which are implemented by the RO-Crate project. In contrast to those implementations, ro-crate-java has a strong focus on the correctness of the crates according to the specification, as well as performance. This means that ro-crate-java is especially well suited to create large crates, or large amounts of them. It can therefore, for example, be used to create crates for data in large repositories which are not packaged yet.


Download
Originalveröffentlichung
DOI: 10.5281/zenodo.17855410
Zugehörige Institution(en) am KIT Scientific Computing Center (SCC)
Publikationstyp Forschungsdaten
Publikationsdatum 08.12.2025
Erstellungsdatum 14.11.2025 - 08.12.2025
Identifikator KITopen-ID: 1000188211
HGF-Programm 46.21.05 (POF IV, LK 01) HMC
Lizenz Apache License 2.0
Externe Relationen Forschungsdaten/Software
Supplement
Schlagwörter Research Object Crate, data packaging, metadata, research data, software library, java, Helmholtz Metadata Collaboration Platform (HMC)
Liesmich

Please also read the README.md file in the source code.

🚀 Highlights

While we avoid breaking the API except for major versions, you may notice that you may need to do some little changes this time. This is because of fixes which inherently required this. But the fix on your side should be easy. In most cases you'll need to catch a possible exception when reading or writing crates and it should work again. Please tell us soon if something does not work for you!

  • Support .ELN-style crates in all zip readers and writers by @Pfeil in https://github.com/kit-data-manager/ro-crate-java/pull/258
    • 📓We now support zip files which contain the crate not directly, but have a subfolder instead. This is one of the properties of the .ELN specification.
    • 🤐 Our Zip (and ZipStream) reader will search for this implicitly, so nothing has to be changed from your side to make it work. For readers, we think this makes reading simply more reliable. Note that we do not search the whole zip file for a crate but just in the first hierarchy of subfolders. We expect only one subfolder, but to work with edge cases, ro-crate-java will consider a few more. This works around hidden thumbnail folders and other unexpected properties.
    • ✍🏼 Our Zip (and ZipStream) writer strategies have according configuration methods to make them create such files: usingElnStyle() and withRootSubdirectory() do the exact same thing, just with different naming. Some may search for ELN functionality, others just want a subfolder. For ro-crate-java this is currently the same thing.
  • Make specification examples (from readme) executable by @Pfeil in https://github.com/kit-data-manager/ro-crate-java/pull/256
    • 📄✅ Some of the examples in our guide did not work properly any more. To avoid this in future, we moved them to unit tests, where they are executable and tested. The readme now points to these examples.
  • You can now add a DataEntity without adding it to the roots "hasPart", by providing the ID of another entity (addDataEntity(entity, parentId)). This other entity needs to be in the crate already in order to validate this action. You may use this to build your hierarchies as you need.
  • The hierarchy of files and directories is (for local files) already encoded in the file paths. You can now map this automatically to hasPart/isPartOf connections using Crate::createDataEntityFileStructure.
  • Until now, we supported adding terms or full contexts (as URI) to the context. Now we also allow prefixes. They work exactly as the terms do.
  • We now add, by default, new contextual entities to the crate when writing them to disk, documenting which version of ro-crate-java generated or modified the crate. It uses one entity per CreateAction or UpdateAction and one entity per ro-crate-java version. This behaviour can be disabled and customized. For more information, look into the documentation of the CrateWriter.
  • Generalize reading and writing crates by @Pfeil (based on the work of @ThomasJejkal) in https://github.com/kit-data-manager/ro-crate-java/pull/247
    • We deprecated the old interfaces in favour of newer, generic ones. You are now able to implement readers which read/write from/to any type of location/destination. As an example, we also provide a ZipStreamReader (and Writer) which targets streams, so you do not need to store your crate on disk before sending it around!
  • Fix renaming of data set entities by @Pfeil in https://github.com/kit-data-manager/ro-crate-java/pull/253
    • We noticed there was a bug in the Zip export of DataSetEntity if you set an ID different to the file's filename. If this makes you feel you might have been affected, have a look at #254. It is now fixed, and all Writers are tested for correctness (not only the folder writer) in the same way.

What's Changed

Full Changelog: https://github.com/kit-data-manager/ro-crate-java/compare/v2.0.2...v2.1.0

Art der Forschungsdaten Software
Relationen in KITopen
KIT – Die Universität in der Helmholtz-Gemeinschaft
KITopen Landing Page