{"id":22814596,"url":"https://github.com/kit-data-manager/ro-crate-java","last_synced_at":"2026-03-05T18:31:14.252Z","repository":{"id":37524479,"uuid":"492781322","full_name":"kit-data-manager/ro-crate-java","owner":"kit-data-manager","description":"Java library to create and modify RO-Crates.","archived":false,"fork":false,"pushed_at":"2024-09-13T14:03:46.000Z","size":847,"stargazers_count":2,"open_issues_count":5,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-09-15T01:35:48.901Z","etag":null,"topics":["file-based","folder-structure","linked-data","package-format","research-object","ro-crate"],"latest_commit_sha":null,"homepage":"https://kit-data-manager.github.io/webpage/ro-crate-java/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kit-data-manager.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-05-16T10:10:50.000Z","updated_at":"2024-09-13T13:48:43.000Z","dependencies_parsed_at":"2023-02-10T03:01:33.021Z","dependency_job_id":"251f6e31-9cb4-49aa-87f2-62f333421236","html_url":"https://github.com/kit-data-manager/ro-crate-java","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kit-data-manager%2Fro-crate-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kit-data-manager%2Fro-crate-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kit-data-manager%2Fro-crate-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kit-data-manager%2Fro-crate-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kit-data-manager","download_url":"https://codeload.github.com/kit-data-manager/ro-crate-java/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229388355,"owners_count":18065252,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["file-based","folder-structure","linked-data","package-format","research-object","ro-crate"],"created_at":"2024-12-12T13:09:22.738Z","updated_at":"2026-03-05T18:31:09.218Z","avatar_url":"https://github.com/kit-data-manager.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ro-crate-java\n\n[![Java CI with Gradle](https://github.com/kit-data-manager/ro-crate-java/actions/workflows/gradle.yml/badge.svg?branch=main)](https://github.com/kit-data-manager/ro-crate-java/actions/workflows/gradle.yml)\n[![Coverage Status](https://coveralls.io/repos/github/kit-data-manager/ro-crate-java/badge.svg)](https://coveralls.io/github/kit-data-manager/ro-crate-java)\n[![CodeQL](https://github.com/kit-data-manager/ro-crate-java/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/kit-data-manager/ro-crate-java/actions/workflows/codeql-analysis.yml)\n[![Publish to Maven Central / OSSRH](https://github.com/kit-data-manager/ro-crate-java/actions/workflows/publishRelease.yml/badge.svg)](https://github.com/kit-data-manager/ro-crate-java/actions/workflows/publishRelease.yml)\n\nA Java library to create and modify RO-Crates.\nThe aim of this implementation is to **not** require too deep knowledge of the specification,\nand avoiding crates which do not fully comply to the specification, at the same time.\n\n## Use it in your application\n\n- [Instructions for your build manager (e.g., Gradle, Maven, etc.)](https://central.sonatype.com/artifact/edu.kit.datamanager/ro-crate-java)\n- [Quick-Start](#quick-start)\n- [Adapting Specification Examples](#adapting-the-specification-examples)\n- [Related Publications](https://publikationen.bibliothek.kit.edu/publikationslisten/get.php?referencing=all\u0026external_publications=kit\u0026lang=de\u0026format=html\u0026style=kit-3lines-title_b-authors-other\u0026consider_suborganizations=true\u0026order=desc%20year\u0026contributors=%5B%5B%5B%5D%2C%5B%22p20751.105%22%5D%5D%5D\u0026title_contains=crate)\n\n## Build the library / documentation\n\n- Building (with tests): `./gradlew clean build`\n- Building (without tests): `./gradlew clean build -x test`\n- Building with release profile: `./gradlew -Dprofile=release clean build`\n- Doing a release: `./gradlew -Dprofile=release clean build release`\n  - Will prompt you about version number to use and next version number\n  - Will make a git tag which can later be used in a GitHub release\n    - A GitHub release will trigger the CI for publication. See also `.github/workflows/publishRelease.yml`.\n- Build documentation: `./gradlew javadoc`\n\nOn Windows, replace `./gradlew` with `gradlew.bat`.\n\n## RO-Crate Specification Compatibility\n\n- ✅ Version 1.1\n- 🛠️ Version 1.2-DRAFT\n  - ✅ Reading and writing crates with additional profiles or specifications ([examples for reading](src/test/java/edu/kit/datamanager/ro_crate/reader/RoCrateReaderSpec12Test.java), [examples for writing](src/test/java/edu/kit/datamanager/ro_crate/writer/RoCrateWriterSpec12Test.java))\n  - ✅ Adding profiles or other specifications to a crate ([examples](src/test/java/edu/kit/datamanager/ro_crate/crate/BuilderSpec12Test.java))\n\n## Quick-start\n### Example for a basic crate from [RO-Crate website](https://www.researchobject.org/ro-crate/1.1/root-data-entity.html#ro-crate-metadata-file-descriptor)\n```java\nRoCrate roCrate = new RoCrateBuilder(\"name\", \"description\", \"datePublished\", \"licenseIdentifier\").build();\n```\n\n### Example adding a File (Data Entity) and a context pair\n```java\nRoCrate roCrate = new RoCrateBuilder(\"name\", \"description\", \"datePublished\", \"licenseIdentifier\")\n    .addValuePairToContext(\"Station\", \"www.station.com\")\n    .addUrlToContext(\"contextUrl\")\n    .addDataEntity(\n      new FileEntity.FileEntityBuilder()\n        .setId(\"survey-responses-2019.csv\")\n        .addProperty(\"name\", \"Survey responses\")\n        .addProperty(\"contentSize\", \"26452\")\n        .addProperty(\"encodingFormat\", \"text/csv\")\n        .build()\n    )\n    .addDataEntity(...)\n    ...\n    .addContextualEntity(...)\n    ...\n    .build();\n```\n\nThe library currently comes with three specialized DataEntities:\n\n1. `DataSetEntity`\n2. `FileEntity` (used in the example above)\n3. `WorkflowEntity`\n\nIf another type of `DataEntity` is required, the base class `DataEntity` can be used. Example:\n```java\nnew DataEntity.DataEntityBuilder()\n    .addType(\"CreativeWork\")\n    .setId(\"ID\")\n    .addProperty(\"property from schema.org/Creativework\", \"value\")\n    .build();\n```\nNote that here you are supposed to add the type of your `DataEntity` because it is not known.\n\nA `DataEntity` and its subclasses can have a file located on the web. Example:\n\nExample adding file:\n```java\nnew FileEntity.FileEntityBuilder()\n    .addContent(URI.create(\"https://github.com/kit-data-manager/ro-crate-java/issues/5\"))\n    .addProperty(\"description\", \"my new file that I added\")\n    .build();\n```\n\nA `DataEntity` and its subclasses can have a local file associated with them,\ninstead of one located on the web (which link is the ID of the data entity). Example:\n\nExample adding file:\n```java\nnew FileEntity.FileEntityBuilder()\n    .addContent(Paths.get(\"file\"), \"new_file.txt\")\n    .addProperty(\"description\", \"my new local file that I added\")\n    .build();\n```\n\n### Contextual Entities\n\nContextual entities cannot be associated with a file (they are pure metadata).\n\nTo add a contextual entity to a crate you use the function `.addContextualEntity(ContextualEntity entity)`.\nSome types of derived/specializes entities are:\n1. `OrganizationEntity`\n2. `PersonEntity`\n3. `PlaceEntity`\n\nIf you need another type of contextual entity, use the base class `ContextualEntity`.\n\nThe library provides a way to automatically create contextual entities from external providers. Currently, support for [ORCID](https://orcid.org/) and [ROR](https://ror.org/) is implemented. Example:\n```java\nPersonEntity person = ORCIDProvider.getPerson(\"https://orcid.org/*\")\nOrganizationEntity organization = RORProvider.getOrganization(\"https://ror.org/*\");\n```\n\n### Writing Crate to folder or zip file\n\nWriting to folder:\n```java\nRoCrateWriter folderRoCrateWriter = new RoCrateWriter(new FolderWriter());\nfolderRoCrateWriter.save(roCrate, \"destination\");\n```\n\nWriting to zip file:\n```java\nRoCrateWriter roCrateZipWriter = new RoCrateWriter(new ZipWriter());\nroCrateZipWriter.save(roCrate, \"destination\");\n```\n\nMore writing strategies can be implemented, if required.\n\n### Reading / importing Crate from folder or zip\n\nReading from folder:\n```java\nRoCrateReader roCrateFolderReader = new RoCrateReader(new FolderReader());\nRoCrate res = roCrateFolderReader.readCrate(\"source\");\n```\n\nReading from zip file:\n```java\nRoCrateReader roCrateFolderReader = new RoCrateReader(new ZipReader());\nRoCrate crate = roCrateFolderReader.readCrate(\"source\");\n```\n\n### RO-Crate Website (HTML preview file)\nBy setting the preview to an `AutomaticPreview`, the library will automatically create a preview using the [ro-crate-html-js](https://www.npmjs.com/package/ro-crate-html-js) tool.\nIt has to be installed using `npm install --global ro-crate-html-js` in order to use it.\nIf you want to use a custom-made preview, you can set it using the `CustomPreview` class. `AutomaticPreview` is currently **not** set by default.\n```java\nRoCrate roCrate = new RoCrateBuilder(\"name\", \"description\", \"datePublished\", \"licenseIdentifier\")\n    .setPreview(new AutomaticPreview())\n    .build();\n```\n\n### RO-Crate validation (machine-readable crate profiles)\nRight now, the only implemented way of validating a RO-crate is to use a [JSON-Schema](https://json-schema.org/) that the crates metadata JSON file should match. JSON-Schema is an established standard and therefore a good choice for a crate profile. Example:\n\n```java\nValidator validator = new Validator(new JsonSchemaValidation(\"./schema.json\"));\nboolean valid = validator.validate(crate);\n```\n\n## Adapting the specification examples\n\nThis section describes how to generate the [official specifications examples](https://www.researchobject.org/ro-crate/1.1/root-data-entity.html#minimal-example-of-ro-crate). Each example first shows the ro-crate-metadata.json and, below that, the required Java code to generate it.\n\n### [Minimal example](https://www.researchobject.org/ro-crate/1.1/root-data-entity.html#minimal-example-of-ro-crate)\n\n```json\n{ \"@context\": \"https://w3id.org/ro/crate/1.1/context\", \n  \"@graph\": [\n\n {\n    \"@type\": \"CreativeWork\",\n    \"@id\": \"ro-crate-metadata.json\",\n    \"conformsTo\": {\"@id\": \"https://w3id.org/ro/crate/1.1\"},\n    \"about\": {\"@id\": \"./\"}\n },  \n {\n    \"@id\": \"./\",\n    \"identifier\": \"https://doi.org/10.4225/59/59672c09f4a4b\",\n    \"@type\": \"Dataset\",\n    \"datePublished\": \"2017\",\n    \"name\": \"Data files associated with the manuscript:Effects of facilitated family case conferencing for ...\",\n    \"description\": \"Palliative care planning for nursing home residents with advanced dementia ...\",\n    \"license\": {\"@id\": \"https://creativecommons.org/licenses/by-nc-sa/3.0/au/\"}\n },\n {\n  \"@id\": \"https://creativecommons.org/licenses/by-nc-sa/3.0/au/\",\n  \"@type\": \"CreativeWork\",\n  \"description\": \"This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Australia License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/au/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.\",\n  \"identifier\": \"https://creativecommons.org/licenses/by-nc-sa/3.0/au/\",\n  \"name\": \"Attribution-NonCommercial-ShareAlike 3.0 Australia (CC BY-NC-SA 3.0 AU)\"\n }\n ]\n}\n```\n\nHere, everything is created manually.\nFor the following examples, more convenient creation methods are used.\n\n```java\n  RoCrate crate = new RoCrate();\n\n    ContextualEntity license = new ContextualEntity.ContextualEntityBuilder()\n        .addType(\"CreativeWork\")\n        .setId(\"https://creativecommons.org/licenses/by-nc-sa/3.0/au/\")\n        .addProperty(\"description\", \"This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Australia License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/au/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.\")\n        .addProperty(\"identifier\", \"https://creativecommons.org/licenses/by-nc-sa/3.0/au/\")\n        .addProperty(\"name\", \"Attribution-NonCommercial-ShareAlike 3.0 Australia (CC BY-NC-SA 3.0 AU)\")\n        .build();\n\n    crate.setRootDataEntity(new RootDataEntity.RootDataEntityBuilder()\n        .addProperty(\"identifier\", \"https://doi.org/10.4225/59/59672c09f4a4b\")\n        .addProperty(\"datePublished\", \"2017\")\n        .addProperty(\"name\", \"Data files associated with the manuscript:Effects of facilitated family case conferencing for ...\")\n        .addProperty(\"description\", \"Palliative care planning for nursing home residents with advanced dementia ...\")\n        .setLicense(license)\n        .build());\n\n    crate.setJsonDescriptor(new ContextualEntity.ContextualEntityBuilder()\n        .setId(\"ro-crate-metadata.json\")\n        .addType(\"CreativeWork\")\n        .addIdProperty(\"about\", \"./\")\n        .addIdProperty(\"conformsTo\", \"https://w3id.org/ro/crate/1.1\")\n        .build()\n    );\n    crate.addContextualEntity(license);\n```\n\n### [Example with files](https://www.researchobject.org/ro-crate/1.1/data-entities.html#example-linking-to-a-file-and-folders)\n\n```json\n{ \"@context\": \"https://w3id.org/ro/crate/1.1/context\",\n  \"@graph\": [\n    {\n      \"@type\": \"CreativeWork\",\n      \"@id\": \"ro-crate-metadata.json\",\n      \"conformsTo\": {\"@id\": \"https://w3id.org/ro/crate/1.1\"},\n      \"about\": {\"@id\": \"./\"}\n    },  \n    {\n      \"@id\": \"./\",\n      \"@type\": [\n        \"Dataset\"\n      ],\n      \"hasPart\": [\n        {\n          \"@id\": \"cp7glop.ai\"\n        },\n        {\n          \"@id\": \"lots_of_little_files/\"\n        }\n      ]\n    },\n    {\n      \"@id\": \"cp7glop.ai\",\n      \"@type\": \"File\",\n      \"name\": \"Diagram showing trend to increase\",\n      \"contentSize\": \"383766\",\n      \"description\": \"Illustrator file for Glop Pot\",\n      \"encodingFormat\": \"application/pdf\"\n    },\n    {\n      \"@id\": \"lots_of_little_files/\",\n      \"@type\": \"Dataset\",\n      \"name\": \"Too many files\",\n      \"description\": \"This directory contains many small files, that we're not going to describe in detail.\"\n    }\n  ]\n}\n```\n\nHere we use the inner builder classes for the construction of the crate.\nDoing so, the Metadata File Descriptor and the Root Data Entity entities are added automatically.\n`setSource()` is used to provide the actual location of these Data Entities (if they are not remote).\nThe Data Entity file in the crate will have the name of the entity's ID.\n\n```java\n  RoCrate crate = new RoCrate.RoCrateBuilder()\n        .addDataEntity(\n            new FileEntity.FileEntityBuilder()\n                .addContent (Paths.get(\"path to file\"), \"cp7glop.ai\")\n                .addProperty(\"name\", \"Diagram showing trend to increase\")\n                .addProperty(\"contentSize\", \"383766\")\n                .addProperty(\"description\", \"Illustrator file for Glop Pot\")\n                .setEncodingFormat(\"application/pdf\")\n                .build()\n        )\n        .addDataEntity(\n            new DataSetEntity.DataSetBuilder()\n                .addContent (Paths.get(\"path_to_files\"), \"lots_of_little_files/\")\n                .addProperty(\"name\", \"Too many files\")\n                .addProperty(\"description\", \"This directory contains many small files, that we're not going to describe in detail.\")\n                .build()\n        )\n        .build();\n```\n\n### [Example with web resources](https://www.researchobject.org/ro-crate/1.1/data-entities.html#web-based-data-entities)\n\n```json\n{ \"@context\": \"https://w3id.org/ro/crate/1.1/context\",\n  \"@graph\": [\n    {\n        \"@type\": \"CreativeWork\",\n        \"@id\": \"ro-crate-metadata.json\",\n        \"conformsTo\": {\"@id\": \"https://w3id.org/ro/crate/1.1\"},\n        \"about\": {\"@id\": \"./\"}\n  },  \n  {\n    \"@id\": \"./\",\n    \"@type\": [\n      \"Dataset\"\n    ],\n    \"hasPart\": [\n      {\n        \"@id\": \"survey-responses-2019.csv\"\n      },\n      {\n        \"@id\": \"https://zenodo.org/record/3541888/files/ro-crate-1.0.0.pdf\"\n      },\n      ]\n  },\n  {\n    \"@id\": \"survey-responses-2019.csv\",\n    \"@type\": \"File\",\n    \"name\": \"Survey responses\",\n    \"contentSize\": \"26452\",\n    \"encodingFormat\": \"text/csv\"\n  },\n  {\n    \"@id\": \"https://zenodo.org/record/3541888/files/ro-crate-1.0.0.pdf\",\n    \"@type\": \"File\",\n    \"name\": \"RO-Crate specification\",\n    \"contentSize\": \"310691\",\n    \"description\": \"RO-Crate specification\",\n    \"encodingFormat\": \"application/pdf\"\n  }\n]\n}\n```\n\nThe web resource does not use `.setSource()`, but uses the ID to indicate the file's location.\n\n```java\n RoCrate crate = new RoCrate.RoCrateBuilder()\n        .addDataEntity(\n            new FileEntity.FileEntityBuilder()\n                .addContent (Paths.get(\"README.md\"), \"survey-responses-2019.csv\")\n                .addProperty(\"name\", \"Survey responses\")\n                .addProperty(\"contentSize\", \"26452\")\n                .setEncodingFormat(\"text/csv\")\n                .build()\n        )\n        .addDataEntity(\n            new FileEntity.FileEntityBuilder()\n                .addContent(URI.create(\"https://zenodo.org/record/3541888/files/ro-crate-1.0.0.pdf\"))\n                .addProperty(\"name\", \"RO-Crate specification\")\n                .addProperty(\"contentSize\", \"310691\")\n                .addProperty(\"description\", \"RO-Crate specification\")\n                .setEncodingFormat(\"application/pdf\")\n                .build()\n        )\n        .build();\n```\n\n### [Example with file, author, location](https://www.researchobject.org/ro-crate/1.1/appendix/jsonld.html)\n\n```json\n{ \"@context\": \"https://w3id.org/ro/crate/1.1/context\",\n  \"@graph\": [\n\n    {\n      \"@type\": \"CreativeWork\",\n      \"@id\": \"ro-crate-metadata.json\",\n      \"conformsTo\": {\"@id\": \"https://w3id.org/ro/crate/1.1\"},\n      \"about\": {\"@id\": \"./\"},\n      \"description\": \"RO-Crate Metadata File Descriptor (this file)\"\n    },\n    {\n      \"@id\": \"./\",\n      \"@type\": \"Dataset\",\n      \"name\": \"Example RO-Crate\",\n      \"description\": \"The RO-Crate Root Data Entity\",\n      \"datePublished\": \"2020\",\n      \"license\": {\"@id\": \"https://spdx.org/licenses/CC-BY-NC-SA-4.0\"},\n      \"hasPart\": [\n        {\"@id\": \"data1.txt\"},\n        {\"@id\": \"data2.txt\"}\n      ]\n    },\n\n\n    {\n      \"@id\": \"data1.txt\",\n      \"@type\": \"File\",\n      \"description\": \"One of hopefully many Data Entities\",\n      \"author\": {\"@id\": \"#alice\"},\n      \"contentLocation\":  {\"@id\": \"http://sws.geonames.org/8152662/\"}\n    },\n    {\n      \"@id\": \"data2.txt\",\n      \"@type\": \"File\"\n    },\n\n    {\n      \"@id\": \"#alice\",\n      \"@type\": \"Person\",\n      \"name\": \"Alice\",\n      \"description\": \"One of hopefully many Contextual Entities\"\n    },\n    {\n      \"@id\": \"http://sws.geonames.org/8152662/\",\n      \"@type\": \"Place\",\n      \"name\": \"Catalina Park\"\n    }\n ]\n}\n```\n\nIf there is no special method for including relative entities (ID properties) one can use `.addIdProperty(\"key\",\"value\")`.\n\n```java\n PersonEntity alice = new PersonEntity.PersonEntityBuilder()\n        .setId(\"#alice\")\n        .addProperty(\"name\", \"Alice\")\n        .addProperty(\"description\", \"One of hopefully many Contextual Entities\")\n        .build();\n    PlaceEntity park = new PlaceEntity.PlaceEntityBuilder()\n        .addContent(URI.create(\"http://sws.geonames.org/8152662/\"))\n        .addProperty(\"name\", \"Catalina Park\")\n        .build();\n\n    RoCrate crate = new RoCrate.RoCrateBuilder(\"Example RO-Crate\", \"The RO-Crate Root Data Entity\", \"2020\", \"https://spdx.org/licenses/CC-BY-NC-SA-4.0\")\n        .addContextualEntity(park)\n        .addContextualEntity(alice)\n        .addDataEntity(\n            new FileEntity.FileEntityBuilder()\n                .addContent(Paths.get(\".......\"), \"data2.txt\")\n                .build()\n        )\n        .addDataEntity(\n            new FileEntity.FileEntityBuilder()\n                .addContent(Paths.get(\".......\"), \"data1.txt\")\n                .addProperty(\"description\", \"One of hopefully many Data Entities\")\n                .addAuthor(alice.getId())\n                .addIdProperty(\"contentLocation\", park)\n                .build()\n        )\n        .build();\n\n```\n### [Example with computational workflow](https://www.researchobject.org/ro-crate/1.1/workflows.html#complete-workflow-example)\n\n```json\n{ \"@context\": \"https://w3id.org/ro/crate/1.1/context\", \n  \"@graph\": [\n    {\n      \"@type\": \"CreativeWork\",\n      \"@id\": \"ro-crate-metadata.json\",\n      \"conformsTo\": {\"@id\": \"https://w3id.org/ro/crate/1.1\"},\n      \"about\": {\"@id\": \"./\"}\n    },\n    {\n      \"@id\": \"./\",\n      \"@type\": \"Dataset\",\n      \"name\": \"Example RO-Crate\",\n      \"description\": \"The RO-Crate Root Data Entity\",\n      \"datePublished\": \"2020\",\n      \"license\": {\"@id\": \"https://spdx.org/licenses/CC-BY-NC-SA-4.0\"},\n      \"hasPart\": [\n          { \"@id\": \"workflow/alignment.knime\" }\n      ]\n    },\n    {\n      \"@id\": \"workflow/alignment.knime\",  \n      \"@type\": [\"File\", \"SoftwareSourceCode\", \"ComputationalWorkflow\"],\n      \"conformsTo\": \n        {\"@id\": \"https://bioschemas.org/profiles/ComputationalWorkflow/0.5-DRAFT-2020_07_21/\"},\n      \"name\": \"Sequence alignment workflow\",\n      \"programmingLanguage\": {\"@id\": \"#knime\"},\n      \"creator\": {\"@id\": \"#alice\"},\n      \"dateCreated\": \"2020-05-23\",\n      \"license\": { \"@id\": \"https://spdx.org/licenses/CC-BY-NC-SA-4.0\"},\n      \"input\": [\n        { \"@id\": \"#36aadbd4-4a2d-4e33-83b4-0cbf6a6a8c5b\"}\n      ],\n      \"output\": [\n        { \"@id\": \"#6c703fee-6af7-4fdb-a57d-9e8bc4486044\"},\n        { \"@id\": \"#2f32b861-e43c-401f-8c42-04fd84273bdf\"}\n      ],\n      \"sdPublisher\": {\"@id\": \"#workflow-hub\"},\n      \"url\": \"http://example.com/workflows/alignment\",\n      \"version\": \"0.5.0\"\n    },\n    {\n      \"@id\": \"#36aadbd4-4a2d-4e33-83b4-0cbf6a6a8c5b\",\n      \"@type\": \"FormalParameter\",\n      \"conformsTo\": {\"@id\": \"https://bioschemas.org/profiles/FormalParameter/0.1-DRAFT-2020_07_21/\"},\n      \"name\": \"genome_sequence\",\n      \"valueRequired\": true,\n      \"additionalType\": {\"@id\": \"http://edamontology.org/data_2977\"},\n      \"format\": {\"@id\": \"http://edamontology.org/format_1929\"}\n    },\n    {\n      \"@id\": \"#6c703fee-6af7-4fdb-a57d-9e8bc4486044\",\n      \"@type\": \"FormalParameter\",\n      \"conformsTo\": {\"@id\": \"https://bioschemas.org/profiles/FormalParameter/0.1-DRAFT-2020_07_21/\"},\n      \"name\": \"cleaned_sequence\",\n      \"additionalType\": {\"@id\": \"http://edamontology.org/data_2977\"},\n      \"encodingFormat\": {\"@id\": \"http://edamontology.org/format_2572\"}\n    },\n    {\n      \"@id\": \"#2f32b861-e43c-401f-8c42-04fd84273bdf\",\n      \"@type\": \"FormalParameter\",\n      \"conformsTo\": {\"@id\": \"https://bioschemas.org/profiles/FormalParameter/0.1-DRAFT-2020_07_21/\"},\n      \"name\": \"sequence_alignment\",\n      \"additionalType\": {\"@id\": \"http://edamontology.org/data_1383\"},\n      \"encodingFormat\": {\"@id\": \"http://edamontology.org/format_1982\"}\n    },\n    {\n      \"@id\": \"https://spdx.org/licenses/CC-BY-NC-SA-4.0\",\n      \"@type\": \"CreativeWork\",\n      \"name\": \"Creative Commons Attribution Non Commercial Share Alike 4.0 International\",\n      \"alternateName\": \"CC-BY-NC-SA-4.0\"\n    },\n    {\n      \"@id\": \"#knime\",\n      \"@type\": \"ProgrammingLanguage\",\n      \"name\": \"KNIME Analytics Platform\",\n      \"alternateName\": \"KNIME\",\n      \"url\": \"https://www.knime.com/whats-new-in-knime-41\",\n      \"version\": \"4.1.3\"\n    },\n    {\n      \"@id\": \"#alice\",\n      \"@type\": \"Person\",\n      \"name\": \"Alice Brown\"\n    },\n    {\n      \"@id\": \"#workflow-hub\",\n      \"@type\": \"Organization\",\n      \"name\": \"Example Workflow Hub\",\n      \"url\":\"http://example.com/workflows/\"\n    },\n    {\n      \"@id\": \"http://edamontology.org/format_1929\",\n      \"@type\": \"Thing\",\n      \"name\": \"FASTA sequence format\"\n    },\n    {\n      \"@id\": \"http://edamontology.org/format_1982\",\n      \"@type\": \"Thing\",\n      \"name\": \"ClustalW alignment format\"\n    },\n    {\n      \"@id\": \"http://edamontology.org/format_2572\",\n      \"@type\": \"Thing\",\n      \"name\": \"BAM format\"\n    },\n    {\n      \"@id\": \"http://edamontology.org/data_2977\",\n      \"@type\": \"Thing\",\n      \"name\": \"Nucleic acid sequence\"\n    },\n    {\n      \"@id\": \"http://edamontology.org/data_1383\",\n      \"@type\": \"Thing\",\n      \"name\": \"Nucleic acid sequence alignment\"\n    }\n  ]\n}\n```\n\n\n```java\n   ContextualEntity license = new ContextualEntity.ContextualEntityBuilder()\n        .addType(\"CreativeWork\")\n        .setId(\"https://spdx.org/licenses/CC-BY-NC-SA-4.0\")\n        .addProperty(\"name\", \"Creative Commons Attribution Non Commercial Share Alike 4.0 International\")\n        .addProperty(\"alternateName\", \"CC-BY-NC-SA-4.0\")\n        .build();\n    ContextualEntity knime = new ContextualEntity.ContextualEntityBuilder()\n        .setId(\"#knime\")\n        .addType(\"ProgrammingLanguage\")\n        .addProperty(\"name\", \"KNIME Analytics Platform\")\n        .addProperty(\"alternateName\", \"KNIME\")\n        .addProperty(\"url\", \"https://www.knime.com/whats-new-in-knime-41\")\n        .addProperty(\"version\", \"4.1.3\")\n        .build();\n    OrganizationEntity workflowHub = new OrganizationEntity.OrganizationEntityBuilder()\n        .setId(\"#workflow-hub\")\n        .addProperty(\"name\", \"Example Workflow Hub\")\n        .addProperty(\"url\", \"http://example.com/workflows/\")\n        .build();\n    ContextualEntity fasta = new ContextualEntity.ContextualEntityBuilder()\n        .setId(\"http://edamontology.org/format_1929\")\n        .addType(\"Thing\")\n        .addProperty(\"name\", \"FASTA sequence format\")\n        .build();\n    ContextualEntity clustalW = new ContextualEntity.ContextualEntityBuilder()\n        .setId(\"http://edamontology.org/format_1982\")\n        .addType(\"Thing\")\n        .addProperty(\"name\", \"ClustalW alignment format\")\n        .build();\n    ContextualEntity ban = new ContextualEntity.ContextualEntityBuilder()\n        .setId(\"http://edamontology.org/format_2572\")\n        .addType(\"Thing\")\n        .addProperty(\"name\", \"BAM format\")\n        .build();\n    ContextualEntity nucSec = new ContextualEntity.ContextualEntityBuilder()\n        .setId(\"http://edamontology.org/data_2977\")\n        .addType(\"Thing\")\n        .addProperty(\"name\", \"Nucleic acid sequence\")\n        .build();\n    ContextualEntity nucAlign = new ContextualEntity.ContextualEntityBuilder()\n        .setId(\"http://edamontology.org/data_1383\")\n        .addType(\"Thing\")\n        .addProperty(\"name\", \"Nucleic acid sequence alignment\")\n        .build();\n    PersonEntity alice = new PersonEntity.PersonEntityBuilder()\n        .setId(\"#alice\")\n        .addProperty(\"name\", \"Alice Brown\")\n        .build();\n    ContextualEntity requiredParam = new ContextualEntity.ContextualEntityBuilder()\n        .addType(\"FormalParameter\")\n        .setId(\"#36aadbd4-4a2d-4e33-83b4-0cbf6a6a8c5b\")\n        .addProperty(\"name\", \"genome_sequence\")\n        .addProperty(\"valueRequired\", true)\n        .addIdProperty(\"conformsTo\", \"https://bioschemas.org/profiles/FormalParameter/0.1-DRAFT-2020_07_21/\")\n        .addIdProperty(\"additionalType\", nucSec)\n        .addIdProperty(\"encodingFormat\", fasta)\n        .build();\n\n    ContextualEntity clnParam = new ContextualEntity.ContextualEntityBuilder()\n        .addType(\"FormalParameter\")\n        .setId(\"#6c703fee-6af7-4fdb-a57d-9e8bc4486044\")\n        .addProperty(\"name\", \"cleaned_sequence\")\n        .addIdProperty(\"conformsTo\", \"https://bioschemas.org/profiles/FormalParameter/0.1-DRAFT-2020_07_21/\")\n        .addIdProperty(\"additionalType\", nucSec)\n        .addIdProperty(\"encodingFormat\", ban)\n        .build();\n\n    ContextualEntity alignParam = new ContextualEntity.ContextualEntityBuilder()\n        .addType(\"FormalParameter\")\n        .setId(\"#2f32b861-e43c-401f-8c42-04fd84273bdf\")\n        .addProperty(\"name\", \"sequence_alignment\")\n        .addIdProperty(\"conformsTo\", \"https://bioschemas.org/profiles/FormalParameter/0.1-DRAFT-2020_07_21/\")\n        .addIdProperty(\"additionalType\", nucAlign)\n        .addIdProperty(\"encodingFormat\", clustalW)\n        .build();\n\n    RoCrate crate = new RoCrate.RoCrateBuilder(\"Example RO-Crate\", \"The RO-Crate Root Data Entity\", \"2020\", \"https://spdx.org/licenses/CC-BY-NC-SA-4.0\")\n        .addContextualEntity(license)\n        .addContextualEntity(knime)\n        .addContextualEntity(workflowHub)\n        .addContextualEntity(fasta)\n        .addContextualEntity(clustalW)\n        .addContextualEntity(ban)\n        .addContextualEntity(nucSec)\n        .addContextualEntity(nucAlign)\n        .addContextualEntity(alice)\n        .addContextualEntity(requiredParam)\n        .addContextualEntity(clnParam)\n        .addContextualEntity(alignParam)\n        .addDataEntity(\n            new WorkflowEntity.WorkflowEntityBuilder()\n                .setId(\"workflow/alignment.knime\")\n                .setSource(new File(\"src\"))\n                .addIdProperty(\"conformsTo\", \"https://bioschemas.org/profiles/ComputationalWorkflow/0.5-DRAFT-2020_07_21/\")\n                .addProperty(\"name\", \"Sequence alignment workflow\")\n                .addIdProperty(\"programmingLanguage\", \"#knime\")\n                .addAuthor(\"#alice\")\n                .addProperty(\"dateCreated\", \"2020-05-23\")\n                .setLicense(\"https://spdx.org/licenses/CC-BY-NC-SA-4.0\")\n                .addInput(\"#36aadbd4-4a2d-4e33-83b4-0cbf6a6a8c5b\")\n                .addOutput(\"#6c703fee-6af7-4fdb-a57d-9e8bc4486044\")\n                .addOutput(\"#2f32b861-e43c-401f-8c42-04fd84273bdf\")\n                .addProperty(\"url\", \"http://example.com/workflows/alignment\")\n                .addProperty(\"version\", \"0.5.0\")\n                .addIdProperty(\"sdPublisher\", \"#workflow-hub\")\n                .build()\n\n        )\n        .build();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkit-data-manager%2Fro-crate-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkit-data-manager%2Fro-crate-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkit-data-manager%2Fro-crate-java/lists"}