Visualizing a crate as HTML preview
Overview
Teaching: 3 min
Exercises: 3 minQuestions
How can an RO-Crate be rendered without showing the JSON?
How can I generate a preview of the RO-Crate?
Objectives
Explore a HTML preview of an RO-Crate
(Advanced) Try the ro-crate-html tool
HTML preview
An RO-Crate can be distributed on disk, in a packaged format such as a zip file or disk image, or placed on a static website. In any of these cases, an RO-Crate can have an accompanying HTML version (ro-crate-metadata.html
) designed to be human-readable.
Navigate the RO-Crate preview
Try navigating the preview of the running example and find:
- What is the license of the rainfall CSV?
- What is the affiliation of the crate’s author?
- What does the Validity Check inspect
- What is not covered by this check?
Solution
- CC BY-NC-SA 4.0 International
- Brown University
- The context, and for root dataset: existance, valid identifier, name, description, license and date published.
- The other entities were not checked, e.g. the
affiliation
of the author.
Advanced: Generating HTML preview
If you have Node JS installed, you can install and try the ro-crate-html tool on your crate1
folder:
npm i -g ro-crate-html
rochtml crate1/ro-crate-metadata.json
Or if you have Docker, something like:
docker pull simleo/rochtml
docker run -v $(pwd):/crate -it simleo/rochtml -c ro-crate-preview_files /crate/ro-crate-metadata.json
The above will generate a ro-crate-preview.html
file within your RO-Crate Root. Experiment with modifying the Metadata file and re-generating the HTML preview to see how your rendering differs from the running example.
Key Points
RO-Crate can be rendered into a HTML preview
RO-Crate previews tend to show each entity separately
The preview HTML can be added as part of the RO-Crate