| repo-uri | osg://repo/local:abdbf4e76ab73069ed43c376a3eab6f89eeb0a4e | |
|---|---|---|
| tags |
|
|
| layout | node.js | |
| notes | Published as Obsidian plugin |
Query your Obsidian notes with SPARQL. Dot Triples is an alternative to Dataview that uses standard RDF and SPARQL instead of a custom query language.
Dot Triples indexes your Markdown and Canvas files as RDF triples with dot-triples and stores them in a triplestore. You then query that graph from inside your notes.
The embedded triplifier uses triplifier-md and triplifier-canvas from dot-triples 0.2.1. Canvas edge labels become predicates between linked notes. Canvas files are included in Re-index vault, Sync current file, and automatic indexing on open or save. Each canvas has its own file:///.../Board.canvas named graph. External OSG triplifier mode remains Markdown-only.
You can:
- Run SPARQL queries in
dot-sparqlcode blocks. - Show contextual panels with query results for the current note.
- Query across many vaults when you use a shared triplestore.
The queries use standard SPARQL. Other RDF tools and external systems (for example MCP servers) can query the same graph.
- Built-in triplestore: the plugin runs an in-memory triplestore. You do not need external setup to start.
- Automatic indexing: the plugin indexes a note when you open or save it.
- Contextual panels: the panel shows query results for the current note.
- Cross-vault queries: query across many vaults through a shared triplestore.
- Agent integration: external tools can query the graph through the SPARQL endpoint.
Install with BRAT:
- Install the BRAT plugin.
- Add this repository:
https://github.com/cristianvasquez/dot-triples-plugin.
Or install manually:
- Download the release archive from the GitHub releases page.
- Extract
main.js,manifest.json, andstyles.cssinto<vault>/.obsidian/plugins/dot-triples/.
- Enable the plugin. It uses the in-memory triplestore by default.
- Run the Re-index vault command to index your notes.
- Add a
dot-sparqlcode block to a note:
SELECT ?p ?o WHERE {
?s ?p ?o .
} LIMIT 5
This query shows 5 triples.
To query the current note, use the note name as the subject:
SELECT ?p ?o WHERE {
[[Current Note]] ?p ?o .
}
- Open the panel to show contextual queries for the current note.
The plugin replaces these tokens before it sends the query:
__THIS__: the current note name URI (urn:name:NoteName).__DOC__: the current note file URI (file:///absolute/path).__REPO__: the current vault repository URI.__property__: a property placeholder (for example,__label__becomes<urn:token:label>).[[Note Name]]: a wiki link. The plugin converts it to a name URI.
Run Re-index vault after upgrading to replace stored triples. The plugin migrates the previous default panel discovery query; update custom queries yourself.
- Frontmatter
tagsnow usesschema:keywords, andtitleusesrdfs:label. - Files link to their notes and headings through
schema:about. Prose links usedct:references. - Code blocks use
schema:hasPart,schema:programmingLanguage, andresource:selectorwithoa:exactfor their text. - Use
https://schema.org/forschema:andosg://vocab/resource#forresource:.
The embedded triplifier keeps the library's urn:name:Note.md file subject inside the file:///.../Note.md named graph. __DOC__ identifies that graph; __THIS__ identifies the note. Names preserve case, and heading links such as [[Note#Heading]] resolve to urn:name:Note%23Heading. Body fields still use urn:token: predicates; domain types require downstream mappings.
Copy the updated example panels into your vault to replace queries that use the old vocabulary.
The example-panels/ directory has ready-to-use query panels
for backlinks, statistics, navigation, tags, and more. Each panel is a note with
the panel/query tag.
- Open panel: show the query panel for the current note.
- Insert example SPARQL code-block: add a query template at the cursor.
- Insert named query template: add a titled query block at the cursor.
- Sync current file: index the current note.
- Re-index vault: index all notes in the vault.
- Refresh panel: reload the panel and render it again.
- Query URL: the SPARQL endpoint. Set it to use an external triplestore instead of the built-in one.
- Panel tag: the tag that marks panel notes. The default is
panel/query. - Panel SPARQL query: the query that finds panel notes. It must return
?document,?title, and?content. - Index on open / Index on save: index a note automatically when you open or save it.
pnpm install # install dependencies
pnpm run build # production build into main.js
pnpm exec vitest run # run the tests once