SWLS activates the moment you open a supported file — no configuration required. This guide walks through the core features using a Turtle file so you can see completions, diagnostics, hover documentation, and formatting in action within minutes of installing the extension.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/SemanticWebLanguageServer/swls-vscode/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
- VS Code >=1.100.0
- The SWLS extension installed (see Installation)
Walkthrough
Open a Turtle file
Create a new file named As soon as the file is open, SWLS activates (you will see
example.ttl and paste the following content:swls appear in the Output panel) and begins parsing the document.Trigger prefix completion
On a new line, type Press
foaf and pause. SWLS will offer a snippet completion that expands the short prefix name into a full @prefix declaration:Tab or Enter to accept. The prefix declaration is inserted at the top of the file and the cursor returns to your current position.Use property completion
After the subject declaration, type a predicate position — for example, place your cursor after the trailing
; on ex:alice a foaf:Person ; and press Space. SWLS analyses the subject type (foaf:Person) and surfaces property suggestions ordered by domain relevance. Select foaf:name from the list to insert it along with a placeholder value.View hover documentation
Hover over the IRI
foaf:Person in the editor. SWLS fetches the FOAF ontology and displays the term’s label, description, and type information in a hover popup — without leaving the editor.Check diagnostics
Delete the
@prefix foaf: declaration from the top of the file and save. SWLS immediately underlines every occurrence of foaf: with a diagnostic error: Undefined prefix. The Problems panel (Ctrl+Shift+M) lists each violation with its file location.Restore the prefix declaration to clear the errors.SPARQL support
SPARQL support is experimental and disabled by default. To enable it, add the following to yoursettings.json:
.sq and .rq files and provides the same diagnostics and semantic highlighting available for Turtle and TriG.
Because SPARQL support is still under active development, you may encounter incomplete features or rough edges. Bug reports and feedback are welcome on the issue tracker.
Next steps
Diagnostics
Learn about syntax errors, undefined prefix detection, and SHACL shape validation.
Completion
Explore prefix expansion, property completion modes, and class suggestions.
Settings reference
Full reference for every
swls.* configuration setting.