User examples
- How many datasets used human subjects?
- Find datasets with male adult subjects
- Find datasets that contain NIfTI files
- Find the software that can be used to open .smr file formats?
Log in to your EBRAINS account and try running the examples yourself!
Example 1 - How many datasets used human subjects?
Search UI
In the filter function, select "Homo Sapiens" under species. This filters the available datasets in the Knowledge Graph for human subjects only.
Query Builder
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.
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.
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
"@context": {
"@vocab": "https://core.kg.ebrains.eu/vocab/query/",
"query": "https://schema.hbp.eu/myQuery/",
"propertyName": {
"@id": "propertyName",
"@type": "@id"
},
"path": {
"@id": "path",
"@type": "@id"
}
},
"meta": {
"type": "https://openminds.ebrains.eu/core/DatasetVersion",
"responseVocab": "https://schema.hbp.eu/myQuery/"
},
"structure": [
{
"propertyName": "query:id",
"path": "@id"
},
{
"propertyName": "query:studiedSpecimen",
"required": true,
"filter": {
"op": "CONTAINS",
"value": "Homo sapiens"
},
"path": [
{
"@id": "https://openminds.ebrains.eu/vocab/studiedSpecimen",
"typeFilter": [
{
"@id": "https://openminds.ebrains.eu/core/Subject"
},
{
"@id": "https://openminds.ebrains.eu/core/SubjectGroup"
}
]
},
{
"@id": "https://openminds.ebrains.eu/vocab/species",
"typeFilter": [
{
"@id": "https://openminds.ebrains.eu/controlledTerms/Species"
}
]
},
"https://openminds.ebrains.eu/vocab/name"
]
}
]
}
Example 2 - Find datasets with male adult subjects
Search UI
All the metadata in the knowledge graph is represented by nodes and their relationships by the edges. Most of the "basic" metadata is visualised in the Search UI to make it easy for the user to find datasets that fit certain criteria without needing to know how to navigate and traverse a graph structure. When searching for "male adult" subjects in the search UI, we find datasets that have these keywords in any of the text summarised on the dataset card (it is a 'fuzzy search' : https://search.kg.ebrains.eu/?category=Dataset&q=male%20and%20adult). To ensure we only look for the any specimen (subjects or samples) originating from male adult mice, we need to write a query and extract the metadata programmatically.
Query Builder
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.
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
"@context": {
"@vocab": "https://core.kg.ebrains.eu/vocab/query/",
"query": "https://schema.hbp.eu/myQuery/",
"propertyName": {
"@id": "propertyName",
"@type": "@id"
},
"path": {
"@id": "path",
"@type": "@id"
}
},
"meta": {
"type": "https://openminds.ebrains.eu/core/DatasetVersion",
"responseVocab": "https://schema.hbp.eu/myQuery/"
},
"structure": [
{
"propertyName": "query:id",
"path": "@id"
},
{
"propertyName": "query:shortName",
"path": "https://openminds.ebrains.eu/vocab/shortName"
},
{
"propertyName": "query:studiedSpecimen",
"path": "https://openminds.ebrains.eu/vocab/studiedSpecimen",
"required": true,
"structure": [
{
"propertyName": "query:id",
"path": "@id"
},
{
"propertyName": "query:biologicalSex",
"path": "https://openminds.ebrains.eu/vocab/biologicalSex",
"required": true,
"structure": {
"propertyName": "query:name",
"path": "https://openminds.ebrains.eu/vocab/name",
"required": true,
"filter": {
"op": "EQUALS",
"value": "male"
}
}
},
{
"propertyName": "query:studiedState",
"path": "https://openminds.ebrains.eu/vocab/studiedState",
"required": true,
"structure": {
"propertyName": "query:ageCategory",
"path": "https://openminds.ebrains.eu/vocab/ageCategory",
"required": true,
"structure": {
"propertyName": "query:name",
"path": "https://openminds.ebrains.eu/vocab/name",
"required": true,
"filter": {
"op": "EQUALS",
"value": "adult"
}
}
}
}
]
}
]
}
Example 3 - Find datasets that contain NIfTI files
Search UI
Files are organised based on their file format (i.e. file extension) and the software that could be used to open these files. In openMINDS this is captured with the content type. In the filter function, select "application/vnd.nifti.1" under content types to select all the dataset with a NIfTI 1 file format.
Query Builder
To find datasets with a particular file format in it, we can either write a query for 1) the file extension or 2) based on the content type. The difference between the two approaches is that the first approach just looks at the file extension without considering the what type of file format it is and what software can be used to open it. For example, both nifti 1 and nifti 2 files have the same extension. The nifti 2 format is an update of nifti 1 and will not be recognised as a valid nifti 1 format. This is important when considering what program to use when opening the files. To be able to differentiate, we describe the files with content types that tell the user what type of file format it is and we have linked a number of software applications to that content type to facilitate reuse of the data.
Query datasets based on file extension
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.
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
"@context": {
"@vocab": "https://core.kg.ebrains.eu/vocab/query/",
"query": "https://schema.hbp.eu/myQuery/",
"propertyName": {
"@id": "propertyName",
"@type": "@id"
},
"path": {
"@id": "path",
"@type": "@id"
}
},
"meta": {
"type": "https://openminds.ebrains.eu/core/DatasetVersion",
"responseVocab": "https://schema.hbp.eu/myQuery/"
},
"structure": [
{
"propertyName": "query:shortName",
"path": "https://openminds.ebrains.eu/vocab/shortName"
},
{
"propertyName": "query:id",
"path": "@id"
},
{
"propertyName": "query:repository",
"path": "https://openminds.ebrains.eu/vocab/repository",
"required": true,
"structure": {
"propertyName": "query:fileRepository",
"path": {
"@id": "https://openminds.ebrains.eu/vocab/fileRepository",
"reverse": true
},
"required": true,
"structure": {
"propertyName": "query:name",
"path": "https://openminds.ebrains.eu/vocab/name",
"required": true,
"filter": {
"op": "ENDS_WITH",
"value": ".nii.gz"
}
}
}
}
]
}
Query datasets based on content type
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".
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
"@context": {
"@vocab": "https://core.kg.ebrains.eu/vocab/query/",
"query": "https://schema.hbp.eu/myQuery/",
"propertyName": {
"@id": "propertyName",
"@type": "@id"
},
"path": {
"@id": "path",
"@type": "@id"
}
},
"meta": {
"type": "https://openminds.ebrains.eu/core/DatasetVersion",
"responseVocab": "https://schema.hbp.eu/myQuery/"
},
"structure": [
{
"propertyName": "query:shortName",
"path": "https://openminds.ebrains.eu/vocab/shortName"
},
{
"propertyName": "query:id",
"path": "@id"
},
{
"propertyName": "query:repository",
"path": "https://openminds.ebrains.eu/vocab/repository",
"required": true,
"structure": {
"propertyName": "query:contentTypePattern",
"path": "https://openminds.ebrains.eu/vocab/contentTypePattern",
"required": true,
"structure": {
"propertyName": "query:contentType",
"path": "https://openminds.ebrains.eu/vocab/contentType",
"required": true,
"structure": {
"propertyName": "query:name",
"path": "https://openminds.ebrains.eu/vocab/name",
"required": true,
"filter": {
"op": "CONTAINS",
"value": "nifti"
}
}
}
}
}
]
}
Example 4 - Find the software that can be used to open .smr file formats?
Search UI
To find software that can open a particular file format like the Spike2 file format (.smr), we can select the category "software" and then filter based on "input format". We select "application/vnd.spike2.sonpy.son" to ensure we only get software for this file format.
https://search.kg.ebrains.eu/?category=Software&inputFormats[0]=application%2Fvnd.spike2.sonpy.son
Query Builder
For this question, we will execute the query against the "softwareVersion data structure. We ask for the name, version and input type of the software. We further refine our query by restricting the result to software that can open files with the file extension ".smr". We get the same 3 software types as in the search, and we immediately see that one of the software types has multiple versions that can open this kind of files.
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
"@context": {
"@vocab": "https://core.kg.ebrains.eu/vocab/query/",
"query": "https://schema.hbp.eu/myQuery/",
"propertyName": {
"@id": "propertyName",
"@type": "@id"
},
"path": {
"@id": "path",
"@type": "@id"
}
},
"meta": {
"type": "https://openminds.ebrains.eu/core/SoftwareVersion",
"responseVocab": "https://schema.hbp.eu/myQuery/"
},
"structure": [
{
"propertyName": "query:id",
"path": "@id"
},
{
"propertyName": "query:shortName",
"path": "https://openminds.ebrains.eu/vocab/shortName"
},
{
"propertyName": "query:versionIdentifier",
"path": "https://openminds.ebrains.eu/vocab/versionIdentifier"
},
{
"propertyName": "query:inputFormat",
"path": "https://openminds.ebrains.eu/vocab/inputFormat",
"required": true,
"structure": [
{
"propertyName": "query:name",
"path": "https://openminds.ebrains.eu/vocab/name"
},
{
"propertyName": "query:fileExtension",
"path": "https://openminds.ebrains.eu/vocab/fileExtension",
"required": true,
"filter": {
"op": "CONTAINS",
"value": ".smr"
}
}
]
}
]
}