Skip to main content

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.

generated ontology diagram

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


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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

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

Hashes for ontogram-0.1.0.post1.tar.gz
Algorithm Hash digest
SHA256 9374e41559a4a8097474bb168c1db1289186e63b8d2df98e49895d248c8fac1f
MD5 00c9f3018f11cfadd54330c2492c4e77
BLAKE2b-256 42541084222979c4f038df0054490ec7447ddc876409e5de74352fc2f4645ef9

See more details on using hashes here.

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

Hashes for ontogram-0.1.0.post1-py3-none-any.whl
Algorithm Hash digest
SHA256 6af7ce406cfe609b28c1c477febd2a5eed23811f0dbfff10bc97561b57a1cfef
MD5 b0bdb65205904eebbe45360604797fea
BLAKE2b-256 e62c28694247b98e6613dca6795a6354a4fd1af246c08a8f9b49e58fd3ae9c31

See more details on using hashes here.

Provenance

Supported by

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