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
@@ -47,7 +47,7 @@ But provenance comes up in other contexts as well, which might be addressed at a
47
47
48
48
Provenance can be captured using different mechanisms, but independent of encoding, always reflects transformations by either humans or software. The interpretability of provenance records requires a consistent vocabulary for provenance as well as an expectation for a consistent terminology for the objects being encoded.
49
49
50
-
Note that some level of provenance is already encoded in BIDS (cf. the [`GeneratedBy`](https://bids-specification.readthedocs.io/en/stable/glossary.html#generatedby-metadata) of the `dataset_description.json` file that contains the metadata of a dataset), this BEP avoids duplicating information already available in sidecar JSONs.
50
+
Note that some level of provenance is already encoded in BIDS (cf. the [`GeneratedBy`](https://bids-specification.readthedocs.io/en/stable/glossary.html#generatedby-metadata) of the `dataset_description.json` file that contains the provenance metadata for the dataset). This BEP avoids duplicating information already available in sidecar JSONs.
51
51
52
52
### 1.3 Provenance format {#1-3-provenance-format}
53
53
@@ -56,11 +56,14 @@ BIDS-Prov metadata is written in JSON or JSON-LD.
56
56
[JSON-LD](https://www.w3.org/TR/json-ld11/) is a specific type of JSON that allows encoding graph-like structures with the Resource Description Framework[^1].
57
57
58
58
TODO: written in a single file (JSON-LD) or several JSON files that can be aggregated into one JSON-LD
59
+
59
60
TODO: BIDS-Prov tools
60
61
61
62
## 2. Provenance records {#2-provenance-records}
62
63
63
-
Each provenance record is composed of a set of Activities that represent the transformations that have been applied to the data. Each Activity can use Entities as inputs and outputs. The Agent specifies the software package. Environments specify the software environment in which the provenance record was obtained.
64
+
BIDS-Prov metadata consists in a set or records. There are 4 types of records: `Activity`, `Entity`, `Agent`, and `Environment`.
65
+
66
+
Activities represent the transformations that have been applied to the data. Each Activity can use Entities as inputs and outputs. The Agent specifies the software package. Environments specify the software environment in which the provenance record was obtained.
64
67
65
68

66
69
@@ -124,16 +127,16 @@ Each Activity record is a JSON Object with the following fields:
@@ -178,7 +181,7 @@ Each Entity record is a JSON Object with the following fields:
178
181
<tr>
179
182
<td><code>Type</code>
180
183
</td>
181
-
<td>OPTIONAL. URI. A term from a controlled vocabulary that more specifically describes the activity.
184
+
<td>OPTIONAL. URI. A term from a controlled vocabulary that more specifically describes the entity.
182
185
</td>
183
186
</tr>
184
187
<tr>
@@ -304,24 +307,16 @@ Here is an example of an Environment record:
304
307
305
308
### 3.1 File naming {#3-1-file-naming}
306
309
307
-
hence having either a `.json` or a `.jsonld` extension.
308
-
When using a `.jsonld` extension, the contents of the file must be JSON-LD.
309
-
As JSON-LD is JSON, `*.jsonld` files can contain JSON.
310
-
311
310
This section describes additions to the BIDS naming conventions for BIDS-Prov files.
312
311
313
312
For further information about naming conventions, please consult the BIDS specification ([https://bids-specification.readthedocs.io](https://bids-specification.readthedocs.io)). Until these conventions are established in BIDS, it is RECOMMENDED to use the following.
BIDS-Prov files contain JSON or JSON-LD data, hence having either a `.json` or a `.jsonld` extension.
317
+
When using a `.jsonld` extension, the contents of the file must be JSON-LD. As JSON-LD is JSON, `*.jsonld` files can contain JSON.
318
318
319
-
[JSON-LD](https://www.w3.org/TR/json-ld11/) is a specific type of JSON that allows encoding graph-like structures with the Resource Description Framework[^1].
320
-
321
-
When using a `.jsonld` extension, the contents of the file must be JSON-LD.
322
-
As JSON-LD is JSON, `*.jsonld` files can contain JSON.
323
-
324
-
#### The `prov` entity
319
+
#### 3.1.2 The `prov` entity {#3-1-2-the-prov-entity}
325
320
326
321
BIDS-Prov introduces the following entity:
327
322
@@ -347,23 +342,68 @@ In the following example, two separated processings (`conversion` and `smoothing
347
342
└─ ...
348
343
```
349
344
350
-
#### Suffixes
345
+
#### 3.1.3 Suffixes {#3-1-3-Suffixes}
351
346
352
-
The following BIDS suffixes (cf. [Definitions](https://bids-specification.readthedocs.io/en/stable/common-principles.html#definitions)) specify the contents of a provenance file:
347
+
The following BIDS suffixes (cf. [Definitions](https://bids-specification.readthedocs.io/en/stable/common-principles.html#definitions)) specify the contents of a provenance file.
353
348
354
-
*`act`: the file describes BIDS Prov Activities for the group of provenance records
355
-
*`soft`: the file describes BIDS Prov Software for the group of provenance records
356
-
*`ent`: the file describes BIDS Prov Entities for the group of provenance records
357
-
*`env`: the file describes BIDS Prov Environments for the group of provenance records
358
-
*`base`: the file describes common BIDS Prov parameters for the group of provenance records (version and context for BIDS Prov)
349
+
<table>
350
+
<tr>
351
+
<td><strong>Suffix</strong>
352
+
</td>
353
+
<td><strong>Description</strong>
354
+
</td>
355
+
<td><strong>File extension</strong>
356
+
</td>
357
+
</tr>
358
+
<tr>
359
+
<td><code>act</code>
360
+
</td>
361
+
<td>Activities for the group of provenance records.
362
+
</td>
363
+
<td><code>.json</code>
364
+
</td>
365
+
</tr>
366
+
<tr>
367
+
<td><code>ent</code>
368
+
</td>
369
+
<td>Agents for the group of provenance records.
370
+
</td>
371
+
<td><code>.json</code>
372
+
</td>
373
+
</tr>
374
+
<tr>
375
+
<td><code>env</code>
376
+
</td>
377
+
<td>Entities for the group of provenance records.
378
+
</td>
379
+
<td><code>.json</code>
380
+
</td>
381
+
</tr>
382
+
<tr>
383
+
<td><code>base</code>
384
+
</td>
385
+
<td>Common parameters for the group of provenance records (version and context for BIDS-Prov).
386
+
<td><code>.json</code>
387
+
</td>
388
+
</td>
389
+
</tr>
390
+
<tr>
391
+
<td><code>all</code>
392
+
</td>
393
+
<td>All records for the group of provenance records.
This section describes the places where BIDS-Prov contents can be stored.
402
+
This section describes the places where BIDS-Prov metadata can be stored.
363
403
364
404
For further information about organization conventions, please consult the BIDS specification ([https://bids-specification.readthedocs.io](https://bids-specification.readthedocs.io)). Until these conventions are established in BIDS, it is RECOMMENDED to use the following.
365
405
366
-
BIDS-Prov contents can be stored in different locations:
406
+
BIDS-Prov metadata can be stored at different levels:
367
407
* at dataset level ;
368
408
* inside dataset subdirectories ;
369
409
* at file level.
@@ -373,41 +413,13 @@ It is recommanded that the records are stored at the level they describe. E.g.:
373
413
* an Activity that generated as set of files for one subject only must be described at the subject's subdirectory level ;
374
414
* an Activity that generated one file only can be described at this file's level.
The sidecar JSON naming convention is already defined by BIDS. Here is an example dataset tree:
409
422
410
-
Here is an example:
411
423
```
412
424
└─ example_dataset
413
425
├─ sub-001/
@@ -424,22 +436,47 @@ Here is an example:
424
436
└─ dataset_description.json
425
437
```
426
438
427
-
#### Subdirectories level provenance
439
+
Inside the sidecar JSON, the `GenearatedBy` field must describe the `Activity` that generated the data file, either with a reference to an existing `Id`:
440
+
441
+
```JSON
442
+
{
443
+
"GeneratedBy": "urn:conversion-00f3a18f",
444
+
}
445
+
```
446
+
447
+
or with a complete description of the `Activity` if it was not described elsewhere.
Based on the same principle, the `SidecarGenearatedBy` field can be defined to describe the `Activity` that generated the sidecar JSON file.
460
+
If the `SidecarGenearatedBy` field is not defined, BIDS-Prov assumes that the sidecar JSON was generated by the `Activity` described in the `GenearatedBy` field.
461
+
462
+
No other field is allowed to describe provenance inside sidecar JSONs.
BIDS-Prov files can be stored in a `prov/` directory in any subdirectory of the dataset (or BIDS-Derivatives directories).
430
467
431
468
In this case, the provenance metadata applies to the data files inside or below in the directory tree ; as stated by [BIDS common principles](https://bids-specification.readthedocs.io/en/stable/common-principles.html#filesystem-structure).
432
469
433
-
Each BIDS-Prov file must meet the following naming convention. The `label` of the `prov` entity is arbitrary, and `suffix` is one of listed in [§ Suffixes](#suffixes).
470
+
Each BIDS-Prov file must meet the following naming convention. The `label` of the `prov` entity is arbitrary, `suffix` is one of listed in [3.3.1 Suffixes](#3-1-3-suffixes), and `extension` is either `json` or `jsonld`.
BIDS-Prov files can be stored in a `prov/` directory immediately below the BIDS dataset (or BIDS-Derivatives dataset) root. At the dataset level, provenance can be about any BIDS file in the dataset.
464
501
465
-
Each BIDS-Prov file must meet the following naming convention, where`label`can be arbitrary, `suffix` is one of listed in [§ Suffixes](#suffixes), and `suffix` is either `json` or `jsonld`
502
+
Each BIDS-Prov file must meet the following naming convention. The`label`of the `prov` entity is arbitrary, `suffix` is one of listed in [3.1.3 Suffixes](#3-1-3-suffixes), and `extension` is either `json` or `jsonld`
In the current version of the BIDS specification (1.10.0), the [`GeneratedBy`](https://bids-specification.readthedocs.io/en/stable/glossary.html#generatedby-metadata) field of the `dataset_description.json` files allows to specify provenance of the dataset.
493
530
494
-
> [!NOTE]BEP028 proposes that the following description replaces the `GeneratedBy` field as part of a major revision of the BIDS specification. Until this happens, BIDSProv provenance records can be stored in a `GeneratedByProv` field.
531
+
BEP028 proposes that the following description replaces the `GeneratedBy` field as part of a major revision of the BIDS specification. Until this happens, BIDS-Prov provenance records can be stored in a `GeneratedByProv` field.
495
532
496
-
Here is an example of a `GeneratedByProv` field containing a complete description of an `Entity`:
533
+
Here is an example of a `GeneratedByProv` field containing a complete description of an `Activity`:
0 commit comments