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
***Note**: The RO-Crate metadata file is renamed to `ro-crate-metadata.json` to facilitate use of JSON editors. [#82](https://github.com/ResearchObject/ro-crate/issues/82)[#84](https://github.com/ResearchObject/ro-crate/issues/84)
@@ -32,7 +32,7 @@ excerpt: List of changes in releases of this specifications
32
32
*[RO-Crate Root](../structure.md) directory no longer requires payload files [#74](https://github.com/ResearchObject/ro-crate/issues/74)
33
33
*[Workflows and scripts](../workflows.md) section now aligned with [BioSchemas ComputationalWorkflow profile](https://bioschemas.org/profiles/ComputationalWorkflow/0.5-DRAFT-2020_07_21/)[#81](https://github.com/ResearchObject/ro-crate/issues/81)[#100](https://github.com/ResearchObject/ro-crate/pull/100)
34
34
* Added section [Programming with JSON-LD](implementation-notes.md#programming-with-json-ld) and note that `@type` might be an array [#85](https://github.com/ResearchObject/ro-crate/issues/85)
35
-
* Added new section [Handling relative URI references](jsonld.html#handling-relative-uri-references)[#73](https://github.com/ResearchObject/ro-crate/issues/73)
35
+
* Added new section [Handling relative URI references](jsonld.md#handling-relative-uri-references)[#73](https://github.com/ResearchObject/ro-crate/issues/73)
36
36
* JSON-LD context no longer sets `@base: null`[#73](https://github.com/ResearchObject/ro-crate/issues/73)
37
37
* Added note on [Encoding file paths](../data-entities.md#encoding-file-paths)[#77](https://github.com/ResearchObject/ro-crate/issues/77)[#80](https://github.com/ResearchObject/ro-crate/issues/80)
38
38
* Added section [Choosing URLs for ad hoc terms](jsonld.md#adding-new-or-ad-hoc-vocabulary-terms)[#71](https://github.com/ResearchObject/ro-crate/issues/71)[#90](https://github.com/ResearchObject/ro-crate/issues/90)
@@ -44,6 +44,11 @@ excerpt: List of changes in releases of this specifications
44
44
* Change theme to `jekyll-rtd-theme` and split into multiple pages [#95](https://github.com/ResearchObject/ro-crate/pull/95)
Copy file name to clipboardExpand all lines: docs/1.1-DRAFT/appendix/implementation-notes.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@ excerpt:
21
21
limitations under the License.
22
22
-->
23
23
24
-
# Implementation notes
24
+
# APPENDIX: Implementation notes
25
25
26
26
## Programming with JSON-LD
27
27
@@ -223,19 +223,19 @@ is outside of the bag directory and can be changed without changing the payload'
223
223
| example.txt
224
224
```
225
225
226
-
A [Data Entity](../data-entities.md) describing `example.txt` in this scenario would have an `@id` of `bag/data/example.txt`:
226
+
A [Data Entity](../data-entities.md) describing `example.txt` in this scenario would have an `@id` of `bag1/data/example.txt`:
227
227
228
228
```json
229
229
{
230
-
"@id": "bag/data/example.txt",
230
+
"@id": "bag1/data/example.txt",
231
231
"name": "Example file"
232
232
}
233
233
```
234
234
235
235
236
236
## Repository-specific identifiers
237
237
238
-
_Root Data Entities_ MAY also have additional repositoryspecific identifiers, described using [Contextual Entities](../contextual-entities.md) using a [PropertyValue], with a [name] that identifies the repository and the [identifier] as a value. The _same_ identifier MAY be used in multiple different repositories and effectively namespaced using the `name` of the `ProperyValue`.
238
+
_Root Data Entities_ MAY include repository-specific identifiers, described using [Contextual Entities](../contextual-entities.md) using a [PropertyValue], with a [name] that identifies the repository and the [identifier] as a value. The _same_ identifier MAY be used in multiple different repositories and effectively namespaced using the `name` of the `ProperyValue`.
Copy file name to clipboardExpand all lines: docs/1.1-DRAFT/appendix/jsonld.md
+12-10Lines changed: 12 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,7 @@ excerpt: |
26
26
27
27
# APPENDIX: RO-Crate JSON-LD
28
28
29
-
It is not necessary to use [JSON-LD tooling] to generate or parse the _RO-Crate Metadata File_, although JSON-LD tools may make it easier to conform to this specification, e.g. handling relative URIs. It is RECOMMENDED to use [JSON tooling][JSON] to handle [JSON][RFC 7159] syntax and escaping rules.
29
+
It is not necessary to use [JSON-LD tooling] to generate or parse the _RO-Crate Metadata File_, although JSON-LD tools may make it easier to conform to this specification, e.g. handling relative URIs. It is however RECOMMENDED to use [JSON tooling][JSON] to handle [JSON][RFC 7159] syntax and escaping rules.
30
30
31
31
This appendix shows a brief JSON-LD introduction for complying with the _RO-Crate Metadata File_ requirements.
32
32
@@ -93,7 +93,9 @@ The order of the `@graph` array is not significant. Above we see that the RO-Cra
93
93
94
94
Properties of an entity can refer to another URL or entity by using the form `{"@id": "uri-reference"}` as in the example above, where the [author] property in the [File] entity refer to the [Person] entity, identified as `#alice`.
95
95
96
-
Identifiers in `@id` SHOULD be either a valid _absolute URI_ like <http://example.com/>, or a _URI references__URI paths_ relative to the RO-Crate root directory. Care must be taken to express any relative paths using `/` separator and escape special characters like space (`%20`). As JSON-LD supports _IRIs_, international characters in identifiers SHOULD be encoded in UTF-8 rather than `%`-escaped.
96
+
Identifiers in `@id` SHOULD be either a valid _absolute URI_ like <http://example.com/>, or a _URI path_ relative to the RO-Crate root directory. Although legal in JSON-LD, `@id` paths in RO-Crate SHOULD NOT use `../` to climb out of the _RO-Crate Root_, rather such references SHOULD be translated to absolute URIs. See also section [Core Metadata for Data Entities](../data-entities.md#core-metadata-for-data-entities).
97
+
98
+
Care must be taken to express any relative paths using `/` separator and escape special characters like space (`%20`). As JSON-LD supports _IRIs_, international characters in identifiers SHOULD be encoded in UTF-8 rather than `%`-escaped.
97
99
98
100
Because the _RO-Crate JSON-LD_ is _flattened_, all described entities must be JSON objects as direct children of the `@graph` element rather than being nested under another object or array. Properties referencing entities must use a JSON object with `@id` as the only key, e.g. `"author": {"@id": "https://orcid.org/0000-0002-1825-0097"}`
99
101
@@ -168,7 +170,7 @@ The [JSON-LD flattening & compaction](https://www.w3.org/TR/json-ld-api/#flatten
168
170
169
171
## RO-Crate JSON-LD Media type
170
172
171
-
The [media type][RFC 6838] for `ro-crate-metadata.json` will, when following this specification, comply
173
+
The [media type][RFC 6838]`application/ld+json`for `ro-crate-metadata.json` will, when following this specification, comply
172
174
with the [flattened/compacted JSON-LD profiles][JSON-LD media type] as well as `https://w3id.org/ro/crate`, which may be indicated in a [HTTP response][RFC7231 response] as:
Note that most web servers will serve `ro-crate-metadata.json`with `Content-Type: application/json`.
184
+
Note that most web servers will however serve `*.json`as`Content-Type: application/json`.
183
185
184
186
Requesting the RO-Crate metadata file from a browser may also need permission through CORS header `Access-Control-Allow-Origin` (however extra care should be taken if the RO-Crates require access control).
To extend RO-Crate, implementers SHOULD try to use existing <http://schema.org/> properties and classes and MAY use terms from other vocabularies and ontologies when this is not possible.
217
219
218
-
The _terms_ (properties and classes) used SHOULD be added as keys to the `@context` in the _RO-Crate JSON-LD_ (if not present). To avoid duplicating the _RO-Crate JSON-LD Context_ the `@context: []` array form SHOULD be used as shown below.
220
+
The _terms_ (properties and types) used SHOULD be added as keys to the `@context` in the _RO-Crate JSON-LD_ (if not present). To avoid duplicating the _RO-Crate JSON-LD Context_ the `@context: []` array form SHOULD be used as shown below.
219
221
220
222
URIs in the `@context` SHOULD resolve to a useful human readable page. When this is not possible - for example if the URI resolves to an RDF ontology file, a human-readable URI SHOULD be provided using a [sameAs] description.
221
223
222
-
For example. The `@id` URI <http://purl.org/ontology/bibo/interviewee> from the [BIBO ontology] ontology intends to resolve to an ontology file, which is not useful for humans, however the HTML section <http://neologism.ecs.soton.ac.uk/bibo.html#interviewee> is human-readable. To read more about best practices for content negotiation of vocabularies, we refer the reader to <https://www.w3.org/TR/swbp-vocab-pub/>
224
+
For example. The `@id` URI <http://purl.org/ontology/bibo/interviewee> from the [BIBO ontology] ontology intends to resolve to an ontology file, which is not useful for humans, however the HTML section <http://neologism.ecs.soton.ac.uk/bibo.html#interviewee> is human-readable. To read more about best practices for content negotiation of vocabularies, we refer the reader to [Best Practice Recipes for Publishing RDF Vocabularies].
223
225
224
226
225
227
```json
@@ -248,11 +250,11 @@ Where there is no RDF ontology available, then implementors SHOULD attempt to pr
248
250
249
251
Context terms must ultimately map to HTTP(s) URIs which poses challenges for crate-authors wishing to use their own vocabularies.
250
252
251
-
RO-Crate provides some strategies to add a new term (a Class or Property) that is not in Schema.org or another published vocabulary, so that there is a stable URI that can be added to the @context.
253
+
RO-Crate provides some strategies to add a new term (a [Class] or [Property]) that is not in Schema.org or another published vocabulary, so that there is a stable URI that can be added to the @context.
252
254
253
255
### Choosing URLs for ad hoc terms
254
256
255
-
For projects that have their own web-presence, URLs MAY defined and SHOULD resolve to useful content. For example for a project with web page <https://criminalcharacters.com/> the property `education` could have a URL: <https://criminalcharacters.com/vocab#education> which resolves to an HTML page that explains the term using HTML anchors:
257
+
For projects that have their own web-presence, URLs MAY be defined there and SHOULD resolve to useful content. For example for a project with web page <https://criminalcharacters.com/> the property `education` could have a URL: <https://criminalcharacters.com/vocab#education> which resolves to an HTML page that explains the term using HTML anchors:
256
258
257
259
```html
258
260
<divid="education">
@@ -266,7 +268,7 @@ For projects that have their own web-presence, URLs MAY defined and SHOULD resol
266
268
Ensure you have a consistent use of `http` or `https` (preferring https) as well as consistent path `/vocab` vs `/vocab/` vs `/vocab/index.html` (preferring the shortest that is also visible in browser).
267
269
```
268
270
269
-
For ad hoc terms where the crate author does not have the resources to create and maintain an HTML page, authors may use the RO-crate public namespace (`https://w3id.org/ro/terms/`) to reserve their terms. For example, an ad-hoc URL MAY be used in the form `https://w3id.org/ro/terms/criminalcharacters#education` where `criminalcharacters` is acting as a _namespace_ for one or more related terms like `education`. Ad-hoc namespaces under `https://w3id.org/ro/terms/` are available on first-come-first-serve basis; to avoid clashes, namespaces SHOULD be registered by [submitting terms and definitions][ro-terms] to the RO-Crate terms project.
271
+
For ad hoc terms where the crate author does not have the resources to create and maintain an HTML page, authors may use the RO-Crate public namespace (`https://w3id.org/ro/terms/`) to reserve their terms. For example, an ad-hoc URL MAY be used in the form `https://w3id.org/ro/terms/criminalcharacters#education` where `criminalcharacters` is acting as a _namespace_ for one or more related terms like `education`. Ad-hoc namespaces under `https://w3id.org/ro/terms/` are available on first-come-first-serve basis; to avoid clashes, namespaces SHOULD be registered by [submitting terms and definitions][ro-terms] to the RO-Crate terms project.
270
272
271
273
In both cases, to use an ad-hoc term in an RO-Crate, the URI MUST be included in the local context:
272
274
@@ -292,7 +294,7 @@ Following the conventions used by Schema.org, ad-hoc terms SHOULD also include d
Copy file name to clipboardExpand all lines: docs/1.1-DRAFT/appendix/relative-uris.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,7 +41,7 @@ consistent handling:
41
41
## Flattening JSON-LD from nested JSON
42
42
43
43
If performing
44
-
[JSON-LD flattening] to generate a valid _RO-Crate Metadata File_, add `@base: null` to the input JSON-LD `@context` array to avoid expanding relative URI references. The flattening `@context` SHOULD NOT need `@base: null`.
44
+
[JSON-LD flattening] to generate a valid _RO-Crate Metadata File_, add `@base: null` to the input JSON-LD `@context` array to avoid expanding relative URI references. The flattening `@context` SHOULD NOT need `@base: null`.
45
45
46
46
Example, this JSON-LD is in [compacted form][compacted] which may be beneficial for processing, but is not yet valid _RO-Crate Metadata File_ as it has not been flattened into a `@graph` array.
47
47
@@ -146,7 +146,7 @@ For example, expanding this JSON-LD:
146
146
"@context": [
147
147
"https://w3id.org/ro/crate/1.1-DRAFT/context",
148
148
{"@base": null}
149
-
]
149
+
],
150
150
"@graph": [
151
151
{
152
152
"@id": "ro-crate-metadata.json",
@@ -230,7 +230,7 @@ Results in a [expanded form][JSON-LD expanded form] without `@context`, using ab
230
230
```
231
231
232
232
```note
233
-
Note that `@base: null` will not relativize existing absolute URIs that happen to be contained by the _RO-Crate Root_ (see section [Relativizing absolute URIs within RO-Crate Root](#relativizing-absolute-uris-within-ro-crate-root)).
233
+
`@base: null` will not relativize existing absolute URIs that happen to be contained by the _RO-Crate Root_ (see section [Relativizing absolute URIs within RO-Crate Root](#relativizing-absolute-uris-within-ro-crate-root)).
234
234
```
235
235
236
236
```tip
@@ -244,7 +244,7 @@ When loading _RO-Crate JSON-LD_ as RDF, or combining the crate's Linked Data int
244
244
to resolve URI references that are relative to the _RO-Crate Root_.
245
245
246
246
```note
247
-
Note that when retrieving an RO-Crate over the web, servers might have performed HTTP redirections so that the base URI is different from what was requested. It is RECOMMENDED to follow section [Establishing a Base URI of RFC3986](http://tools.ietf.org/html/rfc3986#section-5.1) before resolving relative links from the _RO-Crate Metadata File_.
247
+
When retrieving an RO-Crate over the web, servers might have performed HTTP redirections so that the base URI is different from what was requested. It is RECOMMENDED to follow section [Establishing a Base URI of RFC3986](http://tools.ietf.org/html/rfc3986#section-5.1) before resolving relative links from the _RO-Crate Metadata File_.
248
248
```
249
249
250
250
For instance, consider this HTTP redirection from a permalink (simplified):
@@ -426,7 +426,7 @@ When parsing such crates it is recommended to use the
426
426
[Archive and Package (arcp) URI scheme][ARCP]
427
427
to establish a temporary/location-based UUID or hash-based (SHA256) _base URI_.
428
428
429
-
For instance, given a randomly generated UUID `029bcde1-dfa3-43cf-b7d9-a4fb75ccd4eb` we can use `arcp://uuid,b7749d0b-0e47-5fc4-999d-f154abe68065/` as the `@base`:
429
+
For instance, given a randomly generated UUID `b7749d0b-0e47-5fc4-999d-f154abe68065` we can use `arcp://uuid,b7749d0b-0e47-5fc4-999d-f154abe68065/` as the `@base`:
0 commit comments