|
| Command | Description |
|---|---|
Carapace: Open Graph to the Side |
Open the graph for the active Turtle file beside the editor |
Carapace: Open Graph |
Open the graph in the current editor group |
Carapace: Reveal Node at Cursor in Graph |
Select and centre the node defined on the cursor line |
Carapace: Search Graph |
Search nodes and predicates |
Carapace: Fit Graph to View |
Zoom to fit the whole graph |
Carapace: Re-run Graph Layout |
Recompute the force-directed layout |
Carapace: Toggle Graph Lock |
Lock/unlock the layout |
Carapace: Graph Settings |
Show the per-document graph settings |
Carapace: Export Graph as SVG / PNG |
Export the graph image |
Carapace: Reset Graph Settings for Document |
Restore the default graph settings |
Carapace: Forget Saved Layout for Document |
Discard the saved layout and lay the graph out again |
Carapace: Convert RDF/XML to Turtle |
Convert an .rdf/.owl/.xml file to Turtle |
Carapace: New Sample Ontology |
Open the sample ontology with its graph |
Settings
| Setting | Default | Description |
|---|---|---|
carapace.preview.updateDelay |
300 |
Delay (ms) before edits are reflected in the graph |
carapace.preview.followCursor |
highlight |
off, highlight or center the node at the editor cursor |
carapace.preview.revealLineOnNodeClick |
true |
Clicking a node moves the editor to its definition |
carapace.diagnostics.enabled |
true |
Report Turtle syntax errors in the Problems panel |
carapace.export.theme |
light |
Palette used for SVG/PNG exports (light or current) |
carapace.graph.hiddenEntityTypes |
["blank"] |
Entity types hidden in new documents |
carapace.graph.hiddenNamespaces |
rdf:, rdfs:, owl: |
Namespaces whose nodes are hidden in new documents |
carapace.graph.hiddenPredicates |
[] |
Predicates whose objects are hidden in new documents |
carapace.graph.hiddenInstanceOf |
owl:Ontology |
Nodes typed with these classes are hidden in new documents |
carapace.graph.nodeNamePredicate |
rdfs:label |
Predicate whose value is used as the node name (empty: local name) |
carapace.graph.duplicateExternalNodes |
false |
Draw external nodes once per reference |
IRIs in the carapace.graph.* settings can be written in full or with the rdf:, rdfs:, owl: and xsd: prefixes.
Architecture
src/
├── core/ Carapace's graph engine, ported from the web app without framework dependencies:
│ Turtle parsing and node↔line mapping (N3.js), preprocessing, graph building, node measuring,
│ plus the outline and term helpers used by the language features
├── extension/ Extension host: graph panels (webviews), language features (diagnostics, outline,
│ definition, hover), RDF/XML conversion, per-document state, commands
├── webview/ Graph UI in plain TypeScript + SVG: renderer (port of GraphNode/GraphEdge), d3-force layout,
│ pan/zoom/drag/box-select, search, settings panel, SVG/PNG export
└── shared/ Typed message protocol between the extension host and the webview
The editor is VS Code's own text editor, so the graph is an extension webview that receives the document text. It parses and builds the graph with the same code Carapace runs in the browser.
Development
npm install
npm run build # bundle the extension and webview into dist/ (esbuild)
npm run watch # rebuild on change; press F5 in VS Code to launch the Extension Development Host
npm run typecheck && npm run lint && npm run format:check
npm run test:unit # engine (incl. Carapace's own test suite), grammar, RDF/XML, extension host with a fake vscode API
npm run test:w3c # the official W3C Turtle 1.1 + 1.2 test suites (fetched from github.com/w3c/rdf-tests)
npm run test:webview # end-to-end tests of the graph webview in Chromium (Playwright)
npm run test:integration # the extension running inside a real VS Code instance (@vscode/test-electron)
npm run package # produce a .vsix
On Linux without a display, run integration tests with xvfb-run -a npm run test:integration. Regenerate the README screenshots with SCREENSHOTS=1 npx playwright test screenshots.
Releasing
Pushing a version tag (npm version minor && git push --follow-tags) runs the full CI suite. If it passes, the extension is published to the VS Code Marketplace and Open VSX, and a GitHub Release is created. The Marketplace sign-in uses Microsoft Entra ID through GitHub OIDC, so no token is stored. One-time setup and details: docs/RELEASING.md.
Credits & licence
Carapace is created by sellsol. This extension ports its graph engine, rendering and interaction design to VS Code. Like Carapace, it is licensed under the GNU General Public License v3.0.