Thank you for your interest in contributing to RDF Preview! This VS Code extension provides visualization of RDF graphs in Turtle and N-Triples formats.
-
Fork and Clone
git clone https://github.com/LucienRbl/rdf-preview.git cd rdf-preview -
Install Dependencies
npm install
-
Open VSCode and Run the Extension
- Press
F5to open a new VS Code window with the extension loaded - Open a
.ttlor.ntfile - Click the "Preview RDF Graph" button in the editor toolbar
- Press
rdf-preview/
├── src/
│ ├── extension.ts # Main extension logic
│ └── test/
│ ├── extension.test.ts # Unit tests
│ └── darwin.ttl # Test RDF file
├── media/
│ ├── d3script.js # D3.js graph visualization
│ └── style.css # CSS styles for webview
├── package.json # Extension manifest
├── tsconfig.json # TypeScript configuration
├── eslint.config.mjs # ESLint configuration
└── README.md # Project documentation
# Compile TypeScript
npm run compile
# Watch for changes (recommended during development)
npm run watch
# Run linting
npm run lint
# Run tests
npm test-
Manual Testing
- Press
F5to launch extension development host - Open test files in
src/test/darwin.ttl - Test the "Preview RDF Graph" command
- Press
-
Unit Tests
- Run
npm testto execute automated tests - Tests are located in
src/test/extension.test.ts
- Run
- Set breakpoints in
src/extension.ts - Use VS Code's built-in debugger
- Check the Debug Console for extension output
- Use browser dev tools for webview debugging
- Follow the existing TypeScript/JavaScript conventions
- Use ESLint for code formatting:
npm run lint - Add JSDoc comments for public functions
- Use meaningful variable and function names
Use conventional commit format:
feat: add support for RDF/XML format
fix: resolve graph rendering issue with blank nodes
docs: update README with new features
test: add unit tests for graph generation
-
Create a Feature Branch
git checkout -b feature/your-feature-name
-
Make Your Changes
- Write clean, readable code
- Add tests for new functionality
- Update documentation if needed
-
Test Thoroughly
- Run all tests:
npm test - Test manually with various RDF files
- Ensure no linting errors:
npm run lint
- Run all tests:
-
Submit PR
- Push your branch to your fork
- Open a pull request with a clear description
- Reference any related issues
When reporting bugs, please include:
- VS Code version
- Extension version
- Sample RDF file that causes the issue
- Steps to reproduce
- Expected vs actual behavior
- Console errors (if any)
We welcome feature suggestions! Please:
- Check existing issues first
- Provide a clear use case
- Describe the expected behavior
- Consider implementation complexity
By contributing, you agree that your contributions will be licensed under the same license as the project.
Thank you for contributing to RDF Preview! 🎉