Syntax highlighting for stOTTR, the terse syntax of Reasonable Ontology Templates (OTTR) — a language for defining reusable templates that generate RDF.
If you write OTTR templates to map tabular data to knowledge graphs, this extension makes .stottr files readable in VS Code instead of one undifferentiated wall of text.
Features
- Highlighting for prefix and base directives (
@prefix,@base) - Distinct styling for template signatures, the
::separator, and template bodies - Parameter modifiers (
?optional,!non-blank) and type annotations (ottr:IRI,xsd:string,xsd:double, …) - List expansion modifiers (
cross,zipMin,zipMax,list) - IRIs (both full
<...>and prefixedex:Foo), blank nodes, and Turtle-style literals with language tags and datatype annotations - Sensible bracket matching and auto-closing for
{},[],(),<>, and"" - Line comments with
#
Installation
Install from the VS Code Marketplace:
- Open the Extensions view (
Cmd+Shift+Xon macOS,Ctrl+Shift+Xon Linux/Windows) - Search for stOTTR
- Click Install
Or from the command line:
code --install-extension veronahe.stottr
Files with the .stottr extension are recognized automatically.
About OTTR
OTTR is a language and framework for building RDF knowledge graphs from reusable templates. A stOTTR template defines a parameterized pattern of RDF triples that can be instantiated against tabular data — see the OTTR primer for an introduction.
This extension provides syntax highlighting only. For template execution, validation, and graph construction, see tools like Lutra or maplib.
Known Limitations
- Highlighting is regex-based (TextMate grammar), so some context-sensitive distinctions are approximate
- No validation, go-to-definition, or hover information — this is a highlighter, not a language server
Contributing
Issues and pull requests welcome at github.com/veleda/vscode-stottr. If you find a stOTTR construct that's highlighted oddly, opening an issue with a small example helps.
License
MIT