RDF Graph Builder
unlistedby Artemis-IA
Craft, visualize, align and evolve RDF ontologies in Obsidian. Live source↔graph editing, SPARQL, LOV search, multiple visualizations.
Obsidian RDF Graph Viewer
Interactive RDF graph visualization plugin for Obsidian. Load ontologies from URIs, SPARQL endpoints, or local .ttl files and explore them with an interactive graph interface.
Features
-
Load RDF from multiple sources:
- HTTP/HTTPS URIs (remote ontologies)
- SPARQL endpoints (with custom CONSTRUCT queries)
- Local
.ttlfiles from your vault - Clipboard (paste Turtle content directly)
-
Interactive graph visualization:
- Force-directed layout (cose)
- Multiple layout options (dagre, concentric, breadthfirst, circle, grid)
- Zoom, pan, and node selection
- Color-coded nodes by type (classes, properties, instances, literals)
-
TBox/ABox distinction:
- TBox (terminology): classes and properties (blue/green)
- ABox (assertions): instances and data (orange)
- Toggle visibility of TBox/ABox independently
-
Prefix compression:
- Automatic URI compression (e.g.,
http://www.w3.org/2000/01/rdf-schema#Class→rdfs:Class) - Support for custom prefixes defined in Turtle files
- Automatic URI compression (e.g.,
-
Export options:
- Export to Mermaid (for Markdown rendering)
- Export to Obsidian Canvas (native Obsidian format)
- Export to PNG (image)
-
Configurable settings:
- Default layout algorithm
- TBox/ABox/Literals inclusion preferences
- Visual customization (node size, edge width, font size)
- Color schemes
- Default SPARQL endpoint
Installation
Manual Installation
- Download the latest release from GitHub Releases
- Extract the downloaded zip file
- Copy the extracted folder to your vault's
.obsidian/plugins/directory - Enable the plugin in Obsidian Settings → Community Plugins
Development Installation
# Clone the repository
git clone https://github.com/Artemis-IA/obsidian-rdf-builder.git
cd obsidian-rdf-builder
# Install dependencies
npm install
# Build the plugin
npm run build
# Copy to your vault's plugins directory
cp main.js styles.css manifest.json ~/.obsidian/plugins/obsidian-rdf-builder/
Usage
Load RDF from URI
- Open Command Palette (
Ctrl/Cmd + P) - Search for "RDF: Load RDF from URI"
- Enter the URI of the ontology (e.g.,
https://example.org/ontology.ttl) - The graph will be displayed in the right sidebar
Load RDF from SPARQL Endpoint
- Configure default SPARQL endpoint in plugin settings
- Open Command Palette
- Search for "RDF: Load RDF from SPARQL endpoint"
- The plugin will use the configured endpoint or prompt for one
- Graph data is loaded via CONSTRUCT query
Load RDF from Local File
- Place
.ttlfiles in your vault - Open Command Palette
- Search for "RDF: Load RDF from local file"
- The plugin will find and load the first `.ttl file
Load RDF from Clipboard
- Copy Turtle content to clipboard
- Open Command Palette
- Search for "RDF: Load RDF from clipboard"
- Paste the content when prompted
Export Graph
- To Mermaid: Command "RDF: Export graph to Mermaid" - creates a new note with Mermaid code
- To Canvas: Command "RDF: Export graph to Obsidian Canvas" - creates a .canvas file
- To PNG: Command "RDF: Export graph to PNG" - downloads the graph as an image
Supported RDF Formats
- Turtle (
.ttl,.turtle) - N-Triples (
.nt,.ntriples) - N-Quads (
.nq,.nquads) - TriG (
.trig)
Graph Controls
- Zoom: Mouse wheel or pinch gesture
- Pan: Click and drag on empty space
- Select node: Click on a node to see its properties in the console
- Fit to view: Command "RDF: Fit graph to view"
Commands
| Command | Description |
|---|---|
| RDF: Load RDF from URI | Load ontology from a remote URI |
| RDF: Load RDF from local file | Load ontology from vault .ttl files |
| RDF: Load RDF from clipboard | Load ontology from clipboard content |
| RDF: Load RDF from SPARQL endpoint | Load ontology from SPARQL endpoint |
| RDF: Toggle RDF Graph View | Open/close the graph view |
| RDF: Export graph to Mermaid | Export to Mermaid format |
| RDF: Export graph to Obsidian Canvas | Export to Canvas format |
| RDF: Export graph to PNG | Export to PNG image |
Settings
Layout Settings
- Default layout: Choose between cose, dagre, concentric, breadthfirst, circle, or grid
Content Settings
- Include TBox by default: Show classes and properties
- Include ABox by default: Show instances and data
- Include literals by default: Show literal values
- Include blank nodes by default: Show blank nodes
Visual Settings
- Node size: Size of graph nodes (10-100px)
- Edge width: Width of graph edges (1-10px)
- Font size: Font size for labels (8-24px)
- Show labels: Display node and edge labels
- Color scheme: Default, Dark, Light, or Pastel
SPARQL Settings
- Default SPARQL endpoint: Configure default endpoint for quick loading
Development
Project Structure
obsidian-rdf-builder/
├── src/
│ ├── main.ts # Plugin entry point
│ ├── views/
│ │ └── RDFGraphView.ts # Custom view with Cytoscape
│ ├── rdf/
│ │ ├── parser.ts # N3.js RDF parser
│ │ ├── prefix.ts # Prefix compression/expansion
│ │ ├── classifier.ts # TBox/ABox classification
│ │ └── converter.ts # RDF → Cytoscape conversion
│ ├── loaders/
│ │ ├── uri-loader.ts # Load from HTTP URIs
│ │ ├── file-loader.ts # Load from vault files
│ │ ├── clipboard.ts # Load from clipboard
│ │ └── sparql-loader.ts # Load from SPARQL endpoints
│ ├── exporters/
│ │ ├── mermaid.ts # Export to Mermaid
│ │ ├── canvas.ts # Export to Obsidian Canvas
│ │ └── png.ts # Export to PNG
│ └── ui/
│ └── settings.ts # Plugin settings
├── styles.css # Plugin styles
├── manifest.json # Plugin manifest
├── package.json # NPM dependencies
├── tsconfig.json # TypeScript config
└── esbuild.config.mjs # Build configuration
Build
# Development mode (watch for changes)
npm run dev
# Production build
npm run build
Dependencies
- N3.js - RDF parsing and serialization
- Cytoscape.js - Graph visualization library
- Obsidian API - Obsidian plugin API
Roadmap
- File selector for local file loading
- Sidebar with node details panel
- Graph search and filtering
- Multiple graph tabs
- Custom color schemes
- SPARQL query builder UI
- Incremental loading from large endpoints
License
MIT
Contributing
Contributions are welcome! Please open an issue or submit a pull request.
Credits
- Built with Obsidian Sample Plugin
- RDF parsing powered by N3.js
- Graph visualization powered by Cytoscape.js
For plugin developers
Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.