Skip to content

Creating Semantic Models using Semantic Data Interconnect (SDI) APIs

SDI Semantic Service provides end-to-end capability to import/create, retrieve, update or delete the entire ontological models. Currently, this is done with set of APIs that allow users to perform different actions on nodes and edges. There are three major approaches to create Semantic models in SDI:

  • Import Semantic Model: When the Data Analyst/Semantic modeler has created Semantic model, SDI provides the ability to optionally import the Semantic model as a starting point. SDI supports Owl file format to import Semantic model. Owl file can be accessed by REST API.
  • Infer Semantic Model: SDI leverages extracted schema to infer correlation of data from multiple systems and provides a recommended Semantic model. SDI also provides the initial inferred Semantic model on the basis of schemas extracted. User can provide list of schemas to infer Semantic model. This Inferred Semantic model can then be updated further by Data Analysts/Domain experts according to domain specific relationships.
    This ability to infer the Semantic model reduces the investment in skillset, time and resources needed by significant amount and provides an extremely value added starting point for the Data Analysts/Domain experts.

For SDI to get inferred Semantic model, atleast two schemas should be provided. Once schemas are provided, SDI provides an initial recommended Semantic model based on request. This input can then be used to create a complete Semantic model.

SDI defined Semantic Model

In most of the cases that requires relations to be established between attributes and data points, SDI Semantic model framework can be used to create models on basis of global defined types of nodes and edges. For more information on Semantic Model refer SDI Semantic Modelling Service.

Prerequisites

  • Semantic Data Interconnect provisioned to the tenant.
  • A SDI role: either SDI admin or SDI semantic user role. Or, technical user credentials.

Example scenario

Every Semantic model is associated with a domain. For example, an automotive manufacturer has design, manufacturing, supply chain, marketing & sales, etc. as departments. Every department has its own business terminologies and therefore can be attributed as a domain.
In the sample ontology below, the AirQuality App Semantic model provides an isolation layer to data analysts or domain experts from rest of the schemas in a tenant and is treated as a separate domain. In SDI, domains are represented by namespace.
Every namespace then consists of further classes and business properties. From the example of Airquality App which wants to create a dashboard about air quality index in North America, Air quality and Monitoring Stations are two classes considered. Air quality is defined by the properties: sitename, Quality parameters (types of air quality parameters) and value. Similarly, Monitoring Stations has properties: sitename, longitude, latitude.
Every business property is then mapped to schema properties or columns. You can only define or attach schemas in a namespace which belongs to a tenant in SDI. You can request to get different schemas using POST Method with URI /searchSchemas.
The Semantic modeler or data analyst user can then can retrieve schemas and start mapping schemas to business properties. The relation type PropertyRelations is used to define relationships between business properties. Currently, it supports two types of property relations, one-to-one and one-to-many types.

Note

PropertyRelations is not used currently in query transformation, but will be used in future where actual queries created will consider property relations from Semantic models.

Sample request for creating ontology for Air Quality App (available in SIOS) is as below:

Request
  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
    {
    "classes": [{
      "name": "AirQualityIndex"
    }, {
      "name": "Monitoring"
    }],
    "schemas": [{
      "name": "airnow_aqi"
    }, {
      "name": "airnow_monitoringsites"
    }],
    "classProperties": [{
      "name": "Value",
      "datatype": "String",
      "parentClass": {
        "name": "AirQualityIndex"
      }
    }, {
      "name": "parameterName",
      "datatype": "String",
      "parentClass": {
        "name": "AirQualityIndex"
      }
    }, {
      "name": "siteName",
      "datatype": "String",
      "parentClass": {
        "name": "AirQualityIndex"
      }
    }, {
      "name": "latitude",
      "datatype": "String",
      "parentClass": {
        "name": "Monitoring"
      }
    }, {
      "name": "longitude",
      "datatype": "String",
      "parentClass": {
        "name": "Monitoring"
      }
    }, {
      "name": "siteName",
      "datatype": "String",
      "parentClass": {
        "name": "Monitoring"
      }
    }],
    "schemaProperties": [{
      "name": "AQSID",
      "parentSchema": {
        "name": "airnow_aqi"
      },
      "datatype": "String"
    }, {
      "name": "date",
      "parentSchema": {
        "name": "airnow_aqi"
      },
      "datatype": "String"
    }, {
      "name": "parametername",
      "parentSchema": {
        "name": "airnow_aqi"
      },
      "datatype": "String"
    }, {
      "name": "sitename",
      "parentSchema": {
        "name": "airnow_aqi"
      },
      "datatype": "String"
    }, {
      "name": "time",
      "parentSchema": {
        "name": "airnow_aqi"
      },
      "datatype": "String"
    }, {
      "name": "value",
      "parentSchema": {
        "name": "airnow_aqi"
      },
      "datatype": "String"
    }, {
      "name": "AQSID",
      "parentSchema": {
        "name": "airnow_monitoringsites"
      },
      "datatype": "String"
    }, {
      "name": "latitude",
      "parentSchema": {
        "name": "airnow_monitoringsites"
      },
      "datatype": "String"
    }, {
      "name": "longitude",
      "parentSchema": {
        "name": "airnow_monitoringsites"
      },
      "datatype": "String"
    }, {
      "name": "parametername",
      "parentSchema": {
        "name": "airnow_monitoringsites"
      },
      "datatype": "String"
    }, {
      "name": "sitecode",
      "parentSchema": {
        "name": "airnow_monitoringsites"
      },
      "datatype": "String"
    }],
    "mappings": [{
      "name": "mapping0",
      "keyMapping": true,
      "functionalMapping": false,
      "classProperty": {
        "name": "Value",
        "parentClass": {
          "name": "AirQualityIndex"
        }
      },
      "schemaProperties": [{
        "name": "value",
        "parentSchema": {
          "name": "airnow_aqi"
        }
      }],
      "mappingFunction": {}
    }, {
      "name": "mapping1",
      "keyMapping": true,
      "functionalMapping": false,
      "classProperty": {
        "name": "parameterName",
        "parentClass": {
          "name": "AirQualityIndex"
        }
      },
      "schemaProperties": [{
        "name": "parametername",
        "parentSchema": {
          "name": "airnow_aqi"
        }
      }],
      "mappingFunction": {}
    }, {
      "name": "mapping2",
      "keyMapping": true,
      "functionalMapping": false,
      "classProperty": {
        "name": "siteName",
        "parentClass": {
          "name": "AirQualityIndex"
        }
      },
      "schemaProperties": [{
        "name": "sitename",
        "parentSchema": {
          "name": "airnow_aqi"
        }
      }],
      "mappingFunction": {}
    }, {
      "name": "mapping3",
      "keyMapping": true,
      "functionalMapping": false,
      "classProperty": {
        "name": "latitude",
        "parentClass": {
          "name": "Monitoring"
        }
      },
      "schemaProperties": [{
        "name": "latitude",
        "parentSchema": {
          "name": "airnow_monitoringsites"
        }
      }],
      "mappingFunction": {}
    }, {
      "name": "mapping4",
      "keyMapping": true,
      "functionalMapping": false,
      "classProperty": {
        "name": "longitude",
        "parentClass": {
          "name": "Monitoring"
        }
      },
      "schemaProperties": [{
        "name": "longitude",
        "parentSchema": {
          "name": "airnow_monitoringsites"
        }
      }],
      "mappingFunction": {}
    }]
  }

Semantic queries can be built using SDI data query service APIs. Every Semantic query is based on a namespace created within SDI. You can retrieve Semantic model from HTTP method:

1
  GET API URL: <Base URL></api/sdi/v3/ontologies/{id}>

Sample response of retrieve ontology for Air Quality App is as below:

Response
  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
    {
    "id": "77A435151E126FA07ACB32D20AAF54F5",
    "ontologyName": "AirQualityApp",
    "createdDate": "2019-10-18T11:01:33.063Z",
    "updatedDate": "2019-10-18T11:01:33.064Z",
    "classes": [
      {
        "name": "AirQualityIndex"
      },
      {
        "name": "Monitoring"
      }
    ],
    "schemas": [
      {
        "name": "airnow_aqi"
      },
      {
        "name": "airnow_monitoringsites"
      }
    ],
    "classProperties": [
      {
        "name": "Value",
        "datatype": "String",
        "parentClass": {
          "name": "AirQualityIndex"
        }
      },
      {
        "name": "parameterName",
        "datatype": "String",
        "parentClass": {
          "name": "AirQualityIndex"
        }
      },
      {
        "name": "siteName",
        "datatype": "String",
        "parentClass": {
          "name": "AirQualityIndex"
        }
      },
      {
        "name": "latitude",
        "datatype": "String",
        "parentClass": {
          "name": "Monitoring"
        }
      },
      {
        "name": "longitude",
        "datatype": "String",
        "parentClass": {
          "name": "Monitoring"
        }
      },
      {
        "name": "siteName",
        "datatype": "String",
        "parentClass": {
          "name": "Monitoring"
        }
      }
    ],
    "schemaProperties": [
      {
        "name": "value",
        "parentSchema": {
          "name": "airnow_aqi"
        },
        "datatype": "String"
      },
      {
        "name": "parametername",
        "parentSchema": {
          "name": "airnow_aqi"
        },
        "datatype": "String"
      },
      {
        "name": "sitename",
        "parentSchema": {
          "name": "airnow_aqi"
        },
        "datatype": "String"
      },
      {
        "name": "latitude",
        "parentSchema": {
          "name": "airnow_monitoringsites"
        },
        "datatype": "String"
      },
      {
        "name": "longitude",
        "parentSchema": {
          "name": "airnow_monitoringsites"
        },
        "datatype": "String"
      }
    ],
    "mappings": [
      {
        "name": "mapping0",
        "keyMapping": true,
        "functionalMapping": false,
        "classProperty": {
          "name": "Value",
          "parentClass": {
            "name": "AirQualityIndex"
          }
        },
        "schemaProperties": [
          {
            "name": "value",
            "parentSchema": {
              "name": "airnow_aqi"
            }
          }
        ]
      },
      {
        "name": "mapping1",
        "keyMapping": true,
        "functionalMapping": false,
        "classProperty": {
          "name": "parameterName",
          "parentClass": {
            "name": "AirQualityIndex"
          }
        },
        "schemaProperties": [
          {
            "name": "parametername",
            "parentSchema": {
              "name": "airnow_aqi"
            }
          }
        ]
      },
      {
        "name": "mapping2",
        "keyMapping": true,
        "functionalMapping": false,
        "classProperty": {
          "name": "siteName",
          "parentClass": {
            "name": "AirQualityIndex"
          }
        },
        "schemaProperties": [
          {
            "name": "sitename",
            "parentSchema": {
              "name": "airnow_aqi"
            }
          }
        ]
      },
      {
        "name": "mapping3",
        "keyMapping": true,
        "functionalMapping": false,
        "classProperty": {
          "name": "latitude",
          "parentClass": {
            "name": "Monitoring"
          }
        },
        "schemaProperties": [
          {
            "name": "latitude",
            "parentSchema": {
              "name": "airnow_monitoringsites"
            }
          }
        ]
      },
      {
        "name": "mapping4",
        "keyMapping": true,
        "functionalMapping": false,
        "classProperty": {
          "name": "longitude",
          "parentClass": {
            "name": "Monitoring"
          }
        },
        "schemaProperties": [
          {
            "name": "longitude",
            "parentSchema": {
              "name": "airnow_monitoringsites"
            }
          }
        ]
      }
    ]
  }

Any questions left?

Ask the community


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