OWL Server
A simple server for OWL operations that provides a clean API for managing OWL ontologies.
Features
- Add and remove axioms
- Find axioms by pattern
- Manage prefix mappings
- Event-based change notifications
- Simple command-line interface
Installation
pip install -e .
Usage
Initialize a new OWL file
python -m owl_server.server init my-ontology.owl
Start the server
python -m owl_server.server start my-ontology.owl --debug
Python API
from owl_mcp.owl_api import OwlAPI
# Initialize the API
api = OwlAPI("my-ontology.owl")
# Add an axiom
api.add_axiom("ClassAssertion(:Person :John)")
# Find axioms
axioms = api.find_axioms(":John")
# Add a prefix
api.add_prefix("ex:", "http://example.org/")
# Register for changes
def on_change(event_type, **kwargs):
print(f"Change: {event_type}", kwargs)
api.add_observer(on_change)
Development
- Clone the repository
- Create a virtual environment:
python -m venv venv
- Activate the virtual environment:
- Windows:
venv\Scripts\activate
- Unix/MacOS:
source venv/bin/activate
- Windows:
- Install development dependencies:
pip install -e ".[dev]"