Download the hbdb2.sql
Create a new conda environment
conda create --name hbdb_env python=3.10
Activate the conda environment
conda activate hbdb_env
Install necessary package
pip insall mysql-connector-python==9.1.0
Replace the following line in the script with your own MySQL settings:
connection = mysql.connector.connect(host='localhost', port='3306',user='root'password='XXXXXXXX')
Ensure the host, port, user, and password match your database configuration.
- host: The hostname or IP address of your MySQL server.
- port: The port number your MySQL server listens on (default is 3306).
- user: Your MySQL username.
- password: Your MySQL password (replace XXXXXXXX with the actual password).
Run the sql.py
script with the specified compound_id
parameter.
As an example, using compound "acetone," replace 28 with the desired compound ID to fetch data from the database:
python sql.py --compound_id 28
The results will be stored in a directory named after the compound name. It will include all concepts related to the compound.
The JSON files will follow this naming format:
{term_A}_{term_B}_{paragraph}.json
Each JSON file will have the following structure:
{
"term_A": "value of term A",
"term_B": "value of term B",
"context": "surrounding text including the target sentence"
}