Wiki source code of Programming Interface Application
Hide last authors
author | version | line-number | content |
---|---|---|---|
![]() |
1.1 | 1 | == Programmatic access (API) == |
2 | |||
3 | The EBRAINS Knowledge Graph provides convenient tools and APIs for the implementation of queries into your scripts. | ||
4 | |||
5 | **Request permission** | ||
6 | |||
7 | To be able to access the Knowledge Graph (KG) programmatically, you require: | ||
8 | |||
9 | 1. An EBRAINS account. Register for an account here: [[https:~~/~~/ebrains.eu/register/>>https://ebrains.eu/register/]] | ||
10 | 1. Register and request credentials for your KG client by emailing support@ebrains.eu | ||
11 | |||
12 | === Query Builder === | ||
13 | |||
14 | The query builder allows you to make, save, and reuse complex queries without any knowledge of graph query languages. | ||
15 | |||
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 | |||
18 | ==== Select a category ==== | ||
19 | |||
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 | |||
22 | [[image:QB1.png||alt="Step 1: Select a category" height="520" width="700"]] | ||
23 | |||
24 | ==== Select an experimental approach ==== | ||
25 | |||
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 | |||
28 | To ensure that all dataset versions with electrophysiology are queried, and none of the dataset versions without electrophysiology, we make this property required and we apply a filter to the label we are searching for (i.e. electrophysiology). | ||
29 | |||
30 | [[image:QBstep2.png||alt="Step 2: Select modality" height="541" width="700"]] | ||
31 | |||
32 | ==== Select species ==== | ||
33 | |||
34 | Similarly, we can refine our query for mice only. | ||
35 | |||
36 | [[image:QBstep3.png||alt="Step 3: Select species" height="543" width="700"]] | ||
37 | |||
38 | ==== Access detailed metadata ==== | ||
39 | |||
40 | ==== Or code ==== | ||
41 | |||
42 | Code blocks can be added by using the code macro: | ||
43 | |||
44 | {{code language="python"}} | ||
45 | x = 1 | ||
46 | if x == 1: | ||
47 | # indented four spaces | ||
48 | print("x is 1.") | ||
49 | {{/code}} | ||
50 | |||
51 | (% class="wikigeneratedid" id="HH4Won27tAppearinToC" %) | ||
52 |