Smart Data Models Support
Available since version 6.1.0-Warcraft
Introduction
The availability of widely adopted (de facto standard) information models is key to creating a global digital single market for interoperable and replicable (portable) smart solutions in multiple domains (smart cities, smart agri-food, smart utilities, smart industry, etc.). Such models provide an essential element in the common technical basis needed for open standards-based innovation and public procurement.
Data Models play a crucial role because they define the harmonised representation formats and semantics that applications will use to both consume and publish data.
Smart Data Models is a joint collaborative programme to support the adoption of a common reference architecture and compatible common data models to underpin a digital marketplace of interoperable and replicable Smart solutions.
The FIWARE Foundation, IUDX, TM Forum and OASC are leading a joint collaborative programme to support the adoption of common, compatible data models that underpin a digital marketplace of smart, interoperable and replicable solutions across multiple sectors, starting with smart cities. The programme is open to collaboration both by contributing new models, as well as using existing ones as they are open.
How is Platform supported?
Onesait Platform has an agnostic design as far as data models are concerned, so it has always been able to use any data model, so far supporting JSON-Schema and JSON-LD as languages for the definition of the models.
The way to work with data models is to define them within the data model management functionality, which allows the administrator to register and categorise data models. In this way, the rest of the users can use them when defining their Entities. Therefore, it allows defining the catalogue of data models that will make up the data model standard of a project.
Taking this to the Smart Data Models, the administrator has the capacity to register the models that he/she considers appropriate and to have them classified, as in the following example:
From version 6.1.0 of Onesait Platform, the definitions of Smart Data Models will be added as part of the data models available by default, as was already the case, for example, with the GSMA data models, which are now also part of Smart Data Models. In this way, the administrator does not need to create them in order to make them available to users.
Once a model has been created, its definition can be consulted as shown in the following image:
To make use of these data models, when creating new Entities, simply select the loaded data model of interest:
Once the Entity is created, it can be used to insert data and validate that the data complies with the standard. For example, by inserting a valid instance, it is stored correctly:
{
"id": "urn:ngsi-ld:Building:a3b15710-993b-4af9-9a28-bdccdf936948",
"type": "Building",
"dateCreated": "2023-01-26T08:50:56Z",
"dateModified": "2023-01-25T16:09:41Z",
"source": "Import",
"name": "Building",
"alternateName": "Building type 2",
"description": "Building of limited Building types",
"dataProvider": "IFC file"
}
In the case of trying to insert an invalid data, a validation error will occur, clearly indicating the cause of the insertion failure, which in this case is the lack of a mandatory field named ‘type’:
The schema validation engine will allow the use of references to models defined on the internet. This is very convenient in many cases, but in production environments it is very common for servers not to have access to the internet for security reasons. In such cases, Onesait Platform has the ability to define a mapping of schema URIs to schema identifiers defined in the data schema management.
In this way the validation engine will use the local definition instead of trying to go out to the Internet to get the definition, allowing the use of standard data models in offline environments and without having to rewrite references to other data models.
The following image shows some examples of these mappings for models using an Onesait Platform URI, but the mapping can be done for any other URI as well: