Thank you for your interest in contributing to OWLAPY! We welcome contributions from the community.
- Code of Conduct
- Getting Started
- Development Setup
- How to Contribute
- Coding Standards
- Testing
- Documentation
- Pull Request Process
- Reporting Bugs
- Feature Requests
This project adheres to a Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to the project maintainers. See CODE_OF_CONDUCT.md for details.
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/YOUR-USERNAME/owlapy.git cd owlapy - Add the upstream repository:
git remote add upstream https://github.com/dice-group/owlapy.git
-
Create a conda environment:
conda create -n owlapy_dev python=3.11 --no-default-packages conda activate owlapy_dev
-
Install the package in development mode with all dependencies:
pip install -e '.[all]' -
Install pre-commit hooks (optional but recommended):
pip install pre-commit pre-commit install pre-commit run --all-files
-
Download test data:
wget https://files.dice-research.org/projects/Ontolearn/KGs.zip -O ./KGs.zip unzip KGs.zip
- Bug fixes: Find and fix bugs in the codebase
- New features: Implement new functionality
- Documentation: Improve or add documentation
- Tests: Add or improve test coverage
- Examples: Create example scripts demonstrating features
- Performance: Optimize existing code
-
Create a new branch for your work:
git checkout -b feature/your-feature-name # or git checkout -b fix/your-bug-fix -
Make your changes and commit them:
git add . git commit -m "Description of your changes"
-
Keep your branch up to date with upstream:
git fetch upstream git rebase upstream/develop
-
Push your changes to your fork:
git push origin feature/your-feature-name
-
Open a Pull Request on GitHub
- Follow PEP 8 guidelines (enforced by ruff)
- Maximum line length: 200 characters
- Use type hints wherever possible
- Write descriptive variable and function names
Before submitting, ensure your code passes all checks:
# Run linter
ruff check owlapy --line-length=200
# Run tests
pytest
# Check test coverage
coverage run -m pytest
coverage report -mIf you've installed pre-commit hooks, they will automatically run before each commit:
- ruff: Code linting and formatting
- Style checks
- Place tests in the
tests/directory - Name test files with
test_prefix - Use descriptive test names that explain what is being tested
- Aim for high test coverage (target: ≥82%)
# Run all tests
pytest
# Run specific test file
pytest tests/test_owlapy.py
# Run with coverage
coverage run -m pytest
coverage report -m
# Ignore slow tests (EBR)
pytest --ignore=tests/test_z_do_last_ebr_retrieval.py- Use Google-style docstrings for all public functions, classes, and methods
- Include:
- Brief description
- Args with types
- Returns with type
- Raises (if applicable)
- Examples (when helpful)
Example:
def owl_expression_to_sparql(expression: OWLClassExpression) -> str:
"""Convert an OWL class expression to a SPARQL query.
Args:
expression: The OWL class expression to convert.
Returns:
A SPARQL SELECT query string.
Raises:
ValueError: If the expression cannot be converted.
Example:
>>> from owlapy.class_expression import OWLClass
>>> ce = OWLClass("http://example.com/Person")
>>> query = owl_expression_to_sparql(ce)
"""Documentation is built using Sphinx:
cd docs
make html-
Update CHANGELOG.md: Add your changes under the
[Unreleased]section -
Update documentation: If you've changed APIs or added features, update relevant docs
-
Ensure tests pass: All tests must pass in CI
-
Code review: Wait for at least one maintainer to review your PR
-
Address feedback: Make requested changes and push updates
-
Squash commits (optional): You may be asked to squash commits before merging
Use conventional commit format:
feat: Add new feature Xfix: Resolve bug in Ydocs: Update documentation for Ztest: Add tests for Wrefactor: Improve code structure in Vperf: Optimize performance of U
- Check if the bug has already been reported in Issues
- Verify it's actually a bug and not a feature
- Collect relevant information (error messages, stack traces, environment)
**Describe the bug**
A clear description of the bug.
**To Reproduce**
Steps to reproduce:
1. ...
2. ...
**Expected behavior**
What you expected to happen.
**Actual behavior**
What actually happened.
**Environment:**
- OS: [e.g., Ubuntu 22.04]
- Python version: [e.g., 3.11.5]
- OWLAPY version: [e.g., 1.6.4]
**Additional context**
Any other relevant information.We welcome feature requests! Please:
- Check if the feature has already been requested
- Clearly describe the feature and its use case
- Explain why this feature would be valuable to OWLAPY users
- Provide examples of how it would be used
- Check the documentation
- Ask on GitHub Discussions (if enabled)
- Open an issue with the "question" label
By contributing, you agree that your contributions will be licensed under the MIT License.
Contributors will be acknowledged in:
- CHANGELOG.md for their specific contributions
- GitHub's contributor list
Thank you for contributing to OWLAPY! 🎉