Changes for page 3 Try it yourself!

Last modified by maaike on 2022/07/06 10:08

From version 2.4
edited by maaike
on 2022/06/28 10:33
Change comment: There is no comment for this version
To version 3.1
edited by oschmid
on 2022/06/29 15:35
Change comment: There is no comment for this version

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.maaike
1 +XWiki.oschmid
Content
... ... @@ -6,8 +6,6 @@
6 6  1. Find datasets that contain NIfTI files
7 7  1. Find the software that can be used to open .smr file formats?
8 8  
9 -=== ===
10 -
11 11  === Example 1 - How many datasets used human subjects? ===
12 12  
13 13  ==== **Search UI** ====
... ... @@ -18,7 +18,66 @@
18 18  
19 19  ==== **Query Builder** ====
20 20  
19 +To search for datasets containing human subjects only, you can first declare the id (to get the involved instances) as well as a link to the "studied specimen" (you can add a type filter and restrict it to "Subject" and "Subject group" only since we are not interested in "Tissue samples" and "Tissue sample collections" in this moment). From "studied specimen", we're interested in the "Species" (here you can - again add a type filter to exclude "Strain" since this is irrelevant for human subjects). For the "Species", we want the "label" to contain "homo sapiens" which is why we add a filter "contains" with the value "homo sapiens".  We might want to simplify the deeply nested structure by "flattening" both, the "Studied specimen" as well as the "Species". Once we go to the "execute query" section (the play button on the left) and we run the query, we can see the total number of dataset versions.
20 +\\Please note that this number can differ from the one you figured out in the search UI. The reason for this is, that the search UI does only count the newest dataset version whilst the query also returns older dataset versions.
21 21  
22 +{{code language="json" layout="LINENUMBERS"}}
23 +{
24 + "@context": {
25 + "@vocab": "https://core.kg.ebrains.eu/vocab/query/",
26 + "query": "https://schema.hbp.eu/myQuery/",
27 + "propertyName": {
28 + "@id": "propertyName",
29 + "@type": "@id"
30 + },
31 + "path": {
32 + "@id": "path",
33 + "@type": "@id"
34 + }
35 + },
36 + "meta": {
37 + "type": "https://openminds.ebrains.eu/core/DatasetVersion",
38 + "responseVocab": "https://schema.hbp.eu/myQuery/"
39 + },
40 + "structure": [
41 + {
42 + "propertyName": "query:id",
43 + "path": "@id"
44 + },
45 + {
46 + "propertyName": "query:studiedSpecimen",
47 + "required": true,
48 + "filter": {
49 + "op": "CONTAINS",
50 + "value": "Homo sapiens"
51 + },
52 + "path": [
53 + {
54 + "@id": "https://openminds.ebrains.eu/vocab/studiedSpecimen",
55 + "typeFilter": [
56 + {
57 + "@id": "https://openminds.ebrains.eu/core/Subject"
58 + },
59 + {
60 + "@id": "https://openminds.ebrains.eu/core/SubjectGroup"
61 + }
62 + ]
63 + },
64 + {
65 + "@id": "https://openminds.ebrains.eu/vocab/species",
66 + "typeFilter": [
67 + {
68 + "@id": "https://openminds.ebrains.eu/controlledTerms/Species"
69 + }
70 + ]
71 + },
72 + "https://openminds.ebrains.eu/vocab/name"
73 + ]
74 + }
75 + ]
76 +}
77 +{{/code}}
78 +
22 22  === Example 2 - Find datasets with male adult subjects ===
23 23  
24 24  ==== **Search UI** ====
... ... @@ -27,8 +27,10 @@
27 27  
28 28  ==== **Query Builder** ====
29 29  
30 -{{code language="python"}}
31 -query = {
87 +For dataset versions that use male adult subjects, we can filter datasets using these 2 properties. The easiest way is to add a required filter to biological sex that is "EQUAL" to "male" and the age category "EQUAL" to "adult". By selecting the filter "EQUAL" instead of "CONTAINS", we ensure that only datasets with adult animals are found. If we want to be more general and include all subjects from the onset of sexual maturity, we can use "CONTAINS" instead as this will include subjects with the age category "prime adult", "young adult" and "late adult" as well.
88 +
89 +{{code language="json" layout="LINENUMBERS"}}
90 +{
32 32   "@context": {
33 33   "@vocab": "https://core.kg.ebrains.eu/vocab/query/",
34 34   "query": "https://schema.hbp.eu/myQuery/",
... ... @@ -120,8 +120,8 @@
120 120  
121 121  We can restrict the search results with a filter using a required field. In this particular case a filter that "ENDS_WITH" a value (e.g. .nii.gz) could be used. We can use .nii for normal nifti files or .nii.gz for compressed nifty files.
122 122  
123 -{{code language="python"}}
124 -query = {
182 +{{code language="json" layout="LINENUMBERS"}}
183 +{
125 125   "@context": {
126 126   "@vocab": "https://core.kg.ebrains.eu/vocab/query/",
127 127   "query": "https://schema.hbp.eu/myQuery/",
... ... @@ -177,8 +177,8 @@
177 177  
178 178  To find datasets using the content type structure, we can use a filter that "CONTAINS" a value (e.g. nifti). We are now not distinguishing between nifti 1 or nifti 2 files, but select all files that are classified as "nifti". If you want to narrow down the results further, you could replace "nifti" by "nifti.1" or "nifti.2".
179 179  
180 -{{code language="python"}}
181 -query = {
239 +{{code language="json" layout="LINENUMBERS"}}
240 +{
182 182   "@context": {
183 183   "@vocab": "https://core.kg.ebrains.eu/vocab/query/",
184 184   "query": "https://schema.hbp.eu/myQuery/",