This is a LSP server implementation for RDF graphs serialized as Turtle.
Install with: pip install turtle_language_server
-
Use the
loadGraphs
command to pull in the graph definitions listed as prefixes in your Turtle file:# caches graphs in-memory for NeoVim session :CocCommand loadGraphs
# overrides cache and pulls graphs anyway :CocCommand loadGraphs force
-
syntax checking your Turtle file (including undefined namespaces)
-
auto-complete when adding statements to the file (relies on
loadGraphs
)
- verify shapes and add validation information to UI
If you are using coc.nvim
, you can configure the language server as follows:
-
Make sure Vim correctly detects turtle files and sets the filetype. One way to achieve this is by adding the following line to your
.vimrc
orinit.nvim
:au BufRead,BufNewFile *.ttl set filetype=turtle
-
Modify your CoC settings to use the
turtle_language_server
when you open a Turtle file.- First, run
:CocConfig
or editcoc-settings.json
- Add the following (merge with existing keys in
"languageserver"
if needed):{ "languageserver": { "turtle": { "command": "turtle_langserver", "filetypes": ["ttl", "turtle"] } } }
- First, run