Clone wiki

specgen / Home

WARNING: we strongly encourage the usage of the latest integrated version of SpecGen, available at:

SpecGen v5 is ontology specification generator tool. It's written in Python using Redland RDF library and licensed under the MIT license.

Originally developed by other (read bellow), continued in Morfeo for fulfilling some need of SIOC, MyMobileWeb and others project to generate specifications for the ontologies developed.

Previous versions of SpecGen

This version 5 is a hack made by Sergio Fernández (CTIC Foundation) over the previous versions of the script:


There are some changes in this version:

  • added many blanknodes verifications
  • dynamically namespaces and base uri
  • many accessibility improvements on the generated markup
  • soft-coded all variables
  • automatically save
  • many refactorings
  • implemented the capability to extract complex ranges/domains
  • added a Makefile to install the script
  • optional documentation of ontology instances
  • ...

Source repository

$ hg clone


Available at the issues tab.


We are not releasing any concrete version of the tools. So you should get it directly from the development repository.


  • Python interpreter (python>=2.4)
  • Python bindings for the Redland RDF library (python-librdf>=1.0)


It uses a very simple template engine. You can use it over any HTML template. The template only must have two sections with '%s' where SpecGen will write the information extracted from the ontology.

There are some templates available as example:


The first thing that you need to make is customize a template, adding of information relevant for the lecture of the specification.

Basic usage

You can run SpecGen without install it directly from the code:

$ python ontology prefix template destination [flags]

Available flags:

  • -i : add instances on the specification (disabled by default)

Usage example:

$ python example.owl ex template.html example.html -i


But of course you can also install SpecGen on you computer running the Makefile provided:

$ sudo make install

Therefore it'd be easier to run it from any location or by any user without using a long path:

$ specgen example.owl ex template.html example.html

Obviously you can uninstall it whatever you want:

$ sudo make uninstall

Related projects

Ontologies using SpecGen


Please, send any comment directly to the developer.