Update proposal for BIDS Prov (BEP028)
Problem Statement
BIDS-prov provides a framework to describe any neuroimaging pipeline as a graph of operations, defined over digital entities
For our description to be generic enough we use 3 main concepts: Activities, Entities, and Agents.
One our graph is built, we want to allow a broad range of operations on it. The most basic operation we could think of is querying the graph, e.g to search for an entity giving part of its name.
Rationale
json-LD does not bring any kind of constraint on how we should define a graph, all we have to do is to respect the JSON syntax. Activities, Entities, and Agents could be defined anywhere, in any order, which makes it harder to investigate.
For our queries to be written easily, and run fast, we have to find a compromise between respecting the JSON syntax and setting up constraint on the structure of our graph.
For this purpose we use type indexing, which consists in using the types of the digital objects we describe as the primary key. This gives a very simple structure to our graph (a key for Agents, one for Entities, and one for Activities), yet allowing flexible definitions to correspond to those keys.
Minimal example
Here is an extract from examples/spm_default/realign.json
...
"prov:Agent": [
{
"@id": "RRID:SCR_007037",
"@type": "prov:SoftwareAgent",
"label": "SPM"
}
],
"prov:Activity": [
{
"@id": "niiri:fdskjfnskjndflqkjndl",
"label": "realign",
"wasAssociatedWith": "RRID:SCR_007037",
"startedAtTime": "10/10/2020 00:00:00",
"endedAtTime": "10/10/2020 01:00:00",
"used": "niiri:sjhgdqd",
"attributes": [
["eoptions.quality", 0.9],
["eoptions.sep", 4],
["eoptions.fwhm", 5],
]
}
],
"prov:Entity": [
{
"@id": "niiri:fdsjnflqj12381U39fdskjnf",
"wasAttributedTo": "RRID:SCR_007037",
"wasGeneratedBy": "niiri:fdskjfnskjndflqkjndl",
"derivedFrom": "niiri:sjhgdqd",
"label": "Realigned func",
}
]
}
and here it how it would turn WITHOUT TYPE INDEXING
...
[
{
"@id": "RRID:SCR_007037",
"@type": "prov:Agent",
"label": "SPM"
},
{
"@id": "niiri:fdskjfnskjndflqkjndl",
"@type" : "prov:Activity",
"label": "realign",
"wasAssociatedWith": "RRID:SCR_007037",
"startedAtTime": "10/10/2020 00:00:00",
"endedAtTime": "10/10/2020 01:00:00",
"used": "niiri:sjhgdqd",
"attributes": [
["eoptions.quality", 0.9],
["eoptions.sep", 4],
["eoptions.fwhm", 5],
]
},
{
"@id": "niiri:fdsjnflqj12381U39fdskjnf",
"@type" : "prov:Entity",
"wasAttributedTo": "RRID:SCR_007037",
"wasGeneratedBy": "niiri:fdskjfnskjndflqkjndl",
"derivedFrom": "niiri:sjhgdqd",
"label": "Realigned func",
}
]
Checklist