#!/bin/bash # Install Oxigraph Server for GLAM Frontend # https://github.com/oxigraph/oxigraph set -e echo "🔧 Installing Oxigraph Server..." # Detect OS and architecture OS=$(uname -s | tr '[:upper:]' '[:lower:]') ARCH=$(uname -m) # Map architecture names case "$ARCH" in x86_64) ARCH_NAME="x86_64" ;; arm64|aarch64) ARCH_NAME="aarch64" ;; *) echo "❌ Unsupported architecture: $ARCH" exit 1 ;; esac # Map OS names case "$OS" in darwin) OS_NAME="apple" ;; linux) OS_NAME="linux_gnu" ;; *) echo "❌ Unsupported OS: $OS" exit 1 ;; esac # Oxigraph version (latest) VERSION="0.5.2" BINARY_NAME="oxigraph_v${VERSION}_${ARCH_NAME}_${OS_NAME}" DOWNLOAD_URL="https://github.com/oxigraph/oxigraph/releases/download/v${VERSION}/${BINARY_NAME}" echo "📦 Downloading Oxigraph v${VERSION} for ${ARCH_NAME}_${OS_NAME}..." echo "URL: ${DOWNLOAD_URL}" # Create bin directory if it doesn't exist mkdir -p "$HOME/.local/bin" # Download binary if ! curl -L -o "$HOME/.local/bin/oxigraph_server" "$DOWNLOAD_URL"; then echo "❌ Download failed. URL may be incorrect." echo "Please check available releases at: https://github.com/oxigraph/oxigraph/releases" exit 1 fi # Make executable chmod +x "$HOME/.local/bin/oxigraph_server" # Verify installation if "$HOME/.local/bin/oxigraph_server" --version; then echo "✅ Oxigraph Server installed successfully!" echo "📍 Location: $HOME/.local/bin/oxigraph_server" echo "" echo "🔍 Add to PATH (if not already):" echo " export PATH=\"\$HOME/.local/bin:\$PATH\"" echo "" echo "🚀 Start server with:" echo " ./scripts/start-oxigraph.sh" else echo "❌ Installation verification failed" exit 1 fi