Creation from file
Since version 3.1.0-KickOff, Ontologies have been referred to as "Entities" in the Control Panel. This does not alter any functionality; the nomenclature has simply been changed for a better understanding of the concept.
User Interface: 5.3.2-Ultimate
Introduction
We have the possibility to create an Entity from a data file we have, either in CSV, XML or JSON format, using the defined structure and importing the data from the file.
For this guide, we are going to see how to import the following JSON file:
Steps
Create the Entity
From the Control Panel, navigate to the Development > My Entities menu.
This will take us to the list of available Entities. To create the Entity, click on the "+" button at the top right of the screen.
From the different Entities that we will be able to create, we will select the "Creation from File" one:
Â
Upload the file
To create the Entity, we are going to make use of the Platform's export and import tool, with the addition that it will allow us to create a new Entity with the data, or reuse an existing one.
The first step is to upload the file with the data to the Platform. To do this, click on the "Click to upload" button, which will open the file selection window of the operating system.
There, we will look for the file we want to import (in this case, the "data_example.json" file that we can download at the top of this page).
Once it has been uploaded, we will see that of the two code screens that appear at the bottom, the one on the left has been populated with the file we have uploaded:
In case the code is not formatted, we have the option to do so by clicking on the "Beautify" button.
The next step will be to generate the schema of the Entity from the file we have uploaded. To do this, click on the "Generate JSON Schema" button. We will see that in the code window on the right the data schema is displayed:
Import options
When importing data, we have a few options available:
New Entity: as previously mentioned, we have the option of creating a new entity from the data we have loaded, or importing such data to an existing Entity. By default a new Entity will be created. If we want to import the data to an existing Entity, we uncheck this box and an Entity selector will appear, where we can choose on which one to import the data. It is important to note that the data must have the same structure as the schema of the Entity.
Â
Import data to RTDB: if this option is checked, when the Entity is created the data will be automatically loaded into the Entity. If unchecked, the Entity will be created but empty, without importing data into it (this is useful for creating a structure from test data).
ContextData Enable: if this option is enabled, the Entity created will have contextual data. By default, it will be created as an Entity without ContextData.
Once the options have been decided, click on the "Create" button to complete the creation of the Entity.
Create a new Entity
If a new Entity is being created, when clicking on the "Create" button, a window will appear in which you will have to enter the general information typical of Entities:
Name: this will be the unique identifier of the Entity.
Description: a short descriptive text of the Entity, such as its utility, use, etc.
Storage: the database where the Entity will be stored, which by default will be the Platform's native database, MongoDB.
Once the necessary information has been entered, clicking on the "Create" button will create the Entity.
Depending on the options defined, a series of notifications will be displayed to warn of the result of the operations performed.
A window will then be displayed with the available options to be performed with the Entity created.
Clicking on the "Close" button will take you back to the Entities list, where the newly created Entity will appear.
Consulting the information
In case we have imported data into the newly created Entity, we can use the query tool to check our data.
To do this, access the Tools > Query Tool menu.
In the window that will appear, select the Entity for which you want to consult the information, and execute the relevant query.
Â