JupyterLab : We are currently experiencing unexpected issues following a recent system update, and as a result, the Lab @ JSC is temporarily unavailable. We apologize for the inconvenience this may cause. In the meantime, we kindly ask users to use the Lab @ Cineca as an alternative.


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

From version 6.2
edited by maaike
on 2022/06/28 16:07
Change comment: There is no comment for this version
To version 6.3
edited by maaike
on 2022/06/28 16:30
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -2,7 +2,7 @@
2 2  
3 3  The EBRAINS Knowledge Graph provides convenient tools and APIs for the implementation of queries into your scripts.
4 4  
5 -**Request permission**
5 +=== Request permission ===
6 6  
7 7  To be able to access the Knowledge Graph (KG) programmatically, you require:
8 8  
... ... @@ -9,19 +9,53 @@
9 9  1. An EBRAINS account. Register for an account here: [[https:~~/~~/ebrains.eu/register/>>https://ebrains.eu/register/]]
10 10  1. Register and request credentials for your KG client by emailing support@ebrains.eu
11 11  
12 -=== Query Builder ===
12 +=== Writting Knowledge Graph queries ===
13 13  
14 +A query for the Knowledge Graph is defined declaratively in JSON-LD and always executed against a specific data structure (e.g. a "Dataset version") allowing the graph to be traversed.
15 +
16 +In the snippet below, we can see that we first define the semantical context for the query with //"@context",// which belongs to the namespace "//https:~/~/schema.hbp.eu/graphQuery/".//
17 +
18 +{{code language="python"}}
19 +{
20 + "@context": {
21 + "@vocab": "https://core.kg.ebrains.eu/vocab/query/",
22 + "query": "https://schema.hbp.eu/myQuery/",
23 + "propertyName": {
24 + "@id": "propertyName",
25 + "@type": "@id"
26 + },
27 + "path": {
28 + "@id": "path",
29 + "@type": "@id"
30 + }
31 + },
32 + "meta": {
33 + "type": "https://openminds.ebrains.eu/core/DatasetVersion",
34 + "responseVocab": "https://schema.hbp.eu/myQuery/"
35 + },
36 + "structure": {
37 + "propertyName": "query:DatasetVersionTitle",
38 + "path": "https://openminds.ebrains.eu/vocab/shortName"
39 + }
40 +}
41 +{{/code}}
42 +
43 +
44 +==== Query Builder ====
45 +
14 14  The query builder allows you to make, save, and reuse complex queries without any knowledge of graph query languages.
15 15  
16 16  Go to the Query Builder: [[https:~~/~~/query.kg.ebrains.eu>>https://query.kg.ebrains.eu/#state=6a41dd5b-3cf9-4263-8a65-83d41f27677a&session_state=638c33f5-4551-4d70-8b1d-a5c900aa62d0&code=300f25d8-caac-4576-9a21-195ccc93fd31.638c33f5-4551-4d70-8b1d-a5c900aa62d0.4214dba9-b6d0-4331-9837-3e75a10cda14]]
17 17  
18 -==== Select a category ====
50 +(% class="wikigeneratedid" id="HSelectacategory" %)
51 +**Select a category**
19 19  
20 20  A query for the Knowledge Graph is always executed against a specific data structure (e.g. a "Dataset version"). First select the data structure for your query.
21 21  
22 22  [[image:QB1.png||alt="Step 1: Select a category" height="520" width="700"]]
23 23  
24 -==== Select an experimental approach ====
57 +(% class="wikigeneratedid" id="HSelectanexperimentalapproach" %)
58 +**Select an experimental approach**
25 25  
26 26  Similar to the facetted filters in the Knowledge Graph Search UI, we can refine our query by defining the experimental approach of our interest, for example electrophysiology.
27 27  
... ... @@ -29,7 +29,8 @@
29 29  
30 30  [[image:QBstep2.png||alt="Step 2: Select modality" height="541" width="700"]]
31 31  
32 -==== Select species ====
66 +(% class="wikigeneratedid" id="HSelectspecies" %)
67 +**Select species**
33 33  
34 34  Similarly, we can refine our query for mice only.
35 35  
... ... @@ -36,7 +36,8 @@
36 36  [[image:QBstep3.png||alt="Step 3: Select species" height="543" width="700"]]
37 37  
38 38  
39 -==== Access detailed metadata ====
74 +(% class="wikigeneratedid" id="HAccessdetailedmetadata" %)
75 +**Access detailed metadata**
40 40  
41 41  (% class="wikigeneratedid" id="H" %)
42 42  Following
... ... @@ -43,7 +43,7 @@
43 43  
44 44  ==== [[image:QB4.png||alt="Step 4: Access detailed metadata" height="432" width="700"]] ====
45 45  
46 -==== ====
82 +==== ====
47 47  
48 48  The above query in the Query Builder is written below:
49 49