Skip to main content

Ontogram is an OWL ontology diagram generator.

Project description


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.

generated ontology diagram


Install via PyPI for Python 3.

pip3 install ontogram


Web service

Coming soon.

Command line application

$ ontogram --help


  Ontogram CLI is a tool to generate a diagram from an OWL ontology file.

  --format ['turtle', 'xml', 'nt', 'n3']
                                  RDF serialization of input file. Default is
  --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'.

# Same as above, but as an SVG diagram. 

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

See the pyLODE output with the generated ontology diagram:

A more formal integration with pyLODE will be coming soon.

Download files

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

Source Distribution

ontogram-0.1.0.post1.tar.gz (33.9 kB view hashes)

Uploaded source

Built Distribution

ontogram-0.1.0.post1-py3-none-any.whl (47.4 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page