[ENH][BEP028] Specification update for BEP028 BIDS-Prov - #2099
Conversation
|
Hi @yarikoptic, As part of this PR (integration of BEP028 in the BIDS specification), I'm adding the BIDS-Prov context into the repo. For now it's under : |
…el provenance description
| { | ||
| "Id": "bids::sub-01/func/sub-01_task-tonecounting_bold.nii", | ||
| "Label": "sub-01_task-tonecounting_bold.nii", | ||
| "AtLocation": "sub-01/func/sub-01_task-tonecounting_bold.nii", |
There was a problem hiding this comment.
any reason not to use the same uri as Id here?
There was a problem hiding this comment.
For the Label, I guess we want to use the name of the file (without directory path) so that is more human readable.
About AtLocation, we describe this metadata as:
For input files, this is the relative path to the file on disk.
Should we be more specific for this definition ?
There was a problem hiding this comment.
i meant to use the bids uri here as well.
There was a problem hiding this comment.
Discussed w/ Boris today. We could use uri and change the spec to say "this is the path to the file on disk." (instead of "relative path").
But... Now that the id is in fact the path to the file in bids -- maybe we should consider removing AtLocation from BIDS-Prov as this only creates duplication of information. What do you think?
There was a problem hiding this comment.
the unfortunate bit here is that the bids uri is not persistent. we do need to add something to the id for uniqueness. otherwise two datasets loaded into a graph could have the same id for a same named file (e.g. sub-01/fmri/sub-01_task-rest_bold.nii.gz could be in many datasets). i don't think their id's should be the same. so i would suggest keeping the bids uri for atlocation and then consider how to get uniqueness to the ids here and elsewhere.
for a different project we have been constructing the id using a function of the checksum of the metadata associated with the node. this allows us to generate a graph without creating new nodes each time we run the process. and if the metadata changes (whether in keys and/or their values) a new node id is generated.
There was a problem hiding this comment.
@satra - could we get uniqueness using the dataset name in the BIDS URI? e.g. bids:ds109:sub-01/fmri/sub-01_task-rest_bold.nii.gz is unique). I think this may be a BIDS issue more than BIDS-Prov.
Note: we might need another online meeting to discuss those remaining bits? Let me know how you'd like to proceed.
There was a problem hiding this comment.
unfortunately, the dataset name is technically a key from the dataset_description (see: https://bids-specification.readthedocs.io/en/stable/common-principles.html#examples_1), so not guaranteed to be unique across datasets. bids intentionally decoupled uniqueness or persistence from the key name and in that section on bids uri notes that while certain aspects of a scheme uri are not being used, it could be used in the future (see: https://bids-specification.readthedocs.io/en/stable/common-principles.html#future-statement).
my suggestion would be to perhaps do what is being done for uniqueness of other ids.
There was a problem hiding this comment.
@satra I am sorry I don't we understand well what is the proposed update. Would it be feasible to share a small example, maybe describing how you would change lines 293-296 above? Thank you!
There was a problem hiding this comment.
a potential example:
"Id": "bids::prov#entity-acea8093",
"Label": "sub-01_task-tonecounting_bold.nii",
"AtLocation": "bids::sub-01/func/sub-01_task-tonecounting_bold.nii",
the hash acea8093 would be computed based on the other keys of this object.
There was a problem hiding this comment.
Hi Satra, Camille,
There is indeed an issue with the lines 293-296 above. It is the provenance record for an entity inside a provenance file (prov/[<subdir>/]prov-<label>_env.json) and therefore it can not describe a BIDS file that is inside the dataset (provenance metadata for such files are in sidecar JSONs).
So in this specific case, we can use the Id you propose (or an Id of the form urn:<uid>) as we do not require the Id to be a BIDS URI.
But this is a bit more complicated for other ways of describing entities in BIDS Prov. So I suggest we discuss this issue during a future meeting.
Concerning AtLocation, using a BIDS URI is fine for me.
yarikoptic
left a comment
There was a problem hiding this comment.
Next batch of comments and recommendations
| description: | | ||
| Command (or commands) performed by the activity, including all parameters. | ||
|
|
||
| Set to `null` to describe that the activity was performed manually. |
There was a problem hiding this comment.
I love present alignments to rdfs: ... is there any property within LD PROV ecosystem which could relate here?
There was a problem hiding this comment.
I could not find a relevant term for that, but any suggestion is welcome.
| description: | | ||
| Name for the activity. | ||
|
|
||
| Corresponds to [RDF Schema `rdfs:label`](https://www.w3.org/TR/rdf-schema/#ch_label). |
There was a problem hiding this comment.
this and other definitions (Id etc) are used multiple times across different metadata "array" properties. Looking through here is an example of how to define each once on top level and then reuse in specific constructs -- @effigies tell me if I am misguiding here:
DeidentificationMethodCodeSequence:
name: DeidentificationMethodCodeSequence
display_name: Deidentification Method Code Sequence
description: |
A sequence of code objects describing the mechanism or method use to remove the Patient's identity.
Corresponds to [DICOM Tag 0012, 0064](https://dicomlookup.com/dicomtags/(0012,0064))
`De-identification Method Code Sequence`.
type: array
items:
type: object
recommended:
- CodeValue
- CodeMeaning
- CodingSchemeDesignator
- CodingSchemeVersion
properties:
CodeValue:
$ref: objects.metadata.CodeValue
CodeMeaning:
$ref: objects.metadata.CodeMeaning
CodingSchemeDesignator:
$ref: objects.metadata.CodingSchemeDesignator
CodingSchemeVersion:
...it should be quite doable by claude-code to achieve quickly, let me know if I should push such RF
There was a problem hiding this comment.
We could do that, but for it to work we need unified description fields, e.g.:
Id:
name: Id
description: |
[Identifier](SPEC_ROOT/modality-agnostic-files/provenance.md#provenance-identifiers) for the object.
Corresponds to [JSON-LD `@id`](https://www.w3.org/TR/json-ld11/#syntax-tokens-and-keywords).
type: string
format: uri
Label:
name: Label
description: |
Name for the object.
Corresponds to [RDF Schema `rdfs:label`](https://www.w3.org/TR/rdf-schema/#ch_label).which feels more confusing to me.
Co-authored-by: Yaroslav Halchenko <debian@onerussian.com>
…kup in schema.objects.entities
|
This BEP is currently under review: #2405 Please post significant discussion to that thread. Minor issues, such as typos or clarifications, may be posted as suggestions to this PR. These suggestions may be accepted or rejected without discussion, so do not make substantial proposals in this way. |
BEP 028: Under review
This BEP is currently under review: #2405
Please post significant discussion to that thread. Minor issues, such as typos or clarifications, may be posted as suggestions to this PR. These suggestions may be accepted or rejected without discussion, so do not make substantial proposals in this way.
Original post
This is a work in progress PR proposing a specification update for BEP028 BIDS-Prov.
Todo lists
Blocking points
prov/[prov-<label>]BEP028_BIDSprov#169Associated BIDS examples
Shortcuts