Each wiki process builds the wiki RDF graph once (unless you pass --reload) and reuses it for:
- every wiki query in that process
- every SPARQL block in wiki render
wiki build --renderwhen rendering before static output
OWL-RL expansion runs when inference is enabled (default for most commands; use --no-inference on query / render when debugging asserted triples only).
Cross-process reuse
- By default, a new shell still starts cold.
- Pass
--cacheon wiki query, wiki render, orwiki build --renderto persist a warm graph under.wiki/cache/. - The persisted graph is reused only when the wiki fingerprint still matches.
--reloadforces a fresh build and refreshes the current cache entry.
Queries that use SPARQL GRAPH clauses build a named-graph dataset instead of the compatibility union graph. Those dataset cache entries are stored separately as N-Quads so source graph boundaries are preserved.
Long-lived workflows
wiki serve with --watch keeps one process alive. On file changes it rebuilds the graph, re-runs SPARQL rendering, and reloads the browser.
Tradeoffs
- In-process reuse is still the default and simplest model.
--cachehelps repeated one-shot commands across fresh shells.- The disk cache is invalidated automatically on wiki or config changes.
.wiki/cache/is excluded from wiki fingerprinting so cache artifacts do not invalidate themselves.
CI tips
wiki render --check # fail if any inline block is stale
wiki render --cache # repeated one-shot render loop across shells
wiki build --render --cache # repeated one-shot render + build loop across shells
wiki query "..." # same graph as a prior render in one script if you chain in one shell
Related
- wiki query
- wiki render
- wiki serve — long-lived preview and optional SPARQL endpoint