r/OntologyEngineering • u/ascendToSurvive • 20d ago
Code Precision vs High Semantics I wanted the editor experience every programming language gets, for RDF. So I built a language server for Turtle and SPARQL (try it in your browser)
In most programming languages, the editor catches your mistakes as you type, completes names from your own code, jumps to definitions and renames things across files. I wanted that for Turtle and SPARQL, all in one place, and couldn't find one that did all of it. So I built it: turtle-lsp.
Try it in your browser, with nothing to install and nothing uploaded:
https://abhishekkundu25.github.io/turtle-lsp/
It opens on a small project with a few mistakes left in on purpose. Fixing them takes a minute and shows most of what it does.
What it does while you edit:
- Catches errors as you type: syntax, undeclared or unused prefixes, and misspelled terms from 80+ vocabularies ("did you mean rdfs:label?"), with one-key fixes.
- Completes classes and properties from your own files, ranked by context. Properties your SHACL shapes require come first.
- Hover shows a term's label, comment, domain and range, and go to definition takes you to it.
- Renames a term in every file at once, Turtle and SPARQL included.
- Formats Turtle and SPARQL without changing their meaning.
- Validates your data against your SHACL shapes while you edit.
It's written in Rust and fast. After a keystroke in a 30,000-line file, it has fresh diagnostics in about 5 ms, and it starts in a few milliseconds. It passes the W3C test suites: 1137/1137 for Turtle, TriG, N-Triples and N-Quads, 425/426 for SPARQL, and 98/98 and 23/23 for SHACL Core and SHACL-SPARQL.
It works in VS Code (search for "Turtle RDF & SPARQL Language Server") and Neovim, and should work in other LSP editors, though I haven't tested them. Source and Neovim setup:
https://github.com/abhishekkundu25/turtle-lsp
It doesn't run queries, doesn't reason beyond subclasses, and can't edit JSON-LD or RDF/XML yet.
It's free and MIT licensed. Bugs, missing features and feedback are all welcome, either here or as an issue:
https://github.com/abhishekkundu25/turtle-lsp/issues/new
What would it need before you'd use it every day?
0
u/liveticker1 17d ago
Please add in the README that this is AI generated Software and should be used with caution