Ontogram is an OWL ontology diagram generator.
Project description
Ontogram
Ontogram is an OWL ontology diagram generator.
Currently it supports owl:class
, rdfs:subClassOf
, owl:equivalentClass
, datatype properties and domain and range relationships. I am planning to add support for owl:subClassOf
restrictions soon.
Example output
The output of examples/tern-org.ttl.
Installation
Install via PyPI for Python 3.
pip3 install ontogram
Usage
Web service
Coming soon.
Command line application
$ ontogram --help
Usage: ontogram [OPTIONS] ONTOLOGY_FILEPATH
Ontogram CLI is a tool to generate a diagram from an OWL ontology file.
Options:
--format ['turtle', 'xml', 'nt', 'n3']
RDF serialization of input file. Default is
turtle.
--help Show this message and exit.
Use Ontogram's CLI to generate diagrams of an OWL ontology.
ontogram ontology.ttl
Output will be 3 files, ontology.ttl.txt
, ontology.ttl.png
, ontology.ttl.svg
.
Use the --format option to specify the RDF serialization of the ontology if it is not Turtle.
Python library
Ontogram is a Python library and can be easily integrated with any existing Python application.
from ontogram import Ontogram
# First parameter accepts a file path to the OWL ontology.
# Second parameter tells Ontogram what RDF format the OWL ontology is in.
ontogram = Ontogram('ontology.ttl', format='turtle')
# Generate a PNG diagram from the OWl ontology and write to disk as 'ontology.ttl.txt'.
ontogram.png_file('ontology.ttl.txt')
# Same as above, but as an SVG diagram.
ontogram.svg_file('ontology.ttl.svg')
See the examples directory for example outputs.
Docker image for diagram generation within pyLODE
A Docker image has been created to automatically embed the generated diagram into a pyLODE document. See https://github.com/edmondchuc/docker-pylode
See the pyLODE output with the generated ontology diagram: https://w3id.org/tern/ontologies/org
A more formal integration with pyLODE will be coming soon.
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
File details
Details for the file ontogram-0.1.0.post1.tar.gz
.
File metadata
- Download URL: ontogram-0.1.0.post1.tar.gz
- Upload date:
- Size: 33.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.1 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9374e41559a4a8097474bb168c1db1289186e63b8d2df98e49895d248c8fac1f |
|
MD5 | 00c9f3018f11cfadd54330c2492c4e77 |
|
BLAKE2b-256 | 42541084222979c4f038df0054490ec7447ddc876409e5de74352fc2f4645ef9 |
Provenance
File details
Details for the file ontogram-0.1.0.post1-py3-none-any.whl
.
File metadata
- Download URL: ontogram-0.1.0.post1-py3-none-any.whl
- Upload date:
- Size: 47.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.1 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6af7ce406cfe609b28c1c477febd2a5eed23811f0dbfff10bc97561b57a1cfef |
|
MD5 | b0bdb65205904eebbe45360604797fea |
|
BLAKE2b-256 | e62c28694247b98e6613dca6795a6354a4fd1af246c08a8f9b49e58fd3ae9c31 |