Reasonable Ontology Templates (OTTR)

Quick links

Reasonable Ontology Templates, OTTRs or Templates for short, are OWL ontology macros capable of representing ontology design patterns and closely integrating their use into ontology engineering. A template is itself an RDF graph or an OWL ontology, annotated with a special purpose OWL vocabulary. This allows templates to be edited, debugged, published, identified, instantiated, composed, used as queries and bulk transformations, and maintained; all leveraging existing W3C standards, best practices and tools.

An OTTR consists of a head and a body. The head specifies a tabular input format in the form of a list of parameters, and the body contains a set of RDF triples or OWL axioms, which may us the parameters of the head as ordinary RDF resources. A template is instantiated by substituting the parameters with arguments. Templates can be nested; a template may contain an instance to a different template in its body and pass parameter values to it. Such complex templates can be expanded by recursively replacing the template instance with the body it represents.

OTTR vocabulary

OTTRs are represented using RDF graphs or OWL ontologies, by marking the RDF graph as containing a template and marking RDF resources as parameters. This is done using a special purpose OWL vocabulary, the OTTR ontology.

Multiple formats

A template can be seen as a mapping between a tabular format (the template head) to the a graph or ontology structure (the body). We can exploit this by representing these formats and transformations between them, in both directions, using existing W3C standards.

The list of currently available formats are found in the top right menu on the information pages for each individual template, see e.g., partlength.

Library of Reasonable Ontology Templates

The list of available OTTRs hosted at this site can be browsed in the templates library.

Templates are organised into different repositories according to status and use.

You can share templates in the draft repository, an open git repository (you will need to create a (free) account at GitLab to be able to push to the repository).


A prototype implementation that can interpret the Templates vocabulary, perform the necessary substitution and expansion, and serve templates on various formats, is available as a set of Java servlets hosted at (This specific link provides no additional information, but in fact redirects to this page). This implementation generates the information page for a template, e.g., partlength and the other formats found on this page, by reading the templates published at the above repositories.

In fact, the implementation can read any template available online. The link to the template must be specified in the URI with the URI parameter ?tpl, e.g., Feel free to use the service to test your own templates.

The implementation is available as open source under an LGPL licence at Releases and their binaries are available at

The binary provides a command line interface. Use the -lib option to provide a set of templates that will be preloaded; usually, the template reference IRI specifies the location of the template and is used by instances of the template to fetch the template specification. However, preloading templates shortcuts this, allowing templates that have "non-local" IRI to be accessed locally.

usage: lutra -expand|stottr|tabottr [-in <file|IRI>] [-out <file>] [-lib <path> [-libExt <ext,..>]] [(flags)]
 -expand         Enable expand mode.
 -in <arg>       Path to optional input file or IRI. Defaults to stdin.
 -lib <arg>      Path to optional local template library root, read
 -libExt <arg>   Comma-separated list of template file extensions to be
                 read from 'lib' (default: owl,rdf,ttl).
 -noCache        Disable caching.
 -noCheck        Disable various validation services, gives faster
 -noOWLOutput    Disable OWL API rendering of output.
 -out <arg>      Path to optional output file. Defaults to stout.
 -quiet          Disable logging.
 -stottr         Enable stottr mode.
 -tabottr        Enable tabottr mode.

Running the following command:

java -jar lutra.jar -expand -in

returns and output (to stdout) the expanded template located at the given address.

Demos and Tuturials


Martin G. Skjæveland, Henrik Forssell, Johan Wilhelm Klüwer, Daniel P. Lupp, Evgenij Thorstensen and Arild Waaler. Pattern-Based Ontology Design and Instantiation with Reasonable Ontology Templates. Research paper presented at 8th Workshop on Ontology Design and Patterns - WOP2017. 2017. Slides.

Martin G. Skjæveland, Henrik Forssell, Johan W. Klüwer, Daniel Lupp, Evgenij Thorstensen and Arild Waaler. Reasonable Ontology Templates: APIs for OWL Poster paper presented at International Semantic Web Conference (ISWC 2017). 2017. Poster.

Henrik Forssell, Daniel P. Lupp, Martin G. Skjæveland, and Evgenij Thorstensen. Reasonable Macros for Ontology Construction and Maintenance. In Proceedings of the 30th International Workshop on Description Logics, Montpellier, France, July 18-21, 2017. 2017. [bibtex]