How to create and query an ontology with encrypted fields?

How to create and query an ontology with encrypted fields?

EN | ES

Configure your ontology

The Platform allows the creation of Ontologies with certain encrypted fields, using a block algorithm (AES).

To do this, follow the following steps:

  • From the menu option "Development > My Ontologies", create your ontology with encrypted fields.


  • Choose  "Creation Step by Step".

  • Give it the name you want and check "Allows encryption of fields".

  • For this, we choose the "General --> Empty Base" template and add fields. At the same time, choose if you want those to be encrypted by using the "Encrypted" combo,

Check it

  • Once created, you can query it and verify that the chosen fields have been marked to be encrypted.

  • The next step is to insert an ontology instance and verify that the data is encrypted correctly and that these are returned encrypted. You can do it in several ways (with the CRUD of ontologies for example), but for this test, use the Rest API of the Digital Clients in the following url: https://lab.onesaitplatform.com/iot-broker/swagger-ui.html

  • Once inserted, it will return the insertion id, with which you can later check it from the REST API itself:

  • If you query the returned id in this Ontology, you will be returned the encrypted ontology data:

  • The obtained response shows the encrypted fields, but decrypted: