Changes for page 3 Try it yourself!

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

From version 10.1
edited by maaike
on 2022/07/06 08:27
Change comment: There is no comment for this version
To version 10.3
edited by maaike
on 2022/07/06 08:53
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -98,9 +98,9 @@
98 98  
99 99  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.
100 100  
101 -We have again taken advantage of the type filter (set it to subjects and subject groups), and we flattened the query where possible. This means that you now find multiple elements in the "path" for "biological sex" and for the "age category".
101 +We are showing the unflattened query here. You can take advantage of the type filter (set it to subjects and subject groups), and flatten the query where possible. The query will look different; there will be multiple elements in the "path" for "biological sex" and for the "age category".
102 102  
103 -Try it yourself and check out the differences between the results of the flattened and unflattened queries!
103 +Try it yourself and check out the differences between the results of the flattened and unflattened queries! Hint: look at the indexing of elements within your results!
104 104  
105 105  {{code language="json" layout="LINENUMBERS"}}
106 106  {
... ... @@ -117,8 +117,9 @@
117 117   }
118 118   },
119 119   "meta": {
120 - "type": "https://openminds.ebrains.eu/core/DatasetVersion",
121 - "responseVocab": "https://schema.hbp.eu/myQuery/"
120 + "name": "FENS-example2",
121 + "responseVocab": "https://schema.hbp.eu/myQuery/",
122 + "type": "https://openminds.ebrains.eu/core/DatasetVersion"
122 122   },
123 123   "structure": [
124 124   {
... ... @@ -154,28 +154,35 @@
154 154   },
155 155   {
156 156   "propertyName": "query:biologicalSex",
158 + "path": "https://openminds.ebrains.eu/vocab/biologicalSex",
157 157   "required": true,
158 - "filter": {
159 - "op": "EQUALS",
160 - "value": "male"
161 - },
162 - "path": [
163 - "https://openminds.ebrains.eu/vocab/biologicalSex",
164 - "https://openminds.ebrains.eu/vocab/name"
165 - ]
160 + "structure": {
161 + "propertyName": "query:name",
162 + "path": "https://openminds.ebrains.eu/vocab/name",
163 + "filter": {
164 + "op": "EQUALS",
165 + "value": "male"
166 + }
167 + }
166 166   },
167 167   {
168 168   "propertyName": "query:studiedState",
171 + "path": "https://openminds.ebrains.eu/vocab/studiedState",
169 169   "required": true,
170 - "filter": {
171 - "op": "EQUALS",
172 - "value": "adult"
173 - },
174 - "path": [
175 - "https://openminds.ebrains.eu/vocab/studiedState",
176 - "https://openminds.ebrains.eu/vocab/ageCategory",
177 - "https://openminds.ebrains.eu/vocab/name"
178 - ]
173 + "structure": {
174 + "propertyName": "query:ageCategory",
175 + "path": "https://openminds.ebrains.eu/vocab/ageCategory",
176 + "required": true,
177 + "structure": {
178 + "propertyName": "query:name",
179 + "path": "https://openminds.ebrains.eu/vocab/name",
180 + "required": true,
181 + "filter": {
182 + "op": "EQUALS",
183 + "value": "adult"
184 + }
185 + }
186 + }
179 179   }
180 180   ]
181 181   }
... ... @@ -256,7 +256,7 @@
256 256  }
257 257  {{/code}}
258 258  
259 - **Query datasets based on content type**
267 +**Query datasets based on content type**
260 260  
261 261  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".
262 262