Expand description
RDF4J-compatible HTTP facade over an in-process ComputeNode.
The router mounts /rdf4j, /waratah, /cors_proxy, the AI services
(discovery + LLM egress proxy under /waratah/ai,
/waratah/repositories/{id}/ai-context), the pre-built
grevillea console at /, and — when the notebook service is enabled —
the jupyter reverse proxy at /jupyter (waratah_notebook). GET/HEAD
paths outside those API prefixes return the SPA
index.html, except /assets/…, /sw.js, and /favicon.ico, which are
exact files from the embedded dist-console. /download/… is not served.
The MVP mounts under /rdf4j and implements protocol version,
SPARQL SELECT / ASK / CONSTRUCT / DESCRIBE on repository main,
GET /rdf4j/repositories (lists main), repository size, namespace list, and a
Waratah-specific .../explain endpoint that returns Jena SSE, SPARQL, or a
row-estimate plan tree (format, pretty query params). Remaining RDF4J
paths return 501 Not Implemented. Serialization of SPARQL Results uses
Oxigraph’s sparesults crate; graph results use oxrdfio (Turtle /
N-Triples / RDF/XML).
SELECT and ASK responses default to text/csv when the client sends no
usable Accept (absent, *, */*); CONSTRUCT / DESCRIBE default to
Turtle, and the repository / namespace listings default to JSON. The
whole router compresses response bodies per the client’s
Accept-Encoding — brotli at level 4 or gzip at level 5, brotli winning
equal-weight ties — and marks compressed responses with Content-Encoding
and Vary: Accept-Encoding. Buffered bodies under 256 bytes stay
identity, which keeps every ASK boolean serialization uncompressed
(waratah_api/src/compress.rs).
Staging ingest (list / upload / snippet / ingest) is a Waratah-specific
API under /waratah/repositories/{id}/ingest, not RDF4J. Files are staged
under {ingest_dir}/{repository_id} (repository is main). The same
/waratah prefix serves GET /waratah/health (this process),
GET /waratah/cluster (coordinator snapshot of computes + storage), and
GET /waratah/repositories/{id}/queries — the read-only published query
library behind --queries-dir (or the inline --load-demo samples;
waratah_api/src/query_library.rs). /cors_proxy/{compute_id}/rdf4j|waratah/…
streams that request to a cluster member’s configured HTTP origin. There
are no browser CORS headers.
Structs§
- AiConfig
- Fully resolved AI configuration (what
AppStateserves from). - AiService
- Resolved AI service state held by
crate::state::AppState: the configuration plus one lazily built HTTP client. - AiToml
- The
{config-dir}/ai.tomldocument. - AiUpstream
- One resolved egress upstream.
- AppState
- State cloned into every RDF4J / Waratah HTTP handler.
- Cors
Proxy Target - One static cluster member
/cors_proxymay forward HTTP to. - Query
Debug - SPARQL arrival / completion / client-error logger.
- Query
Span - Token for one debug-traced SPARQL request.
- Repository
Catalog - Catalog of repositories exposed by this RDF4J server.
- Repository
State - Per-repository metadata held at the HTTP edge.
- Server
Query - One published query, exactly the wire shape of
GET /waratah/repositories/{id}/queriesentries.
Enums§
- AiConfig
Error - Errors raised while resolving
ai.tomlinto anAiConfig. - ApiError
- Failure translating an RDF4J request into a compute call or wire format.
- Query
Library - Where a repository’s query library comes from.
- Query
Library Error - Failure resolving a configured library. “Not configured at all” is a
separate
crate::error::ApiError::QueryLibraryNotConfiguredand maps to501; these two map to404/500.
Constants§
- MAIN_
REPOSITORY_ ID - Default repository ID served by the MVP (on-disk layout and HTTP URLs). MVP / default repository id used in on-disk paths and HTTP URLs.
- PROTOCOL_
VERSION - RDF4J protocol version advertised by
GET /rdf4j/protocol.
Traits§
- Compute
Backend - Operations the RDF4J facade and Waratah ingest API need from compute.
Functions§
- bind_
http - Bind
addrfor the RDF4J HTTP facade, returning the listener before any request is served. - console_
is_ stub - Whether this binary embedded the build-time stub instead of a grevillea
dist-console. - console_
missing_ worker - Whether the embedded console has no
sw.js. - negotiate_
graph_ format - Pick Turtle, N-Triples, TriG, N-Quads, RDF/XML, or JSON-LD from an
Acceptheader; default Turtle. - negotiate_
results_ format - Pick JSON, XML, CSV, or TSV from an
Acceptheader; default JSON. - negotiate_
results_ format_ with_ default - Like
negotiate_results_format, but absent / wildcardAcceptvalues (*,*/*) fall back todefaultinstead of JSON. - router
- Build the HTTP router for
state. - router_
for_ compute - Convenience: serve RDF4J over a live
ComputeNode. - serialize_
query_ results - Serialize SELECT bindings, an ASK boolean, or a CONSTRUCT/DESCRIBE graph.
- serialize_
query_ results_ with_ default - Like
serialize_query_results, but solutions and boolean results fall back tosolutions_defaultfor absent / wildcardAcceptvalues. - serve
- Bind
addrand serve until the listener fails. - serve_
bound_ with_ shutdown - Serve the RDF4J HTTP facade on an already-bound listener until
shutdownresolves or the listener fails. - serve_
compute - Bind
addrand serve a liveComputeNode. - serve_
with_ shutdown - Bind
addrand serve untilshutdownresolves or the listener fails.