Semantic Models for VS Code is a Visual Studio Code extension for editing RDF/Turtle documents, including SAMM Aspect Models.
For RDF/Turtle documents, it features syntax highlighting, document outline and automatic syntax validation. For SAMM Aspect Models, the extension additionally features Go to Definition for elements and semantic model validation.
turtle.languageServerSettings.activateEmbeddedLanguageServer(boolean, default:true)- When enabled, the extension starts the SAMM language server process. When disabled, an external language server must be started manually.
turtle.languageServerSettings.automaticUpdateCheck(boolean, default:true)- Automatically check for updates to the SAMM language server and notify when a new version is available.
turtle.languageServerSettings.sammCliPath(string)- Path to the SAMM CLI executable or JAR file to use as the language server. Can be downloaded or selected using the 'Select SAMM CLI Executable' command.
turtle.languageServerSettings.serverPort(number, default:1846)- TCP port used to connect to the SAMM language server.
turtle.languageServerSettings.traceLevel(string, default:off)- Controls the verbosity of Language Server Protocol (LSP) tracing. Options:
off,messages,verbose.
- Controls the verbosity of Language Server Protocol (LSP) tracing. Options:
Use the command Turtle: Select SAMM CLI Executable to choose either:
- one of the latest SAMM CLI GitHub releases, or
- a custom executable path from your local file system.
- Prefix
Go to Definitioninside Turtle files. - Two-level validation:
- Fast validation while typing from the regular Turtle parser diagnostics provided by the server (appear in the editor and
Problems). - Full Aspect validation from the server for model-level issues (results shown in notifications and status bar).
- Fast validation while typing from the regular Turtle parser diagnostics provided by the server (appear in the editor and
- Manual validation command:
Turtle: Validate Document Now
- In this extension project, install the dependencies using
npm install. - Build the extension with
npm run build. - Press
F5in VS Code to open an Extension Development Host. - Open an RDF/Turtle file such as samples/valid.ttl or your Aspect model file.
If the server cannot be downloaded or started, the extension shows an error and writes a detailed message in the Turtle LSP output channel.
Fast feedback while typing:
- Driven by the server's regular Turtle parsing diagnostics.
- Results appear in the editor and
Problemsview. - Intended for quick editor feedback while you type.
Full Aspect validation:
- Runs on the server, not in the extension.
- Results are displayed in notification messages (for manual validation) or status bar (for save-triggered validation).
- Always uses detailed server validation messaging when the server returns report text.
- Always shows visible progress for long-running validation.
- Runs automatically when saving and can also be triggered manually.
When each validation runs:
- On type: fast syntax feedback only.
- On save: heavy Aspect validation for Turtle documents.
- Manual:
Turtle: Validate Document Nowfor the active Turtle document.
Turtle: Validate Document Now- Sends a server request for the active Turtle document.
Turtle: Select SAMM CLI Executable- Opens a quick pick with the latest ten GitHub releases and a custom-path option.
Turtle: Restart Language Server Connection- Restarts the language server and reconnects the client.
- Manual validation shows a progress notification while the request is running.
- Save-triggered validation always uses a short status-bar progress indicator instead of repeated pop-up notifications.
- After completion, the user gets a summary message with validation results.
- Automatic save validation keeps progress and completion status in the status bar.
Use samples/valid.ttl:
- Open
samples/valid.ttl. - Place the cursor on
foaf:Person,foaf:name, or another prefixed name. - Run
Go to Definition. - Confirm that VS Code jumps to the matching
@prefixdeclaration.
Expected behavior:
foaf:*resolves to@prefix foaf: ....ex:*resolves to@prefix ex: ....
Use samples/org.eclipse.esmf.test/1.0.0/Aspect.ttl or samples/invalid.ttl.
Manual check:
- Open an Aspect model file.
- Run
Turtle: Validate document now. - Wait for validation to complete.
- Confirm that validation results are displayed in a notification.
On-save check:
- Save the model file.
- Confirm that the status bar shows validation progress.
- Confirm that a summary message appears in the status bar after completion.