glam/frontend/scripts/start-oxigraph-memory.sh
kempersc 2761857b0d Add scripts for converting OWL/Turtle ontology to Mermaid and PlantUML diagrams
- Implemented `owl_to_mermaid.py` to convert OWL/Turtle files into Mermaid class diagrams.
- Implemented `owl_to_plantuml.py` to convert OWL/Turtle files into PlantUML class diagrams.
- Added two new PlantUML files for custodian multi-aspect diagrams.
2025-11-22 23:01:13 +01:00

60 lines
1.7 KiB
Bash
Executable file

#!/bin/bash
# Start Oxigraph server in IN-MEMORY mode (no persistence)
# Workaround for ARM macOS crash with RocksDB persistent storage
set -e
BIND_ADDRESS="127.0.0.1:7878"
PID_FILE="/tmp/oxigraph-server.pid"
LOG_FILE="/tmp/oxigraph-server.log"
echo "Starting Oxigraph server (IN-MEMORY mode)..."
echo "Endpoint: http://${BIND_ADDRESS}"
echo "PID file: ${PID_FILE}"
echo "Log file: ${LOG_FILE}"
# Check if already running
if [ -f "$PID_FILE" ]; then
OLD_PID=$(cat "$PID_FILE")
if ps -p "$OLD_PID" > /dev/null 2>&1; then
echo "⚠️ Oxigraph server already running (PID: $OLD_PID)"
echo "To stop: kill $OLD_PID"
exit 1
else
echo "Removing stale PID file..."
rm -f "$PID_FILE"
fi
fi
# Start server in background (IN-MEMORY: no --location flag)
echo "Starting server..."
nohup oxigraph_server serve \
--bind "$BIND_ADDRESS" \
--cors \
> "$LOG_FILE" 2>&1 &
SERVER_PID=$!
echo $SERVER_PID > "$PID_FILE"
# Wait for server to be ready
echo "Waiting for server to start..."
for i in {1..10}; do
if curl -s -o /dev/null -w "%{http_code}" "http://${BIND_ADDRESS}/" | grep -q "200\|404"; then
echo "✅ Oxigraph server started successfully (PID: $SERVER_PID)"
echo ""
echo "SPARQL Endpoint: http://${BIND_ADDRESS}/query"
echo "Store Update: http://${BIND_ADDRESS}/store"
echo ""
echo "⚠️ IN-MEMORY MODE: Data will be lost on server restart"
echo " Load data with: ./scripts/load-sample-data.sh"
echo ""
echo "To stop server: kill $SERVER_PID"
echo "To view logs: tail -f $LOG_FILE"
exit 0
fi
sleep 1
done
echo "❌ Server failed to start within 10 seconds"
echo "Check logs: tail -f $LOG_FILE"
exit 1