Last updated on July 14, 2026
Configuration
Environment variables, Keycloak realm setup, Fuseki named graphs, and Helm values for local and production deployments.
Environment Variables
All configuration is environment-variable driven. Local dev: .env file. Kubernetes: Helm values or Kubernetes Secrets.
| Variable | Required | Default | Description |
|---|---|---|---|
ANTHROPIC_API_KEY | yes | — | Anthropic API key for NL→SPARQL and AI mapping. |
ONTOS_LLM_MODEL | no | claude-sonnet-4-6 | Claude model ID. Override to use a different model. |
FUSEKI_URL | no | http://fuseki:3030 | Internal Fuseki base URL (docker-compose name). |
FUSEKI_DATASET | no | ds | TDB2 dataset name. |
KEYCLOAK_URL | no | http://keycloak:8080 | Keycloak base URL. JWT issuer for resource servers. |
KEYCLOAK_REALM | no | ontos | Keycloak realm name. |
POSTGRES_URL | no | jdbc:postgresql://postgres:5432/ontos | Platform Postgres JDBC URL. |
POSTGRES_USER | no | ontos | Postgres username. |
POSTGRES_PASSWORD | no | ontos | Override in production. |
OPENSEARCH_URL | no | http://opensearch:9200 | OpenSearch base URL for search indexing. |
KAFKA_BOOTSTRAP | no | kafka:9092 | Kafka bootstrap server. |
GATEWAY_PORT | no | 8082 | Port the gateway listens on. |
RATE_LIMIT_RPS | no | 20 | Per-user rate limit in requests/second (bucket4j). |
WEB_ORIGIN | no | http://localhost:5173 | Allowed CORS origin for the web app. |
Keycloak Realm
The realm is auto-imported on first start from deploy/keycloak/realm-ontos.json. It configures:
- Realm:
ontos - Client:
ontos-web— public PKCE, redirect URIs:http://localhost:5173/* - Users:
maya(analyst),chen(steward) - Realm roles:
analyst,steward,admin
Adding a User
bash
TOKEN=$(curl -s -X POST \
http://localhost:8080/realms/master/protocol/openid-connect/token \
-d 'grant_type=password&client_id=admin-cli&username=admin&password=admin' \
| jq -r .access_token)
curl -X POST http://localhost:8080/admin/realms/ontos/users \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"username": "alice",
"enabled": true,
"credentials": [{"type":"password","value":"alice","temporary":false}],
"realmRoles": ["steward"]
}'Fuseki TDB2 Configuration
Fuseki runs with a TDB2 persistent dataset at /fuseki/databases/ds inside the container, mounted to ./data/fuseki on the host.
Named Graphs
| Graph URI | Purpose | Writer |
|---|---|---|
urn:ontos:ontology | Published schema (Turtle) | ontology-svc on publish |
urn:ontos:data | Approved instance data | ingest-svc after steward approval |
urn:ontos:staging | Unapproved AI/connector proposals | ingest-svc / ai-svc |
SPARQL Endpoint
⚠️
Always query through the gateway (
:8082), not Fuseki directly (:3030). Direct Fuseki bypasses JWT validation and the policy filter.bash
# Get a token
TOKEN=$(curl -s -X POST \
http://localhost:8080/realms/ontos/protocol/openid-connect/token \
-d 'grant_type=password&client_id=ontos-web&username=maya&password=maya' \
| jq -r .access_token)
# Query through gateway (auth + policy applied)
curl -X POST http://localhost:8082/api/graph/sparql \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/sparql-query" \
-d "SELECT ?s ?p ?o WHERE { GRAPH <urn:ontos:data> { ?s ?p ?o } } LIMIT 10"Helm Values (Kubernetes)
deploy/helm/ontos/values-local.yaml (key overrides)
gateway:
image: ontos/gateway:local
env:
RATE_LIMIT_RPS: "20"
WEB_ORIGIN: "http://localhost:5173"
graphEngine:
image: ontos/graph-engine:local
aiSvc:
image: ontos/ai-svc:local
# Set at install time: --set aiSvc.anthropicApiKey=sk-ant-...
fuseki:
persistence:
size: 5Gi
storageClass: standard # kind default
keycloak:
realmImport: true
startDev: true # dev mode; production: falseRate Limiting
The gateway uses bucket4j for per-user rate limiting. Default: 20 requests/second. Exceeding returns HTTP 429 with Retry-After: 1.
bash
# Verify: at least one 429 after 20 rapid requests
for i in $(seq 1 25); do
curl -s -o /dev/null -w "%{http_code} " \
-H "Authorization: Bearer $TOKEN" \
http://localhost:8082/api/graph/search?q=supplier
doneNext: Admin Guide — user management, ontology publishing, data stewardship.
Was this page helpful?