This repo includes the source code for the semantic web language server. The language server provides IDE like functionality for semantic web languages, including Turtle, JSON-LD and SPARQL.
- Syntax diagnostics
- Undefined prefix diagnostics
- SHACL shape diagnostics
- Prefix completion (just start writing the prefix,
foacompletes tofoaf:and adding the prefix statement) - Property completion (ordered according to domain)
- Class completion (when writing the object where the prediate is
a)
- Shows additional information about the entities like class
- Rename terms local to the current file
- Format Turtle
- Enables semantic highlighting
Currently a fluwent install is possible for NeoVim and VSCode. However the language server protocol enables swift integration into other editors.
Install the semantic web lsp extension (vscode or open-vscode). The extension starts the lsp from WASM and starts the vscode LSP client.
To use the LSP you will always have to install the binary. So do that first:
cargo install --git https://github.com/SemanticWebLanguageServer/swls --bin swls
Or locally
git clone https://github.com/SemanticWebLanguageServer/swls
cargo install --path swls
Configure the LSP in NeoVim.
# Add a config to lspconfig.configs
local configs = require("lspconfig.configs")
configs.jsonld = {
default_config = {
cmd = { 'swls' },
filetypes = { 'jsonld', 'turtle', 'sparql' },
root_dir = require("lspconfig.util").find_git_ancestor,
single_file_support = true,
init_options = {},
}
}
# Start the LSP
local lspconfig = require("lspconfig")
lspconfig.jsonld.setup {
on_attach = M.on_attach,
capabilities = M.capabilities,
}| Undefined prefix | Shape violation |
|---|---|
![]() |
![]() |
| Complete Class | Complete Property |
|---|---|
![]() |
![]() |



