bids-standard / BEP028_BIDSprov

Organizing and coordinating BIDS extension proposal 28 : BIDS Provenance
https://bids.neuroimaging.io/bep028
Creative Commons Attribution 4.0 International
4 stars 12 forks source link

SPM Parser for BIDSProv #49

Closed remiadon closed 3 years ago

remiadon commented 3 years ago

Is your feature request related to a problem? Please describe. Right now we provide short examples that relies on our model To get faster in the inclusion/discussion of new examples we need to automate their translation into .jsonld or .turtle files that respect BEP028

Describe the solution you'd like We want a parser that

This parse will have to be updated with regard to the specification

TODO

remiadon commented 3 years ago

@cmaumet I tried using the prov library again

Listing issues here: 1) Context: namespaces have to be added one by one, so they can be used when modifying the prov.ProvDocument instance 2) typed indexing doesnt seem really possible, neither when editing the structure nor when dumping it to a json-like format (we even have to convert it to non 1.1 JSON-LD in visualize.py)

cmaumet commented 3 years ago

Hi @remiadon, about 2 --> yes, this is related to prov library not being JSON-LD 1.1 compliant. To circumvent that issue we can use: prov -> rdflib -> pyld (as we did in the vizualisation tool). Does that help?

Not sure I understand 1, could you provide an example?

remiadon commented 3 years ago

@cmaumet

about 1. I mean that we cannot point to a context, we have to download it a "manually" add prefixes to the document before updating it

Concerning 2. I agree with you, it's possible. But the point of using prov here is to build a valid document. If I follow you workflow I'll have to build a json document before passing it to prov. This only makes sure the document is valid before dumping it, but is not equivalent to checking for validity when building the document

I can add this anyway, that would still avoid some errors

cmaumet commented 3 years ago

Discussed on Feb 11 w/ @remiadon: 1/ As a workaround we can download the context file locally and then load with the prov library 2/ We'll create documents directly using the prov library (no need to build a json document first)