Using ontologies

You will need to define the class and relations for the properties in your data. The easiest way is to find classes and properties in existing model (aka. ontologies). Some properties are standard like rdf:type and rdfs:label, but for more specific concepts the best is to find an existing data model matching your model.

Reuse existing ontologies ♻️#

A number of ontologies have already been defined for different use-cases and domain. Re-using existing ontologies is faster as you don't need to build the ontology yourself, and it improves the interoperability of your data.

Ontologies repositories#

Search for relevant existing models in ontology repositories:

The BioPortal Recommender and Search services are efficient to look for concepts in most existing biomedical ontologies.

Popular ontologies#

Define the schema#

In the case you are reusing existing ontologies the best is to define the schema your data will follow using SHACL shapes, or ShEx expressions. This will allow you to validate the generated data, and other users will be able to quickly understand your data.

Here are a few examples of tools and methods to generate SHACL or ShEx shapes:

Ontology design 🎨#

If you don't find an ontology that fits, or if you need to edit an ontology, you can check at the following tools:

Protégé#

You can use the Protégé ontology editor to build your ontology, using a tree view

VocBench#

VocBench is a web-based, multilingual, collaborative development platform for managing OWL ontologies, SKOS(/XL) thesauri, and generic RDF datasets.

Gra.fo#

Gra.fo is a commercial product, but use it for free to build simple RDFS/OWL ontologies with a diagram view and collaboration features.

Chowlk#

Chowlk is a web service that automatically generates the OWL code from your Ontology Diagram made with diagrams.net. You will need to follow the instructions to define the diagrams block following a specific format.

OwlReady2#

OwlReady2 is a Python library to work with OWL ontologies. It helps you build OWL ontologies with Python code and Jupyter notebooks.

TopBraid Composer#

Now with free edition: https://www.topquadrant.com/products/topbraid-composer/

StarDog#

The StarDog triplestore includes an ontology editor, but it requires a license.

Resolve prefixes#

http://prefix.cc is a handy service to resolve prefixes.

E.g. http://prefix.cc/bl

Publish the ontology 📰#

The easiest place to publish your ontology is in a GitHub repository.

Publish documentation#

2 options are available:

  • Widoco: generate ontology documentation following the W3C style
  • Ontospy: provide multiple choices for ontology documentation (more user-friendly for larger ontologies)

See this example workflow implementing Widoco and Ontospy: https://github.com/vemonet/semanticscience/blob/master/.github/workflows/generate-docs.yml

It allows to automatically generate and publish documentation for your ontology using GitHub Actions and GitHub Pages:

  1. The ontology is published in a GitHub repository, in our case in ontology/sio.owl

  2. The GitHub Actions workflow is triggered when there is a change in the ontology file.

  3. The GitHub Actions workflow runs Ontospy, or Widoco (yours to choose), given the latest committed ontology file (ontology/sio.owl in this example), which generates the HTML documentation in the gh-pages branch, in a different folder for each documentation type.

  4. The gh-pages branch is published as a GitHub Page

In this example we have a simple index.html file to let the user choose the documentation types he wants to access

Feel free to adapt this GitHub Actions workflow

Use persistent identifier#

We recommend to use the w3id.org system, as it allows any GitHub user to define and reserve your persistent namespace for free in a few minutes:

  1. Fork the w3id.org repository: https://github.com/perma-id/w3id.org
  2. Create a folder with your namespace name (e.g. my-onto)
  3. Add a .htaccess file with the redirection to your ontology (and a README.md file shortly explaining the purpose of this namespace)
  4. Send a pull request to the https://github.com/perma-id/w3id.org repository. It usually takes between a few hours and a few days to be accepted.

Examples:

The persistent identifiers can be easily modified later if necessary, you will just need to send a new pull request with the changes.

Add it to an ontology repository#

Depends on the ontology domain (see above).

Last updated on by Vincent Emonet