incf-nidash / PyNIDM

Other
21 stars 31 forks source link

bidsmri2nidm - Conversion of Author lists #397

Open ckindermann opened 4 months ago

ckindermann commented 4 months ago

Hi,

A list of distinct authors in BIDS gets converted into a single string in NIDM.

For example, the following dataset_description.json

{ 
    "Name": "Example Dataset Name",
    "BIDSVersion": "1.9.0",
    "License": "CC0",
    "Authors": [
        "Jane Doe",
        "John Doe",
        "Adam Smith"
    ]
}

gets converted into the following RDF (serialized in Turtle - prefixes omitted):

niiri:id123 a bids:Dataset,
       prov:Collection,
       prov:Entity ;
    bids:BIDSVersion "1.9.0"^^xsd:string ;
    dcterms:license "CC0"^^xsd:string ;
    dcat:author "Jane DoeJohn DoeAdam Smith"^^xsd:string .

I would have expected the following:

niiri:id123 a bids:Dataset,
       prov:Collection,
       prov:Entity ;
    bids:BIDSVersion "1.9.0"^^xsd:string ;
    dcterms:license "CC0"^^xsd:string ;
    dcat:author "Jane Doe"^^xsd:string, 
                "John Doe"^^xsd:string,
                "Adam Smith"^^xsd:string .
yarikoptic commented 4 months ago

sounds like a bug indeed... if you get a chance/time to dig it to fix it and send PR -- would be appreciated. Should be an easy fix I hope

ckindermann commented 4 months ago

I suspect the bug is introduced here. The join seems problematic in general, but perhaps I'm overlooking something.