Skip to content

Creating Semantic models in OWL format

This section shows how to create Semantic models using Web protege. Web protege is open source tool which provides user interface to create ontology.
Currently, SDI supports Owl file which is created in Web protege. For the sample Owl file refer here.

  1. Login to Web protege or create a new user.
  2. Click "Create New Project" from the left navigation. In the pop-up window, enter the required fields and click "Create New Project" button in the popup. Create New Project
  3. Select the project created in the previous step. Click "Project" and select "Settings".
    Settings
  4. In the Project Settings page, select "New Entity Settings". Change the following field values:
    • IRI Prefix to "ontology#"
    • IRI Suffix to "Supplied name".
      Click “Apply”.
      New entity settings
  5. Click "Classes" and then click "Create". Enter the class name in the "Create classes" window. Click “Create” to create the class.
    Create class

    Note

    You can create multiple classes within same project. When Owl file is generated and uploaded into SDI, SDI assumes all these classes to be part of the same namespace (or domain) as mentioned while uploading Owl file.

  6. In Properties tab, select “Data Properties” and click "Create". Populate the required fields in the popup.
    Create data properties

    Note

    Web protege does not allow same name for two properties within a Project. To name a property, add class name to the property followed by a dot and property name. For example, if you need to create a property "Prop_1" in class "Class_1", then the name of the property will be "Class_1.Prop_1".
    Create data properties note

  7. Add Annotations in the following ways:

    • For class: Click “Classes” and select the created class. Under Annotations, add "rdfs:type" as the property and "class" as its value. class annotations

    Note

    • For schema, it is required to create a class and specify schema as the value for its rdfs:type annotation.
      class annotations schema
    • For schema properties, the value of rdfs:type annotation will be column and datatype such as String, Integer, etc.
    • For Property: Click “Properties” and then in the “Data Properties" tab, select the created property. Add the following annotations:
      • rdfs:type with value as attribute
      • datatype with value as property datatype such as String, Integer, etc
      • relationType with value as one-to-one, one-to-many and many-to-one property annotations
  8. Click “Properties” and then “Data Properties”. Select the created property and under "Domain", add the name of the class to which this property belongs.
    Each property will belong to a class or schema. This relationship is depicted by Domain property.
    property domain

  9. To create relationships between properties, click "Add tab" on the rightmost corner of the page and select "OWL Properties".
    A screen appears with properties on the left and editor window on the right. Select the property from left window for which relation is to be created and in the right pane. Enter EquivalentTo: under the existing property SubPropertyOf:. Further, mention the name of the property with which edge is to be created under EquivalentTo:.

    Note

    • When schema property is added in “EquivalentTo:” section for selected business property, then “Mapping” edge type is assumed in SDI. It is same in vice versa scenario.
    • No edge type relation is assumed when schema property is added in “EquivalentTo:” section for selected schema property.

    Caution

    Web protege input and retrieve is case-sensitive.

  10. Click "Home" button on the left corner of the page. Select the required project and click "Download". Select format as RDF/XML.
    The ontology will be downloaded as a zip containing the root-ontology.owl file. Once Owl file is downloaded, SDI provides API to upload API: Base URI /ontologyJobs.
    Sample Ontology for example of Air Quality App is as below:

Sample
    <?xml version="1.0"?>
        <rdf:RDF xmlns="http://webprotege.stanford.edu/project/CkxnlcVqrwHX9cc83m2uY5#"
            xml:base="http://webprotege.stanford.edu/project/CkxnlcVqrwHX9cc83m2uY5"
            xmlns:owl="http://www.w3.org/2002/07/owl#"
            xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
            xmlns:xml="http://www.w3.org/XML/1998/namespace"
            xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
            xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
            xmlns:ontology="ontology#">
            <owl:Ontology rdf:about="http://webprotege.stanford.edu/project/CkxnlcVqrwHX9cc83m2uY5"/>
          <!-- 
            ///////////////////////////////////////////////////////////////////////////////////////
            //
            // Annotation properties
            //
            ///////////////////////////////////////////////////////////////////////////////////////
            -->
          <!-- http://www.w3.org/2000/01/rdf-schema#type -->

            <owl:AnnotationProperty rdf:about="http://www.w3.org/2000/01/rdf-schema#type">
                <rdfs:label>type</rdfs:label>
            </owl:AnnotationProperty>
          <!-- ontology#datatype -->

            <owl:AnnotationProperty rdf:about="ontology#datatype">
                <rdfs:label>datatype</rdfs:label>
            </owl:AnnotationProperty>
          <!-- 
            ///////////////////////////////////////////////////////////////////////////////////////
            //
            // Data properties
            //
            ///////////////////////////////////////////////////////////////////////////////////////
          -->
          <!-- ontology#AirQualityIndex.Value -->

            <owl:DatatypeProperty rdf:about="ontology#AirQualityIndex.Value">
            <owl:equivalentProperty rdf:resource="ontology#airnow_aqi.value"/>
                <rdfs:subPropertyOf rdf:resource="http://www.w3.org/2002/07/owl#topDataProperty"/>
                <rdfs:domain rdf:resource="ontology#AirQualityIndex"/>
                <rdfs:label>AirQualityIndex.Value</rdfs:label>
                <rdfs:type rdf:datatype="http://www.w3.org/2001/XMLSchema#string">attribute</rdfs:type>
                <ontology:datatype rdf:datatype="http://www.w3.org/2001/XMLSchema#string">String</ontology:datatype>
            </owl:DatatypeProperty>
            <!-- ontology#AirQualityIndex.parameterName -->

            <owl:DatatypeProperty rdf:about="ontology#AirQualityIndex.parameterName">
          <owl:equivalentProperty rdf:resource="ontology#airnow_aqi.parametername"/>
                <rdfs:subPropertyOf rdf:resource="http://www.w3.org/2002/07/owl#topDataProperty"/>
                <rdfs:domain rdf:resource="ontology#AirQualityIndex"/>
                <rdfs:label>AirQualityIndex.parameterName</rdfs:label>
                <rdfs:type rdf:datatype="http://www.w3.org/2001/XMLSchema#string">attribute</rdfs:type>
                <ontology:datatype rdf:datatype="http://www.w3.org/2001/XMLSchema#string">String</ontology:datatype>
            </owl:DatatypeProperty>
            <!-- ontology#AirQualityIndex.siteName -->

            <owl:DatatypeProperty rdf:about="ontology#AirQualityIndex.siteName">
          <owl:equivalentProperty rdf:resource="ontology#airnow_aqi.sitename"/>
                <rdfs:subPropertyOf rdf:resource="http://www.w3.org/2002/07/owl#topDataProperty"/>
                <rdfs:domain rdf:resource="ontology#AirQualityIndex"/>
                <rdfs:label>AirQualityIndex.siteName</rdfs:label>
                <rdfs:type rdf:datatype="http://www.w3.org/2001/XMLSchema#string">attribute</rdfs:type>
                <ontology:datatype rdf:datatype="http://www.w3.org/2001/XMLSchema#string">String</ontology:datatype>
            </owl:DatatypeProperty>
            <!-- ontology#Monitoring.latitude -->

            <owl:DatatypeProperty rdf:about="ontology#Monitoring.latitude">
          <owl:equivalentProperty rdf:resource="ontology#airnow_monitoringsites.latitude"/>
                <rdfs:subPropertyOf rdf:resource="http://www.w3.org/2002/07/owl#topDataProperty"/>
                <rdfs:domain rdf:resource="ontology#Monitoring"/>
                <rdfs:label>Monitoring.latitude</rdfs:label>
                <rdfs:type rdf:datatype="http://www.w3.org/2001/XMLSchema#string">attribute</rdfs:type>
                <ontology:datatype rdf:datatype="http://www.w3.org/2001/XMLSchema#string">String</ontology:datatype>
            </owl:DatatypeProperty>
            <!-- ontology#Monitoring.longitude -->

            <owl:DatatypeProperty rdf:about="ontology#Monitoring.longitude">
          <owl:equivalentProperty rdf:resource="ontology#airnow_monitoringsites.longitude"/>
                <rdfs:subPropertyOf rdf:resource="http://www.w3.org/2002/07/owl#topDataProperty"/>
                <rdfs:domain rdf:resource="ontology#Monitoring"/>
                <rdfs:label>Monitoring.longitude</rdfs:label>
                <rdfs:type rdf:datatype="http://www.w3.org/2001/XMLSchema#string">attribute</rdfs:type>
                <ontology:datatype rdf:datatype="http://www.w3.org/2001/XMLSchema#string">String</ontology:datatype>
            </owl:DatatypeProperty>
            <!-- ontology#Monitoring.siteName -->

            <owl:DatatypeProperty rdf:about="ontology#Monitoring.siteName">
                <rdfs:subPropertyOf rdf:resource="http://www.w3.org/2002/07/owl#topDataProperty"/>
                <rdfs:domain rdf:resource="ontology#Monitoring"/>
                <rdfs:label>Monitoring.siteName</rdfs:label>
                <rdfs:type rdf:datatype="http://www.w3.org/2001/XMLSchema#string">attribute</rdfs:type>
                <ontology:datatype rdf:datatype="http://www.w3.org/2001/XMLSchema#string">String</ontology:datatype>
            </owl:DatatypeProperty>
            <!-- ontology#airnow_aqi.AQSID -->

            <owl:DatatypeProperty rdf:about="ontology#airnow_aqi.AQSID">
                <rdfs:subPropertyOf rdf:resource="http://www.w3.org/2002/07/owl#topDataProperty"/>
                <rdfs:domain rdf:resource="ontology#airnow_aqi"/>
                <rdfs:label>airnow_aqi.AQSID</rdfs:label>
                <rdfs:type rdf:datatype="http://www.w3.org/2001/XMLSchema#string">column</rdfs:type>
                <ontology:datatype rdf:datatype="http://www.w3.org/2001/XMLSchema#string">String</ontology:datatype>
            </owl:DatatypeProperty>
            <!-- ontology#airnow_aqi.date -->

            <owl:DatatypeProperty rdf:about="ontology#airnow_aqi.date">
                <rdfs:subPropertyOf rdf:resource="http://www.w3.org/2002/07/owl#topDataProperty"/>
                <rdfs:domain rdf:resource="ontology#airnow_aqi"/>
                <rdfs:label>airnow_aqi.date</rdfs:label>
                <rdfs:type rdf:datatype="http://www.w3.org/2001/XMLSchema#string">column</rdfs:type>
                <ontology:datatype rdf:datatype="http://www.w3.org/2001/XMLSchema#string">String</ontology:datatype>
            </owl:DatatypeProperty>
            <!-- ontology#airnow_aqi.parametername -->

            <owl:DatatypeProperty rdf:about="ontology#airnow_aqi.parametername">
                <rdfs:subPropertyOf rdf:resource="http://www.w3.org/2002/07/owl#topDataProperty"/>
                <rdfs:domain rdf:resource="ontology#airnow_aqi"/>
                <rdfs:label>airnow_aqi.parametername</rdfs:label>
                <rdfs:type rdf:datatype="http://www.w3.org/2001/XMLSchema#string">column</rdfs:type>
                <ontology:datatype rdf:datatype="http://www.w3.org/2001/XMLSchema#string">String</ontology:datatype>
            </owl:DatatypeProperty>
            <!-- ontology#airnow_aqi.sitename -->

            <owl:DatatypeProperty rdf:about="ontology#airnow_aqi.sitename">
                <rdfs:subPropertyOf rdf:resource="http://www.w3.org/2002/07/owl#topDataProperty"/>
                <rdfs:domain rdf:resource="ontology#airnow_aqi"/>
                <rdfs:label>airnow_aqi.sitename</rdfs:label>
                <rdfs:type rdf:datatype="http://www.w3.org/2001/XMLSchema#string">column</rdfs:type>
                <ontology:datatype rdf:datatype="http://www.w3.org/2001/XMLSchema#string">String</ontology:datatype>
            </owl:DatatypeProperty>
            <!-- ontology#airnow_aqi.time -->

            <owl:DatatypeProperty rdf:about="ontology#airnow_aqi.time">
                <rdfs:subPropertyOf rdf:resource="http://www.w3.org/2002/07/owl#topDataProperty"/>
                <rdfs:domain rdf:resource="ontology#airnow_aqi"/>
                <rdfs:label>airnow_aqi.time</rdfs:label>
                <rdfs:type rdf:datatype="http://www.w3.org/2001/XMLSchema#string">column</rdfs:type>
                <ontology:datatype rdf:datatype="http://www.w3.org/2001/XMLSchema#string">String</ontology:datatype>
            </owl:DatatypeProperty>
            <!-- ontology#airnow_aqi.value -->

            <owl:DatatypeProperty rdf:about="ontology#airnow_aqi.value">
                <rdfs:subPropertyOf rdf:resource="http://www.w3.org/2002/07/owl#topDataProperty"/>
                <rdfs:domain rdf:resource="ontology#airnow_aqi"/>
                <rdfs:label>airnow_aqi.value</rdfs:label>
                <rdfs:type rdf:datatype="http://www.w3.org/2001/XMLSchema#string">column</rdfs:type>
                <ontology:datatype rdf:datatype="http://www.w3.org/2001/XMLSchema#string">String</ontology:datatype>
            </owl:DatatypeProperty>
            <!-- ontology#airnow_monitoringsites.AQSID -->

            <owl:DatatypeProperty rdf:about="ontology#airnow_monitoringsites.AQSID">
                <rdfs:subPropertyOf rdf:resource="http://www.w3.org/2002/07/owl#topDataProperty"/>
                <rdfs:domain rdf:resource="ontology#airnow_monitoringsites"/>
                <rdfs:label>airnow_monitoringsites.AQSID</rdfs:label>
                <rdfs:type rdf:datatype="http://www.w3.org/2001/XMLSchema#string">column</rdfs:type>
                <ontology:datatype rdf:datatype="http://www.w3.org/2001/XMLSchema#string">String</ontology:datatype>
            </owl:DatatypeProperty>
            <!-- ontology#airnow_monitoringsites.latitude -->

            <owl:DatatypeProperty rdf:about="ontology#airnow_monitoringsites.latitude">
                <rdfs:subPropertyOf rdf:resource="http://www.w3.org/2002/07/owl#topDataProperty"/>
                <rdfs:domain rdf:resource="ontology#airnow_monitoringsites"/>
                <rdfs:label>airnow_monitoringsites.latitude</rdfs:label>
                <rdfs:type rdf:datatype="http://www.w3.org/2001/XMLSchema#string">column</rdfs:type>
                <ontology:datatype rdf:datatype="http://www.w3.org/2001/XMLSchema#string">String</ontology:datatype>
            </owl:DatatypeProperty>
            <!-- ontology#airnow_monitoringsites.longitude -->

            <owl:DatatypeProperty rdf:about="ontology#airnow_monitoringsites.longitude">
                <rdfs:subPropertyOf rdf:resource="http://www.w3.org/2002/07/owl#topDataProperty"/>
                <rdfs:domain rdf:resource="ontology#airnow_monitoringsites"/>
                <rdfs:label>airnow_monitoringsites.longitude</rdfs:label>
                <rdfs:type rdf:datatype="http://www.w3.org/2001/XMLSchema#string">column</rdfs:type>
                <ontology:datatype rdf:datatype="http://www.w3.org/2001/XMLSchema#string">String</ontology:datatype>
            </owl:DatatypeProperty>
            <!-- ontology#airnow_monitoringsites.parametername -->

            <owl:DatatypeProperty rdf:about="ontology#airnow_monitoringsites.parametername">
                <rdfs:subPropertyOf rdf:resource="http://www.w3.org/2002/07/owl#topDataProperty"/>
                <rdfs:domain rdf:resource="ontology#airnow_monitoringsites"/>
                <rdfs:label>airnow_monitoringsites.parametername</rdfs:label>
                <rdfs:type rdf:datatype="http://www.w3.org/2001/XMLSchema#string">column</rdfs:type>
                <ontology:datatype rdf:datatype="http://www.w3.org/2001/XMLSchema#string">String</ontology:datatype>
            </owl:DatatypeProperty>
            <!-- ontology#airnow_monitoringsites.sitecode -->

            <owl:DatatypeProperty rdf:about="ontology#airnow_monitoringsites.sitecode">
                <rdfs:subPropertyOf rdf:resource="http://www.w3.org/2002/07/owl#topDataProperty"/>
                <rdfs:domain rdf:resource="ontology#airnow_monitoringsites"/>
                <rdfs:label>airnow_monitoringsites.sitecode</rdfs:label>
                <rdfs:type rdf:datatype="http://www.w3.org/2001/XMLSchema#string">column</rdfs:type>
                <ontology:datatype rdf:datatype="http://www.w3.org/2001/XMLSchema#string">String</ontology:datatype>
            </owl:DatatypeProperty>
          <!-- 
            ///////////////////////////////////////////////////////////////////////////////////////
            //
            // Classes
            //
            ///////////////////////////////////////////////////////////////////////////////////////
            -->
          <!-- ontology#AirQualityIndex -->

            <owl:Class rdf:about="ontology#AirQualityIndex">
                <rdfs:label>AirQualityIndex</rdfs:label>
                <rdfs:type rdf:datatype="http://www.w3.org/2001/XMLSchema#string">class</rdfs:type>
            </owl:Class>
            <!-- ontology#Monitoring -->

            <owl:Class rdf:about="ontology#Monitoring">
                <rdfs:label>Monitoring</rdfs:label>
                <rdfs:type rdf:datatype="http://www.w3.org/2001/XMLSchema#string">class</rdfs:type>
            </owl:Class>
            <!-- ontology#airnow_aqi -->

            <owl:Class rdf:about="ontology#airnow_aqi">
                <rdfs:label>airnow_aqi</rdfs:label>
                <rdfs:type rdf:datatype="http://www.w3.org/2001/XMLSchema#string">schema</rdfs:type>
            </owl:Class>
            <!-- ontology#airnow_monitoringsites -->

            <owl:Class rdf:about="ontology#airnow_monitoringsites">
                <rdfs:label>airnow_monitoringsites</rdfs:label>
                <rdfs:type rdf:datatype="http://www.w3.org/2001/XMLSchema#string">schema</rdfs:type>
            </owl:Class>
        </rdf:RDF>

        <!-- Generated by the OWL API (version 4.5.10) https://github.com/owlcs/owlapi -->

Any questions left?

Ask the community


Except where otherwise noted, content on this site is licensed under the MindSphere Development License Agreement.


Last update: April 1, 2022