v1.2.0 will be the final version where Knowledge Graph can be downloaded as CSV flat files. Starting from v1.3.0 onwards, Knowledge Graph will be accessible as graph-native JSON flat files and we’ll be starting to grant access to our REST API in early 2026. Any CSV and JSON flat files that were previously downloaded will be unaffected.
Prerequisites
- Download the necessary scripts from the repo
git clone https://github.com/learning-commons-org/knowledge-graph.git
cd knowledge-graph
Set up your database
Step 1: Create database tables
- Create a dedicated database (optional).
psql -U <username> -c "CREATE DATABASE <database>;"
- Connect to your PostgreSQL database and create the necessary tables.
psql -U <username> -d <database> -f create_tables.sql
Or execute the SQL file content directly in your PostgreSQL client. See create_tables.sql for the complete table definitions.Step 2: Load CSV Data
-
After creating the tables, load the data
⚠️ IMPORTANT: Update the file paths in
load_data.sql to point to your downloaded CSV files. Ensure PostgreSQL has read access to the file paths specified in the load script.
-
Execute the load script
psql -U <username> -d <database> -f load_data.sql
Query Examples
Once the data is loaded, you can run queries to explore the tables:-- List all tables
\dt
-- Sample data queries
SELECT * FROM standards_framework LIMIT 10;
SELECT * FROM standards_framework_item LIMIT 10;
SELECT * FROM learning_component LIMIT 10;
SELECT * FROM relationships LIMIT 10;
v1.2.0 will be the final version where Knowledge Graph can be downloaded as CSV flat files. Starting from v1.3.0 onwards, Knowledge Graph will be accessible as graph-native JSON flat files and we’ll be starting to grant access to our REST API in early 2026. Any CSV and JSON flat files that were previously downloaded will be unaffected.
Prerequisites
- Download the necessary scripts from the repo:
git clone https://github.com/learning-commons-org/knowledge-graph.git
cd knowledge-graph
Setup your database
Step 1: Create database tables
-
First create a dedicated database if that’s preferred:
mysql -u <username> -p -e "CREATE DATABASE <database>;"
Connect to your MySQL database and create the necessary tables by running:
mysql -u <username> -p <database> < create_tables.sql
Or execute the SQL file content directly in your MySQL client. See create_tables.sql for the complete table definitions.
Step 2: Load CSV Data
-
After creating the tables, load the data.
⚠️ IMPORTANT: Update the file paths in
load_data.sql to point to your downloaded CSV files.
-
Enable local file loading on the server (if not already enabled).
mysql -u <username> -p -e "SET GLOBAL local_infile=1;"
-
Execute the load script.
mysql -u <username> -p <database> --local-infile=1 < load_data.sql
Note: The local_infile setting must be enabled on both the server SET GLOBAL local_infile=1 and client --local-infile=1 for LOAD DATA LOCAL INFILE to work.Query Examples
Once the data is loaded, you can run queries to explore the tables:-- Show all tables
SHOW TABLES;
-- Sample data queries
SELECT * FROM standards_framework LIMIT 10;
SELECT * FROM standards_framework_item LIMIT 10;
SELECT * FROM learning_component LIMIT 10;
SELECT * FROM relationships LIMIT 10;