Skip to content

Commit 473a779

Browse files
author
Abigail Miller
committed
Updates for 1.2 and suggestions from ACM run through
1 parent bb78302 commit 473a779

21 files changed

+339
-196
lines changed

CODE_OF_CONDUCT.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
---
2+
title: "Contributor Code of Conduct"
3+
---
4+
15
# Contributor Code of Conduct
26

37
Contributors to the RO-Crate community, including this tutorial, are expected to comply with our [Code of Conduct](https://github.com/ResearchObject/ro-crate/blob/main/CODE_OF_CONDUCT.md) to ensure an open and inclusive environment. You may email [email protected] to report any Code of Conduct concerns.

config.yaml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ contact: "[email protected]"
6767
# Order of episodes in your lesson
6868
episodes:
6969
- 01-introduction.md
70-
- 02-folder-as-crate-root.md
71-
- 03-metadata-descriptor.md
72-
- 04-root.md
73-
- 05-root-metadata.md
70+
- 02-folder-as-crate-root.md
71+
- 03-root.md
72+
- 04-root-metadata.md
73+
- 05-metadata-descriptor.md
7474
- 06-cross-references.md
7575
- 07-data-entities.md
7676
- 08-contextual-entities.md
@@ -79,7 +79,8 @@ episodes:
7979
- 11-triples.md
8080
- 12-html-preview.md
8181
- 13-complete.md
82-
- 14-next-steps.md
82+
- 14-common-pitfalls.md
83+
- 15-next-steps.md
8384

8485
# Information for Learners
8586
learners:

episodes/01-introduction.md

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,18 @@ exercises: 0
2323

2424
::::::::::::::::::::::::::::::::::::::: questions
2525
- How do I package data in a FAIR way?
26+
- How does an RO-Crate identify and describe its contents?
27+
- What is the difference between data entities and context entities?
28+
- What is the role of JSON-LD in RO-Crate?
2629
- How can I list the authors of individual files?
27-
- Can I use multiple licenses in the same data package?
28-
- How can I visualize JSON-LD metadata?
30+
- How can I validate and visualize RO-Crate metadata?
2931
::::::::::::::::::::::::::::::::::::::::::::::::::
3032

3133
::::::::::::::::::::::::::::::::::::::: objectives
3234
- Construct an RO-Crate by hand using JSON
33-
- Describe each part of the Research Object
3435
- Learn basic JSON-LD to create FAIR metadata
35-
- Connect different parts of the Research Object using identifiers
36+
- Describe each part of the RO-Crate
37+
- Connect different parts of the RO-Crate using identifiers
3638
::::::::::::::::::::::::::::::::::::::::::::::::::
3739

3840

@@ -50,16 +52,19 @@ _Video: An overview of the RO-Crate concept and its implementations_ (see also [
5052

5153
## Tutorial walk-through
5254

53-
In this tutorial, meant to be read along with the [RO-Crate specification](https://www.researchobject.org/ro-crate/1.1/),
55+
In this tutorial, meant to be read along with the [RO-Crate specification](https://www.researchobject.org/ro-crate/1.2/),
5456
we'll walk through the initial steps for creating a basic RO-Crate.
5557
You are invited to replicate the below steps on your local computer.
5658

5759
::::::::::::::::::::::::::::::::::::::: callout
5860
## Abbreviations
59-
- FAIR: Findable, Accessible, Interoperable, Reusable; a set of principles for publishing research data and metadata
60-
- JSON: JavaScript Object Notation, a generic structured text-based data format
61-
- JSON-LD: JSON Linked Data, a way to express Linked Data (RDF) using regular JSON
62-
- RO-Crate: Research Object Crate; a way to package research data with structured FAIR metadata
61+
- FAIR: Findable, Accessible, Interoperable, Reusable; a set of principles for publishing research data and metadata.
62+
- FDO: FAIR Digital Object; a set of recommendations to improve findability, accessibility, interoperability, and reproducibility for any digital object.
63+
- JSON: JavaScript Object Notation, a generic structured text-based data format.
64+
- JSON-LD: JSON Linked Data, a way to express Linked Data (RDF) using regular JSON.
65+
- RO-Crate: Research Object Crate; a way to package research data with structured FAIR metadata.
66+
- PID: Persistent Identifier; a long-lasting reference to a digital object.
67+
- URI: Uniform Resource Identifier; a string of characters that identifies a resource.
6368
::::::::::::::::::::::::::::::::::::::::::::::::::
6469

6570
::::::::::::::::::::::::::::::::::::::: keypoints

episodes/02-folder-as-crate-root.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ used in the rest of the RO-Crate document.
6767
These will largely map to definitions in the [schema.org](http://schema.org/) vocabulary,
6868
which can be used by RO-Crate extensions to provide additional metadata beyond the RO-Crate specifications.
6969
It is this feature of JSON-LD that helps make RO-Crate extensible for many different purposes
70-
-- this is explored further in the specification's [appendix on JSON-LD](https://www.researchobject.org/ro-crate/1.1/appendix/jsonld.html).
70+
-- this is explored further in the specification's [appendix on JSON-LD](https://www.researchobject.org/ro-crate/1.2/appendix/jsonld.html).
7171
In short, only JSON keys (_properties_) and types defined this way can be used within the RO-Crate Metadata Document.
7272

7373
However, in the general case it should be sufficient to follow the RO-Crate JSON examples directly without deeper JSON-LD understanding.
@@ -78,7 +78,7 @@ The `@type` keyword associates an object with a predefined type from the JSON-LD
7878
Almost any property can alternatively be used with an `[]` array to provide multiple values.
7979

8080
The rest of this tutorial,
81-
and indeed most of the [RO-Crate specification](https://www.researchobject.org/ro-crate/1.1/),
81+
and indeed most of the [RO-Crate specification](https://www.researchobject.org/ro-crate/specification/1.2/),
8282
specify which entities can be added to the `@graph` array.
8383

8484

Lines changed: 33 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ exercises: 1
1414

1515
## RO-Crate Root
1616

17-
Next we'll add another entity to the `@graph` array,
18-
to describe the [RO-Crate Root](https://www.researchobject.org/ro-crate/1.1/root-data-entity.html#direct-properties-of-the-root-data-entity):
17+
First we'll add an entity to the `@graph` array,
18+
to describe the [RO-Crate Root](https://www.researchobject.org/ro-crate/specification/1.2/root-data-entity.html#direct-properties-of-the-root-data-entity):
1919

2020
```json
2121
{
@@ -27,23 +27,8 @@ to describe the [RO-Crate Root](https://www.researchobject.org/ro-crate/1.1/root
2727
}
2828
```
2929

30-
:::::::::::::::::::::::::::::::::::::::: callout
31-
## Adding entities to the JSON array
32-
33-
Because we're adding incrementally to the `@graph` array.
34-
It is important to remember the comma `,` between each entity,
35-
**except** for the final entity in the JSON array;
36-
and likewise for the properties within the JSON object for each entity.
37-
This is an artefact of the strict [JSON](https://www.json.org/) file format rules to simplify parsing.
38-
The order of the entities within the `@graph` JSON-LD array
39-
and the order of the keys within a JSON object is _not significant_.
40-
The _graph_ content is given by the `@id` cross-references.
41-
42-
You will add a comma here between the `ro-crate-metadata.json` entity, and the root data entity.
43-
::::::::::::::::::::::::::::::::::::::::::::::::::
44-
45-
By convention, in RO-Crate the `@id` value of `./` means that this entity describes the folder in which the RO-Crate metadata file is located.
46-
This reference from `ro-crate-metadata.json` is therefore semantically marking the `crate1` folder as being the RO-Crate Root.
30+
By convention, in RO-Crate the `@id` value of `./` means that this entity describes the folder in which the RO-Crate metadata file is located. The root data entity always has the `@type` value of `Dataset`, which is a [schema.org](https://schema.org/Dataset) type.
31+
This will be referenced from `ro-crate-metadata.json`, semantically marking the `crate1` folder as being the RO-Crate Root.
4732

4833

4934
:::::::::::::::::::::::::::::::::::::::: discussion
@@ -57,11 +42,38 @@ If the crate is being served from a Web service,
5742
such as a data repository or database where files are not organized in folders,
5843
then the `@id` might be an absolute URI instead of `./`
5944
-- this is one reason why we point to the root entity from the metadata descriptor,
60-
see section [Root Data Entity](https://www.researchobject.org/ro-crate/1.1/root-data-entity.html) for details.
45+
see section [Root Data Entity](https://www.researchobject.org/ro-crate/specification/1.2/root-data-entity.html) for details.
6146
::::::::::::::::::::::::::::::::::::::::::::::::::
6247

48+
:::::::::::::::::::::::::::::::::::::::: challenge
49+
## Add an additional type
50+
51+
1. Navigate the schema.org type list to find a subtype of `CreativeWork` that is suitable for a learning resource.
52+
2. Modify the root entity's `@type` to be an array.
53+
3. Add the type name for learning resource at the end of the array.
54+
55+
::::::::::::::: solution
56+
```json
57+
{
58+
"@id": "./",
59+
"@type": ["Dataset", "LearningResource"],
60+
"hasPart": [
61+
{"@id": "data.csv"}
62+
],
63+
"…": ""
64+
}
65+
```
66+
:::::::::::::::::::::::::
67+
::::::::::::::::::::::::::::::::::::::::::::::::::
68+
69+
The root has several metadata properties that describe the RO-Crate as a whole,
70+
considering it as a Research Object of collected resources.
71+
The section on [root data entity](https://www.researchobject.org/ro-crate/specification/1.2/root-data-entity.html)
72+
details further the required and recommended properties of the root `./`.
73+
6374
:::::::::::::::::::::::::::::::::::::::: keypoints
6475
- The RO-Crate Root is the top-level object of the RO-Crate
65-
- The root identifier may be a URL, but commonly just ./ for the current folder
76+
- The root identifier is commonly just ./ for the current folder, but can be a URL
77+
- The root is always typed as a Dataset, but can have additional types
6678
::::::::::::::::::::::::::::::::::::::::::::::::::
6779

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ exercises: 4
1515

1616
## Describing the root entity
1717

18-
When describing the [root entity](https://www.researchobject.org/ro-crate/1.1/root-data-entity.html#direct-properties-of-the-root-data-entity),
18+
When describing the [root entity](https://www.researchobject.org/ro-crate/specification/1.2/root-data-entity.html#direct-properties-of-the-root-data-entity),
1919
the properties generally apply to the whole of the crate.
2020
For instance it is a good idea to give a description of why these resources are gathered in a crate,
2121
as well as giving the crate a name and license for FAIR reuse and citation.
@@ -36,7 +36,7 @@ or another license of your choice:
3636
"hasPart": [ ],
3737
"name": "Example crate",
3838
"description": "I created this example by following the tutorial",
39-
"datePublished": "2023-05-22T12:03:00+0100",
39+
"datePublished": "2023-05-22",
4040
"license": { "@id": "http://spdx.org/licenses/CC0-1.0"}
4141
}
4242
```
Lines changed: 44 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,25 @@ exercises: 2
1111
::::::::::::::::::::::::::::::::::::::::::::::::::
1212

1313
::::::::::::::::::::::::::::::::::::::: objectives
14-
- Add the first entity to the JSON-LD @graph
14+
- Add the next entity to the JSON-LD @graph
1515
- Indicate the version of RO-Crate
1616
::::::::::::::::::::::::::::::::::::::::::::::::::
1717

1818
## RO-Crate Metadata descriptor
1919

20-
The first JSON-LD _entity_ to add in the `@graph` array has the `@id` value of `ro-crate-metadata.json` to describe the JSON file itself:
20+
The next JSON-LD _entity_ to add in the `@graph` array has the `@id` value of `ro-crate-metadata.json` to describe the JSON file itself:
2121

2222

2323
```json
2424
{
2525
"@id": "ro-crate-metadata.json",
2626
"@type": "CreativeWork",
27-
"conformsTo": {"@id": "https://w3id.org/ro/crate/1.1"},
27+
"conformsTo": {"@id": "https://w3id.org/ro/crate/1.2"},
2828
"about": {"@id": "./"}
2929
}
3030
```
3131

32-
This required entity, known as the [RO-Crate Metadata Descriptor](https://www.researchobject.org/ro-crate/1.1/root-data-entity.html#ro-crate-metadata-file-descriptor),
32+
This required entity, known as the [RO-Crate Metadata Descriptor](https://www.researchobject.org/ro-crate/specification/1.2/root-data-entity.html#ro-crate-metadata-descriptor),
3333
helps this file self-identify as an RO-Crate Metadata Document,
3434
which is conforming to (`conformsTo`) the RO-Crate specification version 1.1.
3535
Notice that the `conformsTo` URL corresponds to the `@context` URL version-wise,
@@ -39,14 +39,52 @@ while the conformance declares which RO-Crate conventions of using those terms a
3939

4040
::::::::::::::::::::::::::::::::::::::: callout
4141
## RO-Crate versions
42-
This tutorial is written for RO-Crate 1.1,
42+
This tutorial is written for RO-Crate 1.2,
4343
the RO-Crate website will list the [current specification version](https://www.researchobject.org/ro-crate/specification.html)
4444
-- RO-Crates can generally be upgraded to newer versions following [semantic versioning](https://semver.org/) conventions,
45-
but check the [change log](https://www.researchobject.org/ro-crate/1.1/appendix/changelog.html) for any important changes.
45+
but check the [change log](https://www.researchobject.org/ro-crate/specification/1.2/appendix/changelog.html) for any important changes.
4646
The next development version of the specification, indicated with a `-DRAFT` status,
4747
may still be subject to changes and should only be used with caution.
4848
::::::::::::::::::::::::::::::::::::::::::::::::::
4949

50+
:::::::::::::::::::::::::::::::::::::::: callout
51+
## Adding entities to the JSON array
52+
53+
Because we're adding incrementally to the `@graph` array.
54+
It is important to remember the comma `,` between each entity,
55+
**except** for the final entity in the JSON array;
56+
and likewise for the properties within the JSON object for each entity.
57+
This is an artefact of the strict [JSON](https://www.json.org/) file format rules to simplify parsing.
58+
The order of the entities within the `@graph` JSON-LD array
59+
and the order of the keys within a JSON object is _not significant_.
60+
The _graph_ content is given by the `@id` cross-references.
61+
62+
You will add a comma here between the `ro-crate-metadata.json` entity, and the root data entity.
63+
::::::::::::::::::::::::::::::::::::::::::::::::::
64+
65+
66+
Your RO-Crate metadata file should now containt two entities and look like this:
67+
68+
```json
69+
{
70+
"@context": "https://w3id.org/ro/crate/1.2/context",
71+
"@graph": [
72+
{
73+
"@id": "./",
74+
"@type": "Dataset",
75+
"hasPart": [
76+
]
77+
},
78+
{
79+
"@id": "ro-crate-metadata.json",
80+
"@type": "CreativeWork",
81+
"conformsTo": {"@id": "https://w3id.org/ro/crate/1.2"},
82+
"about": {"@id": "./"}
83+
}
84+
]
85+
}
86+
```
87+
5088
::::::::::::::::::::::::::::::::::::::: keypoints
5189
- The RO-Crate Metadata Descriptor describes the JSON-LD file itself
5290
- RO-Crate specifications are versioned

episodes/06-cross-references.md

Lines changed: 44 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,64 @@ teaching: 3
44
exercises: 4
55
---
66
:::::::::::::::::::::::::::::::::::::::: questions
7-
- How can I describe an entity further?
7+
- How does RO Crate use flattened JSON-LD?
88
- How can I cross-reference different entities?
99
::::::::::::::::::::::::::::::::::::::::::::::::::
1010

1111
:::::::::::::::::::::::::::::::::::::::: objectives
12-
- Understand cross-references in flattened JSON-LD
12+
- Understand cross-references in RO Crate
1313
- Add a data entity reference from the root entity
14-
- Add another type to the root entity
1514
::::::::::::::::::::::::::::::::::::::::::::::::::
1615

1716

18-
1917
## About cross-references
2018

19+
In many JSON documents, related information is nested inside parent objects. For example:
20+
```json
21+
{
22+
"@id": "./",
23+
"@type": "Dataset",
24+
"name": "My Dataset",
25+
"author": {
26+
"@type": "Person",
27+
"name": "Josiah Carberry",
28+
"affiliation": "Brown University"
29+
}
30+
}
31+
```
32+
33+
While this is readable, it can become hard to manage when entities are reused or grow in complexity.
34+
35+
In contrast, RO-Crate uses a flattened structure, where each entity is described just once, and connected using @id cross-references:
36+
37+
```json
38+
[
39+
{
40+
"@id": "./",
41+
"@type": "Dataset",
42+
"name": "My Dataset",
43+
"author": { "@id": "https://orcid.org/0000-0002-1825-0097" }
44+
},
45+
{
46+
"@id": "https://orcid.org/0000-0002-1825-0097",
47+
"@type": "Person",
48+
"name": "Josiah Carberry",
49+
"affiliation": "Brown University"
50+
}
51+
]
52+
```
53+
2154
In a RO-Crate Metadata Document,
2255
entities are cross-referenced using `@id` reference objects,
2356
rather than using deeply nested JSON objects.
24-
In short, this _flattened JSON-LD_ style (shown below) allows any entity to reference any other entity,
25-
and RO-Crate consumers can directly find all the descriptions of a given entity as a single JSON object.
57+
In short, this _flattened JSON-LD_ style allows any entity to reference any other entity,
58+
and RO-Crate consumers can directly find all the descriptions of a given entity as a single JSON object.
59+
60+
Think of @id as the entity’s “name tag”, you describe it once and refer to it anywhere in the graph.
2661

2762
![JSON block with id `ro-crate-metadata.json` has some attributes, `conformsTo` RO-Crate 1.2, and `about` referencing id `./`. In second JSON block with id <code>./</code> we see additional attributes such as its name and description.](fig/introduction-figure-1.svg){alt="showing RO-Crate Metadata descriptor's `about` property pointing at the RO-Crate Root entity with matching `@id`"}
2863

64+
2965
:::::::::::::::::::::::::::::::::::::::: challenge
3066
## Add cross-reference to data entity
3167

@@ -47,41 +83,10 @@ and add such a cross-reference to the file `data.csv` using the _property_ calle
4783
::::::::::::::::::::::::::::::::::::::::::::::::::
4884

4985

50-
The RO-Crate root is always typed `Dataset`,
51-
though `@type` may in some cases have additional types by using a JSON array instead of a single value.
52-
Most entities can have such more specific types,
53-
e.g. chosen from [schema.org type list](https://schema.org/docs/full.html).
54-
55-
:::::::::::::::::::::::::::::::::::::::: challenge
56-
## Add an additional type
57-
58-
1. Navigate the schema.org type list to find a subtype of `CreativeWork` that is suitable for a learning resource.
59-
2. Modify the root entity's `@type` to be an array.
60-
3. Add the type name for learning resource at the end of the array.
61-
62-
::::::::::::::: solution
63-
```json
64-
{
65-
"@id": "./",
66-
"@type": ["Dataset", "LearningResource"],
67-
"hasPart": [
68-
{"@id": "data.csv"}
69-
],
70-
"…": ""
71-
}
72-
```
73-
:::::::::::::::::::::::::
74-
::::::::::::::::::::::::::::::::::::::::::::::::::
75-
76-
The root has several metadata properties that describe the RO-Crate as a whole,
77-
considering it as a Research Object of collected resources.
78-
The section on [root data entity](https://www.researchobject.org/ro-crate/1.1/root-data-entity.html)
79-
details further the required and recommended properties of the root `./`.
80-
8186
:::::::::::::::::::::::::::::::::::::::: keypoints
8287
- The @id uniquely identifies the entity within the RO-Crate
83-
- The @id key is used for cross-referencing
84-
- Multiple types can be listed by using an array
88+
- Flattened JSON-LD helps keep each entity self-contained
89+
- Reuse of @id avoids duplication and enables linking
8590
::::::::::::::::::::::::::::::::::::::::::::::::::
8691

8792

0 commit comments

Comments
 (0)