A tool for parsing and visualizing ontology files written in the Ontol DSL
Project description
Ontol DSL Parser
Authors: Skvortsov Vladimir, Aptukov Mikhail, Markov Mikhail, Khamidullin Ilsaf, Afanasyev Andrew.
Ontol DSL Parser is a command-line tool for parsing and visualizing ontology files written in the Ontol DSL. It generates JSON representations and PlantUML diagrams from .ontol files.
Explore Ontol DSL in the Online REPL
Features
- Parse
.ontolfiles to extract ontology structures. - Serialize ontology to JSON format.
- Generate PlantUML diagrams from ontology.
- Automatically render PlantUML diagrams to PNG images.
- Watch files for changes and re-parse them automatically.
- Display version and help information.
Requirements
- Python 3.9 or higher.
Installation
Install from PyPi:
pip install ontol
Usage
Parse a file
To parse an .ontol file and generate JSON and PlantUML files:
ontol path/to/yourfile.ontol
Watch Mode
To watch a file for changes and automatically re-parse it:
ontol path/to/yourfile.ontol --watch
Debug mode
To enable debug mode, which retranslates the output back to the .ontol file:
ontol path/to/yourfile.ontol --debug
Display Version
To display the version of the program:
ontol --version
Help
To display help information:
ontol --help
Tests
To display run tests:
pytest tests
Output
- JSON File: A JSON representation of the ontology is saved with the same basename as the
.ontolfile. - PlantUML File: A
.pumlfile is generated for visualization. - PNG Image: A PNG image is rendered from the PlantUML file.
Debug mode
When the --debug flag is used, the parser retranslates the output back to the .ontol file. This is particularly useful for debugging, as it allows you to verify the accuracy and consistency of the parsing process. The retranslated file is saved with the same name as the original .ontol file, enabling easy comparison between the original and retranslated versions.
Contributing
Contributions are welcome! If you'd like to contribute, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bugfix.
- Commit your changes.
- Ensure all tests pass by running
pytest tests. - Submit a pull request.
License
This project is licensed under the Apache-2.0 License. See the LICENSE file for details.
Acknowledgments
- Thanks to the PlantUML team for providing an excellent tool for diagram generation.
- Special thanks to all contributors and users of the Ontol DSL Parser.
- A heartfelt thank you to Danil Pestryakov and Nikita Motorny for their inspiration and support.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ontol-2.14.1.tar.gz.
File metadata
- Download URL: ontol-2.14.1.tar.gz
- Upload date:
- Size: 33.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ccec31c94210245f5404693f8761587d30fe1019c937418e97be7f867f4a7662
|
|
| MD5 |
999836cffb28c23e375e445e8d094a37
|
|
| BLAKE2b-256 |
1d77c18c3307e620a86b19d8129f7d7028e7a62c89bfe74ef807214f019f4639
|
File details
Details for the file ontol-2.14.1-py3-none-any.whl.
File metadata
- Download URL: ontol-2.14.1-py3-none-any.whl
- Upload date:
- Size: 28.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
82a6e20237ca9e033610c509f182c5c610528f049daa3236ae026932a8d934a9
|
|
| MD5 |
69816aec58fdefdaecfc7b33c3932393
|
|
| BLAKE2b-256 |
3a4f6510beb5b6ba684b52020af4d72c0ea07d66cfc36232dfe6be4241dd741f
|