Skip to main content

A tool for parsing and visualizing ontology files written in the Ontol DSL

Project description

Ontol DSL Parser

Build Status PyPi downloads

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.

Features

  • Parse .ontol files 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
  • Java (for local PlantUML rendering)
  • PlantUML (for local rendering)

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 .ontol file.
  • PlantUML File: A .puml file 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:

  1. Fork the repository.
  2. Create a new branch for your feature or bugfix.
  3. Commit your changes.
  4. Ensure all tests pass by running pytest tests.
  5. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ontol-2.11.0.tar.gz (31.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ontol-2.11.0-py3-none-any.whl (25.7 kB view details)

Uploaded Python 3

File details

Details for the file ontol-2.11.0.tar.gz.

File metadata

  • Download URL: ontol-2.11.0.tar.gz
  • Upload date:
  • Size: 31.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for ontol-2.11.0.tar.gz
Algorithm Hash digest
SHA256 3ad3c63c90f7c27fe262654cfb1984ae768d521371807fd55564b1ce9ad4c98d
MD5 8073462a45f8f4385a3f0acdeeb1e574
BLAKE2b-256 c94223f5858fafa8ad5e82e41ee0b66b93813442da10fd417f5137aabe3ab876

See more details on using hashes here.

File details

Details for the file ontol-2.11.0-py3-none-any.whl.

File metadata

  • Download URL: ontol-2.11.0-py3-none-any.whl
  • Upload date:
  • Size: 25.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for ontol-2.11.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1978134693ab8a02c86102ae9939805fda6a7c47a4e80ac88c0607222c8759d5
MD5 6cddaaaf0ca4a0a0c2ad8f2b5d43f976
BLAKE2b-256 751e45e904e5cb54f00de34a725ed37bf70d6dd798be8d835b5750447239bfd5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page