Changes for page 2 Application Programming Interface (API)
Last modified by maaike on 2022/07/06 10:10
Summary
-
Page properties (1 modified, 0 added, 0 removed)
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,53 +9,19 @@ 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 -=== WrittingKnowledgeGraphqueries===12 +=== Query Builder === 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 - 46 46 The query builder allows you to make, save, and reuse complex queries without any knowledge of graph query languages. 47 47 48 48 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]] 49 49 50 -(% class="wikigeneratedid" id="HSelectacategory" %) 51 -**Select a category** 18 +==== Select a category ==== 52 52 53 53 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. 54 54 55 55 [[image:QB1.png||alt="Step 1: Select a category" height="520" width="700"]] 56 56 57 -(% class="wikigeneratedid" id="HSelectanexperimentalapproach" %) 58 -**Select an experimental approach** 24 +==== Select an experimental approach ==== 59 59 60 60 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. 61 61 ... ... @@ -63,8 +63,7 @@ 63 63 64 64 [[image:QBstep2.png||alt="Step 2: Select modality" height="541" width="700"]] 65 65 66 -(% class="wikigeneratedid" id="HSelectspecies" %) 67 -**Select species** 32 +==== Select species ==== 68 68 69 69 Similarly, we can refine our query for mice only. 70 70 ... ... @@ -71,8 +71,7 @@ 71 71 [[image:QBstep3.png||alt="Step 3: Select species" height="543" width="700"]] 72 72 73 73 74 -(% class="wikigeneratedid" id="HAccessdetailedmetadata" %) 75 -**Access detailed metadata** 39 +==== Access detailed metadata ==== 76 76 77 77 (% class="wikigeneratedid" id="H" %) 78 78 Following ... ... @@ -79,7 +79,7 @@ 79 79 80 80 ==== [[image:QB4.png||alt="Step 4: Access detailed metadata" height="432" width="700"]] ==== 81 81 82 -==== ==== 46 +==== ==== 83 83 84 84 The above query in the Query Builder is written below: 85 85