Publish your vocabulary on the web with NGINX

by Nicolas Seydoux


Overview

The NGINX server redirects the user request either to the vocabulary, its documentation or the endpoint

The schema above is an overview of the system this article aims at setting up: the user can, on the same URI, access either the ontology or its documentation (let's face it, no human enjoys reading OWL/XML), and on another URI access a SPARQL endpoint.

Prerequisite

This tutorial is dedicated to Linux users, but it can be adapted to other OS.

Install NGinx

sudo apt-get install nginx

The config files are situated in /etc/nginx/conf.d/, and they are imported by the root config file, /etc/nginx/nginx.conf.

Good practices of vocabulary publication

I adapt here technologies in order to enforce good practices described here. This article proposes 5 rules to vocabulary publication:

  • Publish your vocabulary on the Web at a stable URI
  • Provide human-readable documentation and basic metadata such as creator, publisher, date of creation, last modification, version number
  • Provide labels and descriptions, if possible in several languages, to make your vocabulary usable in multiple linguistic scopes
  • Make your vocabulary available via its namespace URI, both as a formal file and human-readable documentation, using content negotiation
  • Link to other vocabularies by re-using elements rather than re-inventing

If you want your vocabulary to be available on the LOV, it must comply with some recommandations, especially particular metadata and the existance of a documentation.

Publishing your vocabulary

Generate the documentation

The documentation of an ontology is a human-readable version of the vocabulary, with full text descriptions in good-looking HTML.

Multiple tools exist to generate such documentation directly from the sources of the ontology:

I use (and recommand) LODE, that you can get on github if the webservice is down.

Content negociation

The ontology and its documentation should be accessible on the same URI, so that the access to either of them is transparent

Nullam ex metus, euismod non lacus vel, accumsan sagittis lectus. Pellentesque fringilla faucibus elit, eget ultricies nisl fermentum id. Vivamus ultricies odio nec orci ultricies porttitor. Proin ac tincidunt augue, ac suscipit nisi. Proin rutrum tincidunt elit a laoreet. Integer nunc lorem, aliquam at ultrices laoreet, auctor sed tellus. Sed mollis turpis justo, ac facilisis erat tristique at. Nunc posuere quam et neque bibendum interdum. Nulla tempor lacinia nibh, vehicula sagittis diam tempor at. Donec luctus orci ligula, quis pretium nulla posuere eu. Duis rutrum magna at dictum consectetur. Vivamus at feugiat eros. Aenean purus odio, finibus eu est ac, viverra tincidunt felis.



Useful links

Elsewhere on the web