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
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
    <?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.