Back to top
Vastuu Group

Ontology Versioning Guide

Last updated: March 16, 2021
|
Reading time: 4 min

Tags: Ontology, Ontology Viewer

This guide explains Ontology versioning approach, so Platform of Trust customers and other interested groups can utilize Ontology in a secure way to avoid having broken standards by Ontology versions update.

Editing process

The following section describes the standard process on how ontology incrementation should be developed from start to end.

1. Make a fork of Platform of Trust ontology GitHub repository

Use GitHub documentation if needed and particular Fork a repo guide. Windows or macOS users might also prefer using GitHub Desktop after creating a fork to simplify the process. Ontology GitHub repository can be accessed here.

2. Download and install Protégé ontology editor

Please use installation instructions to install the software.

3. Edit the ontology

Open /{Version}/Ontology/pot.owl file with Protégé editor. Where {Version} is the required version, for example v1.
Please refer Adding DataContext section on adding data product contexts to ontology.

4. Save the file and push it as PR in GitHub

At this point, you should be ready to push your modified ontology as PR for PoT ontology team review.

Adding DataContext

Follow next steps to configure DataContext

1. Add new subclass for DataContext class. Please use Pascal case (aka Upper Camel Case) for class names.

protege-datacontext-subclass.png

2. Add classes you want to use in your translator responses by adding annotation property supportedClass with respective class as value.

proteggeg-annotation-property.png

3. Add ontologies URLs you want to support and abbreviate names for them using supportedOntology annotation property.
First, add ontology IRI

protege-ontology-iri.png

As second step specify ontology abbreviation:

protege-ontology-abbreviation.png

End result should look like this:

protege-ontology-abbreviation-endresult.png

4. After you done with editing, push it to your fork and create PR request for review by PoT ontology team

Usage examples

In this section, we review an example of data context usage in actual responses. Let's assume we return data from a sensor that provides different measures: air temperature, CO2 level, and also room presence/occupancy at the same time. Also, we use external Units of measurement ontology

{
  "@context": "https://standards.oftrust.net/v1/DataContext/SampleDataContext/",
  "items": [
    {
      "@id": "test",
      "dataProductOutput": [
        {
          "@type": "MeasureAirTemperatureCelciusDegree",
          "dateTimeOfMeasure": "2020-03-04T10:41:41",
          "outputValue": "21",
          "unitOfMeasure": "UO:0000027"
        },
        {
          "@type": "MeasureAirCO2LevelPPM",
          "dateTimeOfMeasure": "2020-03-03T10:41:41",
          "outputValue": "21",
          "unitOfMeasure": "UO:0000169"
        },
        {
          "@type": "MeasurePresence",
          "dateTimeOfMeasure": "2020-03-03T10:41:41",
          "outputValue": "True"
        },
        {
          "@type": "MeasureOccupancyCount",
          "dateTimeOfMeasure": "2020-03-03T10:41:41",
          "outputValue": "3",
          "unitOfMeasure": "UO:0000189"
        }
      ]
    }
  ]
}

Summary

In this guide, we have shown how you can create Data Context using Protégé ontology editor and contribute to Platform of Trust Ontology incrementation process. We also have described the basic steps you need to follow for using Protégé for developing a new Data Context. Finally, we have demonstrated an example of data context usage in actual API Response.

Checkout Platform of Trust Ontology Viewer

Ontology Viewer

Ready to explore more?

Try Platform Sandbox

Improvement Suggestions? or a New Guide?

Tell us in GitHub