Admin Guide
User management, ontology publishing, data stewardship, backup, and platform administration.
steward role. The admin role (Phase 1+) adds platform-level configuration access. This guide covers both.User & Role Management
Ontos has three roles: analyst, steward, admin. Roles are assigned in Keycloak and carried in the JWT token's realm_access.roles claim.
Role Capabilities
| Capability | analyst | steward | admin |
|---|---|---|---|
| Read ontology | ✓ | ✓ | ✓ |
| Search entities | ✓ (filtered) | ✓ | ✓ |
| Natural language queries | ✓ (filtered) | ✓ | ✓ |
| View staging triples | — | ✓ | ✓ |
| Approve staging → data | — | ✓ | ✓ |
| Publish ontology version | — | ✓ | ✓ |
| Manage connectors / sources | — | ✓ | ✓ |
| Trigger data sync | — | ✓ | ✓ |
| View all suppliers (risk > 80) | — | ✓ | ✓ |
| User management | — | — | ✓ |
| Platform configuration | — | — | ✓ |
| Backup / restore | — | — | ✓ |
Assign a Role via Keycloak Admin
# Get admin token
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)
# Get user ID
USER_ID=$(curl -s \
-H "Authorization: Bearer $TOKEN" \
"http://localhost:8080/admin/realms/ontos/users?username=alice" | jq -r '.[0].id')
# Get role ID
ROLE=$(curl -s \
-H "Authorization: Bearer $TOKEN" \
"http://localhost:8080/admin/realms/ontos/roles/steward")
# Assign role
curl -X POST \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
"http://localhost:8080/admin/realms/ontos/users/$USER_ID/role-mappings/realm" \
-d "[$ROLE]"Policy Filter Administration
The policy filter is implemented as a SPARQL query rewriter in graph-engine's PolicyFilter interface. The current Phase 1 implementation injects a FILTER NOT EXISTS pattern for analyst-role users to hide suppliers with riskScore > 80.
services/graph-engine/src/main/kotlin/...PolicyFilter.kt). Changing policies requires a code change, test, and redeploy. This is intentional — policy logic is auditable and version-controlled.Ontology Workbench
The ontology workbench is accessible to steward and admin roles via the web UI at http://localhost:5173/workbench.
Publishing an Ontology Version
- Navigate to Workbench → Ontology in the web UI.
- Make changes in the class tree or property editor.
- Click Save Draft — creates a Git commit in the versioned store.
- Review the axiom-level diff in the Versions panel.
- Click Publish (steward-only) — writes the ontology to
urn:ontos:ontologyin Fuseki with provenance (who, when, version). - The SHACL live validation panel updates immediately.
Via REST API
# Import a Protégé-exported ontology
curl -X POST http://localhost:8082/api/ontology/import \
-H "Authorization: Bearer $STEWARD_TOKEN" \
-F "[email protected]"
# List versions
curl http://localhost:8082/api/ontology/versions \
-H "Authorization: Bearer $STEWARD_TOKEN"
# Diff between versions
curl "http://localhost:8082/api/ontology/diff?from=v1&to=v2" \
-H "Authorization: Bearer $STEWARD_TOKEN"
# Publish a version
curl -X POST http://localhost:8082/api/ontology/publish \
-H "Authorization: Bearer $STEWARD_TOKEN" \
-H "Content-Type: application/json" \
-d '{"version": "v2"}'Data Stewardship: Approving Staging Changes
When the AI service or ingest connectors propose new triples, they go to the staging graph (urn:ontos:staging). A steward must approve them before they enter the data graph.
Review & Approve via UI
- Go to Workbench → Staging Queue.
- Review proposed triples — they show the source (connector, AI suggestion) and confidence.
- Select triples to approve or reject.
- Click Promote to Data — moves approved triples to
urn:ontos:data.
Via REST API
# List pending staging proposals
curl http://localhost:8082/api/ingest/staging \
-H "Authorization: Bearer $STEWARD_TOKEN"
# Approve a batch
curl -X POST http://localhost:8082/api/ingest/staging/approve \
-H "Authorization: Bearer $STEWARD_TOKEN" \
-H "Content-Type: application/json" \
-d '{"ids": ["proposal-001", "proposal-002"]}'Connector Management
Register data sources (Postgres, Snowflake, Databricks) via ingest-svc. Credentials go through the SecretStore port — never stored in plain text.
# Register a Postgres source
curl -X POST http://localhost:8082/api/ingest/sources \
-H "Authorization: Bearer $STEWARD_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"type": "postgres",
"name": "ERP Database",
"credentials": {
"host": "erp.internal",
"port": 5432,
"database": "erp_prod",
"username": "ontos_reader",
"password": "..."
}
}'
# Discover schemas
curl "http://localhost:8082/api/ingest/sources/{id}/discover" \
-H "Authorization: Bearer $STEWARD_TOKEN"
# Preview data
curl "http://localhost:8082/api/ingest/sources/{id}/preview?table=suppliers" \
-H "Authorization: Bearer $STEWARD_TOKEN"
# Trigger sync
curl -X POST "http://localhost:8082/api/ingest/sources/{id}/sync" \
-H "Authorization: Bearer $STEWARD_TOKEN"Backup & Restore
Use the backup scripts in tools/backup/. Both TDB2 (Fuseki) and Postgres are backed up. A CI rehearsal test runs backup → wipe → restore → count queries to verify integrity.
# Create backup (TDB2 + Postgres)
./tools/backup/backup.sh --output ./backups/$(date +%Y%m%d-%H%M%S)
# Backup creates:
# backups/20250714-120000/
# fuseki-snapshot.tar.gz (consistent TDB2 snapshot via Fuseki backup endpoint)
# postgres-dump.sql.gz (pg_dump)
# Restore
./tools/backup/restore.sh --from ./backups/20250714-120000
# Verify after restore
make seed --check-counts # counts should match backupObservability
Ontos ships with OpenTelemetry instrumentation. In local dev, access Grafana at http://localhost:3000 after starting the observability profile:
# Start with observability (OTel collector + Grafana + Tempo + Prometheus)
docker compose --profile observability up -d
open http://localhost:3000 # Grafana (admin/admin)
# → Explore → Tempo → search for traces by service nameNext Steps
- User Guide — how analysts and stewards use the platform day-to-day
- API Reference — full admin REST endpoint documentation
- Threat Model — security considerations for production deployment