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
@@ -51,47 +51,135 @@ Note that some level of provenance is already encoded in BIDS (cf. [`GeneratedBy
51
51
52
52
### 1.3 File naming {#1-3-file-naming}
53
53
54
-
This document describes the contents of a BIDSProv file; for naming and 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:
54
+
This section describes the places where BIDS-Prov contents can be stored; for naming and 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.
55
55
56
-
BIDS-Prov files are JSON-LD files -i.e. a specific type of JSON files that allows encoding graph-like structures with the Resource Description Framework[^1]-
56
+
BIDS-Prov files contain JSON or JSON-LD data. JSON-LD is a specific type of JSON that allows encoding graph-like structures with the Resource Description Framework[^1].
57
57
58
-
They can be stored in two different locations:
58
+
They can be stored in different locations:
59
+
* at dataset level ;
60
+
* inside dataset subdirectories ;
61
+
* at file level.
59
62
60
-
**File level provenance.** BIDS-Prov files can be stored immediately alongside the BIDS file (or BIDS-Derivatives file) they apply to. Each BIDS-Prov file must meet the following naming convention:
63
+
It is recommanded that the records are stored at the level they describe. E.g.:
64
+
* an Activity that generated as set of files for several subjects of the dataset must be described at the dataset level ;
65
+
* an Activity that generated as set of files for one subject only must be described at the subject's subdirectory level ;
66
+
* an Activity that generated one file only can be described at this file's level.
61
67
68
+
#### File level provenance
69
+
70
+
BIDS-Prov provenance metadata can be stored inside the [JSON sidecar of any BIDS file]() (or BIDS-Derivatives file) it applies to.
71
+
In this case, the BIDS-Prov content only refers to the associated data file.
72
+
The JSON sidecar file must have the following naming convention:
Participant-level provenance -- Not related to a given file but all related to a given subject!
119
+
#### Subdirectories level provenance
120
+
121
+
BIDS-Prov files can be stored in a `prov/` directory in any subdirectory of the dataset (or BIDS-Derivatives directories).
81
122
82
-
We need to think about provenance of BIDS-derivatives !!
123
+
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).
83
124
84
-
**Dataset level provenance.**BIDS-Prov files can be stored in a `prov/` directory immediately below the BIDS dataset (or BIDS-Derivatives dataset) root. Each BIDS-Prov file must meet the following naming convention:
125
+
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).
At the dataset level, provenance could be about the dataset itself, or about any BIDS file in the dataset.
134
+
Here is an example:
91
135
92
-
It is RECOMMENDED to place entity (file) related provenance alongside the files where it is possible (i.e. file level provenance). Dataset level provenance may evolve as new data are added, which may include sourcedata, BIDS data, and BIDS derived data. One option is to make use of <code>[https://w3c.github.io/json-ld-syntax/#named-graphs](https://w3c.github.io/json-ld-syntax/#named-graphs)</code>.
136
+
```
137
+
└─ dataset
138
+
├─ sub-001/
139
+
│ ├─ prov/
140
+
│ │ └─ sub-001_prov-dcm2niix_act.json
141
+
│ ├─ ses-01/
142
+
│ │ ├─ prov/
143
+
│ │ │ └─ sub-001_ses-01_prov-dcm2niix_act.json
144
+
│ │ └─ ...
145
+
│ ├─ ses-02/
146
+
│ └─ ...
147
+
├─ sub-002/
148
+
│ ├─ prov/
149
+
│ │ └─ sub-002_prov-dcm2niix_act.json
150
+
│ └─ ...
151
+
├─ ...
152
+
└─ dataset_description.json
153
+
```
93
154
94
-
Note: since these jsonld documents are graph objects, they can be aggregated using RDF tools without the need to apply the inheritance principle.
155
+
#### Dataset level provenance
156
+
157
+
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.
158
+
159
+
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`
@@ -239,7 +327,7 @@ A complete schema for the model file to facilitate specification and validation
239
327
240
328
## 2. Provenance records {#2-provenance-records}
241
329
242
-
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.
330
+
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.
243
331
244
332

245
333
@@ -389,7 +477,7 @@ Including an Agent record is OPTIONAL. If included, each Agent record has the fo
0 commit comments