Find <!-- sparql:start --> ... <!-- sparql:end --> regions in markdown, run the embedded query against the wiki graph, and rewrite the table (or (no results)) in place.
Silent on success by default. See Design Philosophies.
Usage
wiki render
wiki render wiki/Report.md
wiki render wiki/people/alpha.md wiki/projects/beta.md
wiki render wiki/people/*.md
wiki render -v
wiki render --check
wiki render --no-inference
wiki render --reload
wiki render --cache
Options
| Flag | Description |
|---|---|
FILE... |
Optional .md paths; otherwise entire wiki (shell globs expand to multiple FILE args) |
--check |
Dry-run; exit 1 if any block is stale |
--no-inference |
Skip OWL-RL |
--reload |
Rebuild graph before rendering |
--cache |
Persist a warm graph under .wiki/cache/ for reuse across new processes |
-v, --verbose |
Print update counts |
Block format
See Style Guide for the sparql:start / sparql:end wrapper and fenced sparql code block. Close the start comment before the fence to show the query in built HTML. Leave it open and close after the fence to hide the query from published pages while wiki render still updates the table.
Examples
List all people (visible query)
The default visible block style shows the query in published HTML so readers can see and learn from it.
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX schema: <https://schema.org/>
SELECT ?person ?givenName ?familyName WHERE {
?person rdf:type schema:Person .
?person schema:givenName ?givenName .
?person schema:familyName ?familyName .
}
ORDER BY ?familyName
| person | givenName | familyName |
|---|---|---|
| Jeff_Kazzee | Jeff | Kazzee |
| https://wiki.example.org/people/Alice_Smith | Alice | Smith |
List all software applications (hidden query)
The hidden query style keeps the SPARQL inside an HTML comment — invisible in published pages, but still executed by wiki render.
| app | name | version |
|---|---|---|
| Linked_Markdown | Linked Markdown | |
| Obsidian | Obsidian | |
| Vivary | Vivary | 0.1.0 |
| wiki | wiki | 0.1.21 |
More query patterns
Paste one of these SPARQL queries into a sparql:start block on any wiki page and run wiki render to see results.
All TechArticles with headlines and descriptions:
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX schema: <https://schema.org/>
SELECT ?headline ?description WHERE {
?doc rdf:type schema:TechArticle .
?doc schema:headline ?headline .
OPTIONAL { ?doc schema:description ?description . }
}
ORDER BY ?headline
Full-text search for pages that mention a term in their body:
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX schema: <https://schema.org/>
SELECT ?headline WHERE {
?doc rdf:type schema:TechArticle .
?doc schema:headline ?headline .
?doc schema:articleBody ?body .
FILTER(CONTAINS(?body, "your-search-term"))
}
ORDER BY ?headline
Backlinks to a target page via body text:
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX schema: <https://schema.org/>
SELECT ?headline WHERE {
?doc rdf:type schema:TechArticle .
?doc schema:headline ?headline .
?doc schema:articleBody ?body .
FILTER(CONTAINS(?body, "Target_Page"))
}
ORDER BY ?headline
Replace "Target_Page" with a page filename (without .md) to find pages that link to it.
Recent changes by date (requires date frontmatter):
Add dateCreated or dateModified to your page frontmatter with a YAML date (e.g. dateCreated: 2026-06-28). The wiki graph automatically types these as xsd:date. Then query:
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX schema: <https://schema.org/>
SELECT ?headline ?created WHERE {
?doc rdf:type schema:TechArticle .
?doc schema:headline ?headline .
?doc schema:dateCreated ?created .
}
ORDER BY DESC(?created)
Related
- SPARQL
- Style Guide —
sparql:start/sparql:endblock format - Graph Cache
- wiki query
- wiki build —
wiki build --render