You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -37,162 +38,27 @@ On Windows, replace `./gradlew` with `gradlew.bat`.
37
38
38
39
## Quick-start
39
40
40
-
> Note: We have a [module with well-described unit tests to guide you](src/test/java/edu/kit/datamanager/ro_crate/examples/), describing how to generate official examples extracted from the specification.
41
-
> Specifically, the examples for the [specification in version 1.1](https://www.researchobject.org/ro-crate/1.1/) are available in [ExamplesOfSpecificationV1p1Test.java](src/test/java/edu/kit/datamanager/ro_crate/examples/ExamplesOfSpecificationV1p1Test.java).
41
+
` ro-crate-java` makes use of the builder pattern to guide the user to create a valid RO-Crate, similar to:
42
42
43
-
### 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)
.addProperty("description", "my new file that I added")
91
-
.build();
92
-
```
93
-
94
-
A `DataEntity` and its subclasses can have a local file associated with them,
95
-
instead of one located on the web (which link is the ID of the data entity). Example:
96
-
97
-
Example adding file:
98
-
```java
99
-
newFileEntity.FileEntityBuilder()
100
-
.addContent(Paths.get("file"), "new_file.txt")
101
-
.addProperty("description", "my new local file that I added")
102
-
.build();
103
-
```
104
-
105
-
### Contextual Entities
106
-
107
-
Contextual entities cannot be associated with a file (they are pure metadata).
108
-
109
-
To add a contextual entity to a crate you use the function `.addContextualEntity(ContextualEntity entity)`.
110
-
Some types of derived/specializes entities are:
111
-
1.`OrganizationEntity`
112
-
2.`PersonEntity`
113
-
3.`PlaceEntity`
114
-
115
-
If you need another type of contextual entity, use the base class `ContextualEntity`.
116
-
117
-
The 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:
118
-
```java
119
-
PersonEntity person =ORCIDProvider.getPerson("https://orcid.org/*")
ro-crate-java offers tree different kinds of previews:
167
-
168
-
* AutomaticPreview: Uses third-party library [ro-crate-html-js](https://www.npmjs.com/package/ro-crate-html-js), which must be installed separately.
169
-
* CustomPreview: Pure Java-based preview using an included template processed by the FreeMarker template engine. At the same time, CustomPreview is the fallback for AutomaticPreview if ro-crate-html-js is not installed.
170
-
* StaticPreview: Allows to provide a static HTML page (including additional dependencies, e.g., CSS, JS) which is then shipped with the RO-Crate.
171
-
172
-
When creating a new RO-Crate using the builder, the default setting is to use CustomPreview. If you want to change this behaviour, thr preview method is set as follows:
Right 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:
-**There is a well-documented example-driven guide in [LearnByExampleTest.java](src/test/java/edu/kit/datamanager/ro_crate/examples/LearnByExampleTest.java) to help you get started.**
62
+
- You may also be interested in the examples we extracted from the [specification in version 1.1](https://www.researchobject.org/ro-crate/1.1/), which are available in [ExamplesOfSpecificationV1p1Test.java](src/test/java/edu/kit/datamanager/ro_crate/examples/ExamplesOfSpecificationV1p1Test.java).
63
+
- There is a [module with all well-described guiding tests](src/test/java/edu/kit/datamanager/ro_crate/examples/) available.
64
+
- The [JavaDoc Documentation](https://javadoc.io/doc/edu.kit.datamanager/ro-crate-java) is also available online.
0 commit comments