{"action":"created","issue":{"url":"https://api.github.com/repos/incf-nidash/nidm/issues/329","labels_url":"https://api.github.com/repos/incf-nidash/nidm/issues/329/labels{/name}","comments_url":"https://api.github.com/repos/incf-nidash/nidm/issues/329/comments","events_url":"https://api.github.com/repos/incf-nidash/nidm/issues/329/events","html_url":"https://github.com/incf-nidash/nidm/issues/329","id":75197605,"number":329,"title":"Querying for the applied threshold","user":{"login":"cmaumet","id":5374264,"avatar_url":"https://avatars.githubusercontent.com/u/5374264?v=3","gravatar_id":"","url":"https://api.github.com/users/cmaumet","html_url":"https://github.com/cmaumet","followers_url":"https://api.github.com/users/cmaumet/followers","following_url":"https://api.github.com/users/cmaumet/following{/other_user}","gists_url":"https://api.github.com/users/cmaumet/gists{/gist_id}","starred_url":"https://api.github.com/users/cmaumet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmaumet/subscriptions","organizations_url":"https://api.github.com/users/cmaumet/orgs","repos_url":"https://api.github.com/users/cmaumet/repos","events_url":"https://api.github.com/users/cmaumet/events{/privacy}","received_events_url":"https://api.github.com/users/cmaumet/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/incf-nidash/nidm/labels/Data%20Model","name":"Data Model","color":"5319e7"},{"url":"https://api.github.com/repos/incf-nidash/nidm/labels/nidm-results","name":"nidm-results","color":"f7c6c7"},{"url":"https://api.github.com/repos/incf-nidash/nidm/labels/Terms","name":"Terms","color":"bfdadc"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-05-11T11:57:45Z","updated_at":"2015-05-11T16:34:27Z","closed_at":null,"body":"I wonder if we could update our model to make it easier to query for the threshold value chosen by the user.\r\n\r\n##### Description of the issue\r\nWith the current model (written using semantic ids for readability):\r\n<pre>\r\nniiri:inference_id a nidm:Inference ;\r\n\tprov:used niiri:height_threshold_id .\r\n\r\nniiri:height_threshold_id a prov:Entity , nidm:HeightThreshold ;\r\n\trdfs:label \"Height Threshold: p<0.05 (FWE)\" ;\r\n\tnidm:userSpecifiedThresholdType: \"p-value FWE\"^^xsd:string ;\r\n\tnidm:pValueFWER: \"0.05\"^^xsd:float ;\r\n\tnidm:pValueUncorrected: \"7.62276079258051e-07\"^^xsd:float ;\r\n\tprov:value \"5.23529984739211\"^^xsd:float .\r\n</pre>\r\n\r\nwe need two separate queries to retrieve what was the value of the applied threshold:\r\n\r\n1. Retrieve the type of threshold that was applied\r\n<pre>\r\nSELECT ?thresh_type ?height_id WHERE { \r\n  ?height_id a nidm:HeightThreshold .\r\n  ?inference_id a nidm:Inference .\r\n  ?inference_id prov:used ?height .\r\n  <b>?height_id nidm:userSpecifiedThresholdType ?thresh_type.</b>\r\n}\r\n</pre>\r\n\r\n2. Depending on `?thresh_type` (xsd:string) query for the appropriate term. For instance if `?thresh_type = \"p-value FWER\"`:\r\n<pre>\r\nSELECT ?thresh_value WHERE { \r\n  <b>?height_id nidm:pValueFWER ?thresh_value.</b>\r\n}\r\n</pre>\r\n\r\n##### Proposal\r\n\r\n###### Threshold value chosen by the user\r\nIf we update the model as follows:\r\n<pre>\r\nniiri:inference_id a nidm:Inference ;\r\n    prov:used niiri:height_threshold_id .\r\n\r\nniiri:height_threshold_id a prov:Entity , nidm:HeightThreshold, <b>obo:pValueFWER</b> ;\r\n    rdfs:label \"Height Threshold: p<0.05 (FWE)\" ;\r\n    prov:value \"0.05\"^^xsd:float ;\r\n    nidm:equivalentThreshold niiri:height_threshold_id_2 ;\r\n    nidm:equivalentThreshold niiri:height_threshold_id_3 .\r\n\r\nniiri:height_threshold_id_2 a prov:Entity , nidm:HeightThreshold, <b>nidm:pValueUncorrected</b> ;\r\n    rdfs:label \"Height Threshold: p<7.62276079258051e-07 (uncorrected)\" ;\r\n    prov:value \"7.62276079258051e-07\"^^xsd:float .\r\n\r\nniiri:height_threshold_id_3 a prov:Entity , nidm:HeightThreshold, <b>obo:statistic</b> ;\r\n    rdfs:label \"Height Threshold: T>5.23529984739211 (FWE)\" ;\r\n    prov:value \"5.23529984739211\"^^xsd:float .\r\n</pre>\r\n\r\nwe can retrieve the applied threshold in a single query:\r\n<pre>\r\nSELECT ?thresh_type ?thresh_value WHERE { \r\n  ?height_id a nidm:HeightThreshold .\r\n  ?inference_id a nidm:Inference .\r\n  ?inference_id prov:used ?height_id .\r\n  <b>?height_id a ?thresh_type</b> .\r\n  <b>?height_id prov:value ?thresh_value.</b>\r\n\r\n  FILTER(?thresh_type NOT IN (nidm:HeightThreshold, prov:Entity))\r\n}\r\n</pre>\r\n\r\n###### Threshold value of a given type (e.g. p-value FWER)\r\nLooking for the threshold value of a given type, is a bit more complex but still feasible in a single query:\r\n<pre>\r\n    SELECT ?thresh_value WHERE {\r\n      ?height_id a nidm:HeightThreshold .\r\n      ?inference_id a nidm:Inference .\r\n      ?inference_id prov:used ?height_id .\r\n     {\r\n      ?height_id a obo:pValueFWER .\r\n      ?height_id prov:value ?thresh_value .\r\n     } UNION {\r\n      ?height_id nidm:equivalentThreshold ?height_type_id .\r\n      ?height_type_id a obo:pValueFWER .\r\n      ?height_type_id prov:value ?thresh_value .\r\n     }\r\n    }\r\n</pre>\r\n\r\n###### Re-use of STATO terms\r\nUsing the proposed update, we would also be able to re-use directly STATO terms for p-values (as we now need classes instead of data properties) (cf. #304 for more details)."},"comment":{"url":"https://api.github.com/repos/incf-nidash/nidm/issues/comments/100972962","html_url":"https://github.com/incf-nidash/nidm/issues/329#issuecomment-100972962","issue_url":"https://api.github.com/repos/incf-nidash/nidm/issues/329","id":100972962,"user":{"login":"cmaumet","id":5374264,"avatar_url":"https://avatars.githubusercontent.com/u/5374264?v=3","gravatar_id":"","url":"https://api.github.com/users/cmaumet","html_url":"https://github.com/cmaumet","followers_url":"https://api.github.com/users/cmaumet/followers","following_url":"https://api.github.com/users/cmaumet/following{/other_user}","gists_url":"https://api.github.com/users/cmaumet/gists{/gist_id}","starred_url":"https://api.github.com/users/cmaumet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmaumet/subscriptions","organizations_url":"https://api.github.com/users/cmaumet/orgs","repos_url":"https://api.github.com/users/cmaumet/repos","events_url":"https://api.github.com/users/cmaumet/events{/privacy}","received_events_url":"https://api.github.com/users/cmaumet/received_events","type":"User","site_admin":false},"created_at":"2015-05-11T16:34:27Z","updated_at":"2015-05-11T16:34:27Z","body":"We discussed this on NIDASH call on May 11th."}}