incf-nidash / nidmresults-fsl

A python library to export FSL's feat results to NIDM-Results
http://nidm.nidash.org/specs/nidm-results.html
MIT License
3 stars 11 forks source link

JSON-LD metadata structure observation #159

Open mih opened 5 years ago

mih commented 5 years ago

Just reporting it, because I cannot immediately explain it to myself:

@graph.records.prov:Entity contains records on parameter estimate maps like:

          {
            "@id": "http://dx.datalad.org/MD5E-s238304--9f4f0e08cab456757ec71e58166a874f.nii.gz",
            "crypto:sha512": "919a24080fc9dddb3f3825fc7b545824cd3bdb646c10e764872d3ab8bf60eebbfe7bc4bfc32311e1b3b9ad4559bac7d01d1710de689db92028efc5cd6fcd4d05",
            "dct:format": "image/nifti",
            "nidm:NIDM_0000104": {
              "@id": "niiri:d039a830-4d39-4046-8274-21cfdd073b98"
            },
            "nfo:fileName": "ParameterEstimate_018.nii.gz",
            "rdfs:label": "Parameter estimate 18",
            "prov:atLocation": {
              "@type": "xsd:anyURI",
              "@value": "ParameterEstimate_018.nii.gz"
            },
            "prov:wasGeneratedBy": {
              "@id": "niiri:c520976f-62a5-4f29-ba97-6caa2aef7c1e"
            },
            "@type": "ParameterEstimateMap"
          },

but not all such records are in this location. The rest (non-overlapping) is at @graph.records.ParameterEstimateMap, such as:

          {
            "@id": "http://dx.datalad.org/MD5E-s241948--f7674abecd12cefa7a17bc56983f7f81.nii.gz",
            "crypto:sha512": "4485f0fd34322cb4591e08e4354c286345a3c0e09ee84bf189acdff5cb4955c538f0b7d2d9b3a4b71b6adce6495676b96915f4316615f331bb243a0452348691",
            "dct:format": "image/nifti",
            "nidm:NIDM_0000104": {
              "@id": "niiri:d039a830-4d39-4046-8274-21cfdd073b98"
            },
            "nfo:fileName": "ParameterEstimate_005.nii.gz",
            "rdfs:label": "Parameter estimate 5",
            "prov:atLocation": {
              "@type": "xsd:anyURI",
              "@value": "ParameterEstimate_005.nii.gz"
            },
            "prov:wasGeneratedBy": {
              "@id": "niiri:c520976f-62a5-4f29-ba97-6caa2aef7c1e"
            },
            "@type": "prov:Entity"
          },

What is the reason for this difference in placement? Minus the type info they look the same to me, and I wonder why they would be of different type?

satra commented 5 years ago

@mih - this is a quirk of our explicit types of records in the jsonld context.

because jsonld is still a graph, the underlying data structure doesn't change, but the serializer creates lists of entities by type.

one way to fix this is to not assign multiple types to a node unless necessary. in this particular case: ParameterEstimateMap would be a subclass of prov:Entity so it is not necessary to assign two types to it at the document level.

cmaumet commented 5 years ago

@mih: Thanks for reporting this back. As @satra said, we had discussed removing the second (more generic type) to simplify the graph., I've kept a record of this at: https://github.com/incf-nidash/nidm-specs/pull/479 where we have a list of improvements needed for the JSON-LD representation.