Skip to main content

A Python package for creating ontology documentation

Project description


Ontodocs is a Python command line application aimed at facilitating the creation of documentation for ontologies encoded in RDF/OWL.



That's the kind of documentation OntoDocs can generate out-of-the-box. For even more examples, take a look at this page.


pip install ontodocs -U


Ontodocs allows to generate documentation for an RDF vocabulary, using visualization algorithms that create simple HTML pages, Markdown files, or more complex javascript interactive charts based on D3.js.

> Ontodocs -h
Usage: ontodocs [OPTIONS] [SOURCE]...

  Ontodocs allows to create  documentation for ontologies encoded in


  > ontodocs --theme random -o

  ==> generates html docs for the SKOS ontology and save it to your desktop

  -o, --outputpath TEXT  Output path (default: home folder).
  -t, --title TEXT       Title for the visualization (default=graph uri).
  --theme TEXT           CSS Theme for the html-complex visualization
                         (random=use a random theme).
  --showthemes           Show the available CSS theme choices.
  -v, --verbose          Verbose mode.
  -h, --help             Show this message and exit.

The library is not really meant to be used programmatically, but I'm sure there are a few constructs in there which can be reused.

In a nutshell, all visualizations inherit from a VizFactory class that abstracts away the most common operations involved in rendering a dataviz.

This is how you would invoke a visualization from a script:

import ontospy
from ontodocs.viz.viz_html_single import *

g = ontospy.Ontospy("")

v = HTMLVisualizer(g) # => instantiate the visualization object # => render visualization. You can pass an 'output_path' parameter too
v.preview() # => open in browser


Ontodocs relies on the OntoSpy library, which itself relies on Rdflib.

note: the functionalities of Ontodocs used to be part of OntoSpy until v1.8.

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

ontodocs-1.2.2.tar.gz (3.6 MB view hashes)

Uploaded source

Built Distribution

ontodocs-1.2.2-py2.py3-none-any.whl (3.8 MB view hashes)

Uploaded py2 py3

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