Plan, apply and roll back changes to a production ontology, with a blast radius report and a proof an auditor can re-check.
Rust ai-nativedescription-logicsformal-verificationinfrastructure-as-codeisabelle-languageknowledge-graphleanlean4mcpmcp-serverontologyowlowl2reasoningrustshaclsparqltheorem-proving
feat: add SQL→OWL end-to-end demo with Docker postgres
FABIOTESS732ce665ff3f
diff --git a/benchmark/demo/docker-compose.yml b/benchmark/demo/docker-compose.ymlnew file mode 100644index 00000000..0e039a87--- /dev/null+++ b/benchmark/demo/docker-compose.yml@@ -0,0 +1,11 @@+services:+ postgres:+ image: postgres:16+ environment:+ POSTGRES_DB: shop+ POSTGRES_USER: demo+ POSTGRES_PASSWORD: demo+ ports:+ - "5433:5432"+ volumes:+ - ./seed.sql:/docker-entrypoint-initdb.d/seed.sqldiff --git a/benchmark/demo/run_demo.sh b/benchmark/demo/run_demo.shnew file mode 100755index 00000000..a141511b--- /dev/null+++ b/benchmark/demo/run_demo.sh@@ -0,0 +1,48 @@+#!/bin/bash+set -e+SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"+OO="${OO_BIN:-open-ontologies}"++echo "=== SQL → OWL Demo ==="+echo ""++# Start postgres+echo "Starting PostgreSQL..."+cd "$SCRIPT_DIR"+docker compose up -d+echo "Waiting for postgres to be ready..."+for i in $(seq 1 30); do+ if docker compose exec -T postgres pg_isready -U demo -d shop > /dev/null 2>&1; then+ break+ fi+ sleep 1+done+echo ""++START=$(python3 -c "import time; print(int(time.time()*1000))")++echo "Step 1: Import schema..."+$OO import-schema "postgres://demo:demo@localhost:5433/shop" --base-iri "http://shop.example.org/" --pretty+echo ""++echo "Step 2: Classify..."+$OO reason --profile owl-dl --pretty+echo ""++echo "Step 3: Query classes..."+$OO query "SELECT ?c ?label WHERE { ?c a <http://www.w3.org/2002/07/owl#Class> . OPTIONAL { ?c <http://www.w3.org/2000/01/rdf-schema#label> ?label } }" --pretty+echo ""++echo "Step 4: Stats..."+$OO stats --pretty++END=$(python3 -c "import time; print(int(time.time()*1000))")+ELAPSED=$(( END - START ))+echo ""+echo "Total pipeline time: ${ELAPSED}ms"++# Cleanup+echo ""+echo "Cleaning up..."+docker compose down+echo "Done."diff --git a/benchmark/demo/seed.sql b/benchmark/demo/seed.sqlnew file mode 100644index 00000000..fdf51491--- /dev/null+++ b/benchmark/demo/seed.sql@@ -0,0 +1,33 @@+CREATE TABLE users (+ id SERIAL PRIMARY KEY,+ name VARCHAR(100) NOT NULL,+ email VARCHAR(255) NOT NULL UNIQUE,+ created_at TIMESTAMP DEFAULT NOW()+);++CREATE TABLE products (+ id SERIAL PRIMARY KEY,+ name VARCHAR(200) NOT NULL,+ price DECIMAL(10,2) NOT NULL,+ description TEXT+);++CREATE TABLE orders (+ id SERIAL PRIMARY KEY,+ user_id INTEGER NOT NULL REFERENCES users(id),+ product_id INTEGER NOT NULL REFERENCES products(id),+ quantity INTEGER NOT NULL DEFAULT 1,+ ordered_at TIMESTAMP DEFAULT NOW()+);++INSERT INTO users (name, email) VALUES+ ('Alice', '[email protected]'),+ ('Bob', '[email protected]');++INSERT INTO products (name, price) VALUES+ ('Widget', 9.99),+ ('Gadget', 24.99),+ ('Doohickey', 4.99);++INSERT INTO orders (user_id, product_id, quantity) VALUES+ (1, 1, 2), (1, 2, 1), (2, 3, 5);