Semantic Web Language Server

June 30, 2026 · View on GitHub

Docs LICENSE Visual Studio Marketplace Last Updated

IDE support for Semantic Web languages — Turtle, TriG, N3, JSON-LD, and SPARQL. Autocompletion, diagnostics, formatting, SHACL validation, and more.

Table of Contents

Features

Diagnostics

  • Syntax errors — immediate feedback on malformed documents
  • Undefined prefixes — flags uses of undeclared namespace prefixes
  • SHACL shape violations — validates data against loaded SHACL shapes

Completion

  • Prefix completion — typing foa expands to foaf: and inserts the prefix declaration
  • Property completion — suggests properties ordered by domain relevance
  • Class completion — when the predicate is a, suggests applicable classes

Hover

  • Shows labels, descriptions, and class information for IRIs

Rename

  • Rename terms local to the current file

Formatting

  • Format Turtle, TriG, N3, and JSON-LD documents
  • Enabled for Turtle by default; enable the others via swls.format.*

Semantic Highlighting

  • Full semantic token highlighting for all supported languages

Installation

VS Code

Install from the Visual Studio Marketplace or Open VSX Registry.

On startup the extension looks for a native swls binary in its own directory (set swls.command to use a custom path instead). If no binary is found it falls back to a bundled WASM worker so the LSP is available immediately without any extra setup.

In the background it checks GitHub releases for updates. When a newer version is available you will be prompted to install it; after the download completes a window reload switches to the native binary.

NeoVim

A NeoVim plugin is available at SemanticWebLanguageServer/swls.nvim.

Configuration

All settings live under the swls prefix.

SettingTypeDefaultDescription
swls.commandstring""Path to the swls binary. If empty, the bundled binary in the extension directory is used
swls.forceWasmbooleanfalseSkip the native binary and always run the bundled WASM language server
swls.languagesstring[]["turtle", "trig", "n3", "jsonld"]Languages SWLS is enabled for. Values: turtle, trig, n3, jsonld, sparql (experimental)
swls.formatLanguagesstring[]["turtle"]Languages document formatting is enabled for. Values: turtle, trig, n3, jsonld
swls.checkUpdatebooleantrueCheck GitHub for new releases on startup
swls.automaticUpdatebooleanfalseInstall updates without prompting
swls.logstring"debug"Log level: error, warn, info, debug, trace
swls.ontologiesstring[][]Extra ontology URLs to load
swls.shapesstring[][]Extra SHACL shape URLs to load
swls.prefixDisabledstring[][]Prefixes from prefix.cc to hide from completions
swls.completion.modestring"none"Property completion mode: none (server default), loose (all properties), strict (domain-matched only)
swls.completion.exceptionsstring[][]Namespace IRIs that get the opposite treatment of completion.mode: forced strict in loose mode, always suggested in strict mode. Ignored when mode is none
swls.prefixFormatstring"turtle"Syntax for inserted Turtle/TriG prefix declarations: turtle (@prefix ex: <...> .) or sparql (PREFIX ex: <...>)
swls.disabledstring[][]Features and diagnostics to turn off. Pick from the values below (in Settings UI: Add Item → choose from the dropdown)

swls.disabled values

ValueDisables
shapesSHACL shape validation
undefined_prefixThe undeclared-prefix diagnostic
unused_prefixThe unused-prefix diagnostic
namespace_propertiesThe closed-namespace property diagnostic
syntax_diagnosticsSyntax/parse error diagnostics
completionCompletion entirely
completion_keywordKeyword completion
completion_classClass-name completion
completion_propertyProperty completion
completion_prefixPrefix-name completion
completion_subjectSubject-IRI completion (Turtle only)
hoverHover entirely
hover_typeInferred-type hover
hover_classClass documentation hover
hover_propertyProperty documentation hover
hover_excluded_propertyAllow-listed-property hover explanation
goto_definitionGoto-definition entirely
goto_definition_components_jsComponents.js goto-definition
goto_type_definitionGoto type-definition
referencesFind-all-references
renameRename
semantic_tokensSemantic tokens
formatDocument formatting
prefix_auto_insertAuto-inserting missing prefix declarations
code_actionCode actions entirely
code_action_organize_importsThe "Organize Imports" quick-fix
code_action_blank_node_refactorBlank-node refactor quick-fixes
inlay_hintInlay hints

Deprecated but still honored, so existing configs keep working: the per-feature swls.disable.<name>, per-language swls.<lang> and swls.format.<lang> booleans, and swls.completion.strict / swls.completion.except (replaced by swls.completion.exceptions).

Documentation

Screenshots

Undefined prefixShape violation
Undefined PrefixesShape violations
Class completionProperty completion
Complete ClassComplete Property

Support

If SWLS helps your workflow, consider supporting development:

https://ko-fi.com/ajuvercr