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

Q re JSON-LD output structure #153

Open mih opened 5 years ago

mih commented 5 years ago

Looking at the structure of the current output, I see that I get essentially three @graph, two of which are nested into the third:

{
  "@context: {...},
  "@graph": [
    {
      "@graph": [...]
    },
    {
      "@graph": [...]
    }
]
}

I wonder what the motivation is to use this particular structure over

  1. a single @graph with all the documents
  2. somehow named or identified nested graph that enable an easy decision which one has the prov info on nidmresult generation, and which one has the real thing

Regarding a semantic interpretation both modifications should not have an impact, but a simple script eating these data would have an easier time looping through a single list, than having to consider a possibly implicit structure in the node array of the top-level graph.

Thx!

satra commented 5 years ago

@mih - can you post a ttl file and the corresponding jsonld file somewhere i can take a look at? i suspect this is all a function of the @context, which may need to be changed . i thought we essentially had a list of records for the top graph, rather than a list of graphs. unless the ttl file is a trig file (a set of graphs), in which case we need to possibly fix things a bit.

mih commented 5 years ago

Here are the two files that I get after a run (renamed to be .txt for upload).

nidm.json.txt nidm.ttl.txt

Thx!

satra commented 5 years ago

@mih - this is indeed a trig based representation and there are two graphs in it.

  1. a graph describing the dataset/bundle of the provenance of the generation process
  2. the provenance of the glm.

is there a trig file created?

mih commented 5 years ago

I don't see one:

mih@meiner /tmp/nidmfslout.nidm % ll
total 3.4M
-rw-rw-r-- 1 mih mih  23K May  9 09:24 ClusterLabels.nii.gz
-r--r--r-- 1 mih mih 376K May  9 09:24 Contrast.nii.gz
-rw-rw-r-- 1 mih mih 364K May  9 09:24 ContrastStandardError.nii.gz
-rw-rw-r-- 1 mih mih  100 May  9 09:24 DesignMatrix.csv
-r--r--r-- 1 mih mih  612 May  9 09:24 DesignMatrix.png
-r--r--r-- 1 mih mih 102K May  9 09:24 ExcursionSet.nii.gz
-r--r--r-- 1 mih mih  73K May  9 09:24 ExcursionSet.png
-r--r--r-- 1 mih mih 900K May  9 09:24 GrandMean.nii.gz
-r--r--r-- 1 mih mih 8.4K May  9 09:24 Mask.nii.gz
-rw-rw-r-- 1 mih mih  48K May  9 09:24 nidm.json
-rw-rw-r-- 1 mih mih  33K May  9 09:24 nidm.ttl
-r--r--r-- 1 mih mih 376K May  9 09:24 ParameterEstimate_001.nii.gz
-rw-rw-r-- 1 mih mih 374K May  9 09:24 ResidualMeanSquares.nii.gz
-r--r--r-- 1 mih mih 8.4K May  9 09:24 SearchSpaceMask.nii.gz
-r--r--r-- 1 mih mih 376K May  9 09:24 TStatistic.nii.gz
-r--r--r-- 1 mih mih 372K May  9 09:24 ZStatistic.nii.gz
satra commented 5 years ago

ok - i'll take a closer look at the turtle file.

cmaumet commented 5 years ago

@mih: The JSON-LD structure you are looking at is the outdated one, i.e. not the one using our new context file a.k.a the "nice" JSON-LD.

I still have to update the exporter to generate the nice serialisation (#143).

satra commented 5 years ago

@cmaumet - thanks for the clarification :)

cmaumet commented 5 years ago

Discussed w/ @mih today, I need to:

cmaumet commented 5 years ago

Now implemented at https://github.com/incf-nidash/nidmresults/pull/55, if the tests pass, then we will be able to use this is the FSL NIDM exporter and get the JSON-LD 1.1. serialization.