A modern web-based RDF data editor with powerful graph visualization capabilities. Built with Rust (Actix Web) backend and vanilla JavaScript frontend with Cytoscape.js for interactive graph exploration.
- 🔍 SPARQL Query Execution - Execute SELECT, CONSTRUCT, ASK, and DESCRIBE queries
- 📝 Triple Editing - Full CRUD operations on RDF triples
- 📊 Interactive Graph Visualization - Explore RDF data as an interactive node-link diagram
- 🏷️ Namespace Management - Define and use custom namespace prefixes
- 🔄 Transaction History - Track changes with undo capabilities
- 📦 Import/Export - Support for multiple RDF formats
- ⚡ Performance Caching - Intelligent caching for queries and graph data
- Dynamic Graph Building - Start with a single node and expand connections
- Multiple Layouts - Force-directed, hierarchical, concentric, and grid layouts
- Smart Node Styling - Visual distinction between classes, properties, and instances
- Bulk Visualization - Send query results or entire graphs to the visualization
- Path Finding - Discover connections between nodes (coming in Phase 3)
- Rust 1.70+ and Cargo
- A SPARQL endpoint (Stardog, Fuseki, GraphDB, Virtuoso, etc.)
- Clone the repository
git clone https://github.com/yourusername/rdf-editor.git
cd rdf-editor
- Set up environment
cp .env.example .env
# Edit .env with your SPARQL endpoint details
- Build and run
cargo run
- Open in browser
http://localhost:8080
# Required
SPARQL_ENDPOINT=https://localhost:5820/myDatabase/query
# Authentication (if needed)
SPARQL_USERNAME=admin
SPARQL_PASSWORD=admin
# Server
PORT=8080
HOST=127.0.0.1
# Control graph complexity
GRAPH_MAX_NODES=500 # Maximum nodes to display
GRAPH_MAX_EDGES=1000 # Maximum edges to display
GRAPH_EXPANSION_LIMIT=50 # Nodes added per expansion
GRAPH_SEARCH_LIMIT=10 # Search result limit
See .env.example
for all configuration options including:
- SSL verification settings
- Cache configuration
- CORS settings
- API authentication
- Request timeouts and retries
Execute SPARQL queries with namespace support:
- Define prefixes in the Namespaces tab
- Write your query (prefixes are auto-prepended)
- Click "Execute Query"
- Use "Visualize" button to see results as a graph
Browse and modify RDF data:
- Select a graph from the dropdown
- Filter by resource type (Classes, Properties, Instances)
- Enable editing mode to modify triples
- Click "Visualize Graph" to see the entire graph
Interactive graph exploration:
- Search - Find nodes by URI or label
- Expand - Click nodes to show their connections
- Layout - Choose from multiple layout algorithms
- Visualize - Send data from Query/Browse tabs
Ctrl/Cmd + Enter
- Execute queryAlt + 1/2/3/4/5
- Switch tabsEscape
- Close dialogs
POST /api/query
Content-Type: application/json
{
"query": "SELECT * WHERE { ?s ?p ?o } LIMIT 10",
"graph": "http://example.com/graph" // optional
}
# Get triples
GET /api/graph/{graph_name}/triples
# Add triple
POST /api/graph/{graph_name}/triple
{
"subject": "http://example.com/subject",
"predicate": "http://example.com/predicate",
"object": {
"type": "uri",
"value": "http://example.com/object"
}
}
# Delete triple
DELETE /api/graph/{graph_name}/triple
# Replace triple
PUT /api/graph/{graph_name}/triple/replace
POST /api/graph/search
{
"query": "Person",
"limit": 10
}
POST /api/graph/expand
{
"uri": "http://example.com/Person",
"limit": 50
}
GET /api/graph/node/{encoded_uri}
POST /api/graph/path
{
"from": "http://example.com/nodeA",
"to": "http://example.com/nodeB",
"max_depth": 5
}
- Framework: Actix Web 4
- SPARQL Client: Custom implementation with retry logic
- Caching: In-memory caching with TTL
- Validation: Input sanitization and SPARQL injection prevention
- Graph Visualization: Cytoscape.js
- UI: Vanilla JavaScript with modern ES6+
- Styling: Custom CSS with responsive design
Browser ←→ Actix Web Server ←→ SPARQL Endpoint
↓ ↓ ↓
UI Cache Layer Triple Store
rdf-editor/
├── src/
│ ├── main.rs # Application entry
│ ├── config.rs # Configuration management
│ ├── handlers/ # HTTP request handlers
│ │ ├── query.rs # Query & graph endpoints
│ │ ├── update.rs # Triple modifications
│ │ └── ...
│ ├── models.rs # Data structures
│ └── cache.rs # Caching system
├── static/
│ ├── index.html # Main UI
│ ├── app.js # Frontend logic
│ └── style.css # Styling
└── Cargo.toml # Dependencies
- Backend: Add handler in
src/handlers/
, updatemain.rs
routes - Frontend: Update
static/app.js
andindex.html
- Models: Define structures in
src/models.rs
- Caching: Extend
src/cache.rs
for new data types
# Run tests
cargo test
# Run with debug logging
RUST_LOG=debug cargo run
# Check code
cargo clippy
cargo fmt
- Verify SPARQL endpoint URL format
- Check authentication credentials
- For SSL issues, set
VERIFY_SSL=false
(dev only)
- Adjust cache settings (
CACHE_TTL
,CACHE_MAX_ENTRIES
) - Limit graph visualization (
GRAPH_MAX_NODES
,GRAPH_MAX_EDGES
) - Use pagination for large datasets
- 404 on queries: Check if update endpoint differs from query endpoint
- Graph too large: Reduce expansion limits
- Timeout errors: Increase
SPARQL_TIMEOUT
- Node search and expansion
- Multiple layout algorithms
- Integration with Query/Browse tabs
- Right-click context menus
- Advanced filtering
- Node grouping/clustering
- Path highlighting between nodes
- Multi-class instance styling
- Inferred vs asserted relationship visualization
- Warning indicators for data quality issues
- Debug mode for ontology validation
- Graph statistics and analytics
- Export visualizations (PNG, SVG, GraphML)
- Save/load graph states
- Minimap for large graphs
- Initial Load: Graphs start empty, nodes added on demand
- Expansion Limits: Configurable limits prevent UI overload
- Layout Performance: Force-directed best for <100 nodes, hierarchical for trees
- Caching: Node information cached to reduce SPARQL queries
- Use pagination in Browse tab
- Apply filters before visualizing
- Consider using graph sampling queries
- Increase server resources if needed
- Basic Auth support for SPARQL endpoints
- Optional API key authentication
- Password hashing for secure storage
- URI validation prevents injection
- Literal values properly escaped
- Query size limits enforced
- Configurable allowed origins
- Credentials support for authenticated endpoints
# Query to get class hierarchy
SELECT ?class ?superclass WHERE {
?class rdfs:subClassOf ?superclass .
}
Click "Visualize" to see the class hierarchy as a graph.
- Go to Browse tab
- Select your data graph
- Filter to show only instances
- Click "Visualize Graph"
- Click on nodes to explore connections
- Go to Graph tab
- Search for "Person"
- Click on the Person node
- Continue clicking to explore relationships
- Change layout to "Hierarchical" for better organization
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
# Install development dependencies
cargo install cargo-watch
# Run with auto-reload
cargo watch -x run
# Format code
cargo fmt
# Run linter
cargo clippy -- -D warnings
- Fork the repository
- Create a feature branch
- Make your changes with tests
- Submit a pull request
This project is licensed under the MIT License - see LICENSE file for details.
- Cytoscape.js for graph visualization
- Actix Web for the web framework
- The RDF and Semantic Web community
- Documentation: See
/docs
folder - Issues: GitHub Issues
- Discussions: GitHub Discussions
- Email: support@example.com
- Stardog 7.x, 8.x
- Apache Jena Fuseki 3.x, 4.x
- GraphDB 9.x, 10.x
- Virtuoso 7.x
- Amazon Neptune
- Blazegraph
Query: https://localhost:5820/{database}/query
Update: https://localhost:5820/{database}/update
Query: http://localhost:3030/{dataset}/query
Update: http://localhost:3030/{dataset}/update
Query: http://localhost:7200/repositories/{repository}
Update: http://localhost:7200/repositories/{repository}/statements
Query/Update: http://localhost:8890/sparql
Solutions:
- Use filters to show only specific node types
- Adjust layout algorithm (try Hierarchical)
- Reduce expansion limit in settings
- Use the search to focus on specific nodes
Solutions:
- Change layout to "Force Directed" and wait for stabilization
- Manually drag nodes to better positions
- Increase spacing in layout options
Solutions:
- Use search with partial labels
- Check if node has a label (some may only show URIs)
- Try searching by URI fragment
Solutions:
- Reduce
GRAPH_MAX_NODES
andGRAPH_MAX_EDGES
- Clear the graph and start with fewer nodes
- Enable caching if not already enabled
- Use Chrome/Firefox for best performance
- Added interactive graph visualization
- Bulk triple visualization from Query/Browse tabs
- Improved caching system
- Enhanced configuration options
- Transaction history with undo
- Batch operations
- Import/export functionality
- Performance improvements
- Initial release
- Basic SPARQL query execution
- Triple CRUD operations
- Namespace management