Ontos
Last updated on July 14, 2026

Admin Guide

User management, ontology publishing, data stewardship, backup, and platform administration.

Admin vs. Steward — Most admin tasks in Ontos are performed by the 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

Capabilityanalyststewardadmin
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

bash
# 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.

Policy rules are implemented in code (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

  1. Navigate to Workbench → Ontology in the web UI.
  2. Make changes in the class tree or property editor.
  3. Click Save Draft — creates a Git commit in the versioned store.
  4. Review the axiom-level diff in the Versions panel.
  5. Click Publish (steward-only) — writes the ontology to urn:ontos:ontology in Fuseki with provenance (who, when, version).
  6. The SHACL live validation panel updates immediately.

Via REST API

bash
# 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

  1. Go to Workbench → Staging Queue.
  2. Review proposed triples — they show the source (connector, AI suggestion) and confidence.
  3. Select triples to approve or reject.
  4. Click Promote to Data — moves approved triples to urn:ontos:data.

Via REST API

bash
# 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.

bash
# 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.

bash
# 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 backup

Observability

Ontos ships with OpenTelemetry instrumentation. In local dev, access Grafana at http://localhost:3000 after starting the observability profile:

bash
# 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 name

Next 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
Was this page helpful?