Wiki source code of Importing Dataset schemas into a Knowledge Graph with the Guacamole VM and VRE Command Line Tool
Last modified by publicadmin on 2025/12/16 13:04
Show last authors
| author | version | line-number | content |
|---|---|---|---|
| 1 | VRE users are able to import Dataset schemas in JSON format into the VRE Blue Brain Nexus Knowledge Graph using the VRE Command Line Tool within the workbench Guacamole Virtual Machine. | ||
| 2 | |||
| 3 | === 1. Access to Command Line Tool within Guacamole VM === | ||
| 4 | |||
| 5 | Please visit this page: [[VRE User Guide/Analyzing Data/Gucamole>>doc:Main.user_guide.Analyzing Data.Guacamole.WebHome]] for details on | ||
| 6 | |||
| 7 | * What is Guacamole VM workbench tool? | ||
| 8 | * How to request access to my project's Guacamole VM workbench tool? | ||
| 9 | * How to access into Guacamole VM and launch terminal? | ||
| 10 | |||
| 11 | === 2. User login through Command Line Tool === | ||
| 12 | |||
| 13 | Please visit the page: [[VRE User Guide/Analyzing Data/Guacamole/Access to Project data in Guacamole VM using VRE Command Line Tool>>doc:Main.user_guide.Analyzing Data.Guacamole.2 Upload data back to project in Workbench tool using VRE Command Line Tool.WebHome]] for details on | ||
| 14 | |||
| 15 | * How to launch VRE Command Line Tool within VM terminal? | ||
| 16 | * How to login to the VRE by their Charite AD credentials within Command Line Tool? | ||
| 17 | |||
| 18 | === 3. Download Dataset schemas through Command Line Tool === | ||
| 19 | |||
| 20 | Please visit the page: [[VRE User Guide/Analyzing Data/Guacamole/Access to Project data in Guacamole VM using VRE Command Line Tool>>doc:Main.user_guide.Analyzing Data.Guacamole.2 Upload data back to project in Workbench tool using VRE Command Line Tool.WebHome]] for details on | ||
| 21 | |||
| 22 | * How to use Command Line Tool to download Dataset schemas in JSON format from Project into Workbench VM? | ||
| 23 | |||
| 24 | === 4. Import Dataset schemas into Knowledge Graph === | ||
| 25 | |||
| 26 | After downloading Dataset JSON schemas from Project, users are then able to import schemas into Blue Brain Nexus Knowledge Graph as Resources using the Command Line Tool. Considering the Dataset schemas are usually organized within a root folder with sub-folders inside, such as: | ||
| 27 | |||
| 28 | * Stroke_Dataset_Schema | ||
| 29 | ** DatasetVersion | ||
| 30 | *** DatasetVersion.json | ||
| 31 | ** Subject | ||
| 32 | *** Subject.json | ||
| 33 | ** FileBundle | ||
| 34 | *** FileBundle.json | ||
| 35 | |||
| 36 | So the VRE Command Line Tool supports users directly provide a folder, and all JSON schemas within the folder can be extracted and imported into Knowledge Graph. | ||
| 37 | |||
| 38 | a. Let's take a look what options users need to provide in order to import schemas by typing {{code language="none"}}vrecli kg_resource --help{{/code}} : | ||
| 39 | |||
| 40 | {{code language="none"}} | ||
| 41 | $ vrecli kg_resource --help | ||
| 42 | Usage: vrecli kg_resource [OPTIONS] COMMAND [ARGS]... | ||
| 43 | |||
| 44 | Options: | ||
| 45 | --help Show this message and exit. | ||
| 46 | |||
| 47 | Commands: | ||
| 48 | import Import VRE dataset schema into BlueBrainNexus | ||
| 49 | {{/code}} | ||
| 50 | |||
| 51 | As part of the schema importing command, users are required to provide the option of: | ||
| 52 | |||
| 53 | * the path of JSON schema(s) you want to import, i.e., //**./datasetVersion.json**// | ||
| 54 | * Or, the folder path which groups all JSON schemas inside, i.e., //**./stroke_dataset_schema**// | ||
| 55 | |||
| 56 | b. **Example 1**: one JSON schema of {{code language="none"}}datasetVersion.json{{/code}}can be imported from user's Home Directory into Blue Brain Nexus Knowledge Graph as a Resource by typing {{code language="none"}}vrecli kg_resource import ./datasetVersion.json{{/code}} | ||
| 57 | |||
| 58 | {{code language="none"}} | ||
| 59 | $ vrecli kg_resource import ./datasetVersion.json | ||
| 60 | Resource imported successfully: ./datasetVersion.json | ||
| 61 | {{/code}} | ||
| 62 | |||
| 63 | c. **Example 2**: batch of JSON schemas in one root folder can be imported from user's Home Directory into Blue Brain Nexus Knowledge Graph, each schema will be imported as one Resource, by typing {{code language="none"}}vrecli kg_resource import ./stroke_dataset_schema{{/code}} | ||
| 64 | |||
| 65 | {{code language="none"}} | ||
| 66 | $ vrecli kg_resource import ./stroke_dataset_schema | ||
| 67 | File imported: | ||
| 68 | stroke_dataset_schema/ethicsAssessment/e43690b0-22d4-11ec-a97f-0242ac110002, | ||
| 69 | stroke_dataset_schema/protocol/e4350b82-22d4-11ec-a97f-0242ac110002, | ||
| 70 | stroke_dataset_schema/species/e43ff678-22d4-11ec-a97f-0242ac110002, | ||
| 71 | stroke_dataset_schema/fileBundle/f6f85b16-22d4-11ec-a97f-0242ac110002, | ||
| 72 | stroke_dataset_schema/fileBundle/0454272c-22d5-11ec-a97f-0242ac110002, | ||
| 73 | stroke_dataset_schema/person/e4375b30-22d4-11ec-a97f-0242ac110002, | ||
| 74 | stroke_dataset_schema/subjectGroup/e441b76a-22d4-11ec-a97f-0242ac110002, | ||
| 75 | stroke_dataset_schema/subjectGroup/e4436ba0-22d4-11ec-a97f-0242ac110002, | ||
| 76 | stroke_dataset_schema/subjectState/0451f81c-22d5-11ec-a97f-0242ac110002, | ||
| 77 | stroke_dataset_schema/subjectState/f6f5f24a-22d4-11ec-a97f-0242ac110002, | ||
| 78 | stroke_dataset_schema/digitalIdentifierSchema/e4334ed2-22d4-11ec-a97f-0242ac110002, | ||
| 79 | stroke_dataset_schema/fileInstance/045b2388-22d5-11ec-a97f-0242ac110002, | ||
| 80 | stroke_dataset_schema/fileInstance/f6ff6faa-22d4-11ec-a97f-0242ac110002, | ||
| 81 | stroke_dataset_schema/fileInstance/f6fc6d28-22d4-11ec-a97f-0242ac110002, | ||
| 82 | stroke_dataset_schema/fileInstance/045c2f6c-22d5-11ec-a97f-0242ac110002, | ||
| 83 | stroke_dataset_schema/fileInstance/f6fb6072-22d4-11ec-a97f-0242ac110002, | ||
| 84 | stroke_dataset_schema/fileInstance/f6fd7088-22d4-11ec-a97f-0242ac110002, | ||
| 85 | stroke_dataset_schema/fileInstance/045a287a-22d5-11ec-a97f-0242ac110002, | ||
| 86 | stroke_dataset_schema/fileInstance/f6fe72bc-22d4-11ec-a97f-0242ac110002, | ||
| 87 | stroke_dataset_schema/dataset/dataset.json, | ||
| 88 | stroke_dataset_schema/fileRepository/e4381976-22d4-11ec-a97f-0242ac110002, | ||
| 89 | stroke_dataset_schema/datasetType/e4395e8a-22d4-11ec-a97f-0242ac110002.json, | ||
| 90 | stroke_dataset_schema/digitalIdentifier/e433bfa2-22d4-11ec-a97f-0242ac110002, | ||
| 91 | stroke_dataset_schema/subject/04533cd6-22d5-11ec-a97f-0242ac110002, | ||
| 92 | stroke_dataset_schema/subject/f6f75be4-22d4-11ec-a97f-0242ac110002, | ||
| 93 | stroke_dataset_schema/productAccessibility/e4340cf0-22d4-11ec-a97f-0242ac110002, | ||
| 94 | stroke_dataset_schema/license/e436dcdc-22d4-11ec-a97f-0242ac110002 | ||
| 95 | |||
| 96 | {{/code}} | ||
| 97 | |||
| 98 | ---- | ||
| 99 | |||
| 100 | {{box}} | ||
| 101 | (% style="text-align:center" %) | ||
| 102 | image:https://i.creativecommons.org/l/by-sa/4.0/88x31.png | ||
| 103 | |||
| 104 | (% style="text-align: center;" %) | ||
| 105 | Copyright © 2022, Indoc Research. This work is licensed under a [[Creative Commons Attribution-ShareAlike 4.0>>http://creativecommons.org/licenses/by-sa/4.0/ ||rel="noopener noreferrer" target="blank"]] International License. | ||
| 106 | {{/box}} |