Skip to content
Update Getting started authored by Karel van de Plassche's avatar Karel van de Plassche
......@@ -27,16 +27,25 @@ Before [uploading data to the GKDB](#uploading-data-to-the-gkdb), you will there
pip3 install --user -e .
```
4. In Python, import the GKDB module
```python
import gkdb.core.model as gkdb
```
When requested, enter your GKDB username and password.
### Querying the GKDB
The GKDB is an SQL database. As SQL interfaces exist for many languages (Matlab, Python, IDL, Java,...), you can use your favorite tool to access the GKDB server. To connect, you will need to have a valid [user account](#user-account-required-to-query-and-upload-data). The server name is `gkdb.org` and the database name `gkdb`.
Alternatively, you can use the [GKDB web browser](Tools#gkdb-web-browser) for a quick overview of the database. Or, if you are interested in a Python interface, you can use the [GKDB Python module](Tools#gkdb-python-module) developed within the GKDB project.
[[Examples of SQL queries|Documentation]] are provided in the documentation section.
### Uploading data to the GKDB
To be completed
\ No newline at end of file
Currently there is no Graphical User Interface available for uploading data to the GKDB. This might be developed at a later stage. Currently, the python module can be used directly to upload to the GKDB. Assuming GKDB is correctly installed as described above.
Assuming you have sufficient permissions to write to the GKDB, just:
``` python
import gkdb.core.model
gkdb.core.model.connect_to_gkdb() # Connect to GKDB. prompts username and password by default
gkdb.core.model.Ids_properties.from_json(path_to_valid_json) # Upload JSON to the GKDB.
```
Only points following the [GKDB definitions](https://gitlab.com/gkdb/gkdb/blob/master/doc/IO/IOGKDB.pdf) can be uploaded to the GKDB. It is also possible to check if a JSON is valid for upload locally, so without connecting to the gkdb using:
``` python
gkdb.core.ids_checks.check_json('./json_files/linear_eigenvalue.json', only_input=False)
```
Which returns `true` if the JSON is valid.
\ No newline at end of file