Creating an ontology from a relational database and showing it in a dashboard
This type of ontologies are created from a pre-existing table in a relational database that is external to the platform. The data is not stored in the platform's RTDB. Instead, all the operations on this ontology are referred to that external database.
Ontology Creation
To create an external ontology, follow these steps:
- Access the menu option DEVELOPMENT > My Ontologies
- You will see a list with the existing ontologies. Select the button New to choose the type of ontology you want to create.
- Next select the type of ontology you will create. In this case, Creation from external relational database.
- The first step is registering the external database to be used. To do this, click on the button My Datasources.
- You will see a list with the datasources already registered in the platform. To create a new one, use the button New. Bear in mind that only a user with the Administrator role is authorized to register new datasources.
- Once the data to access the external database have been filled in, select the button New.
If you go back to the ontology creation screen, you can see the datasource you have just created is already there. - Once the datasource is selected, you will see a list with the tables in that external data source. Select the OPENPLATFORM table from the oracle4 datasource.
Select the option Associate ID. This will allow you to select a field from the future ontology as the unique ID for each instance. That is to say, queries on that identifier can be made. In this case, select the field COLUMN3 as your identifier. - Lastly, you can see that, when a table from the datasource is selected, you are shown an instance of the data stored on it. Select the button Generate Schema to generate the ontology schema from this data.
Which gives this result: - Lastly, create the ontology using the button
Operating on the ontology
Once the ontology is created, the next step is performing operations on it. To do this, access the menu option TOOLS>Query Tool.
Then select the OPENPLATFORM ontology:
Launch a SELECT type QUERY.
These data you've obtained come from the external database you configured at the beginning of this tutorial. You can also launch UPDATE, DELETE and SELECT COUNT sentences.
Dashboard Creation
Lastly, you will create a very simple dashboard using this ontology, accessing the data stored in the external database. To do so:
- Access the menu option Visualization > My Dashboards
- Select the New button .
- Fill in the applicable fields:
Then select the NEW button to create it. You will automatically see the just-created dashboard, empty. To add a gadget: - Select the button and you will see, in the lower part of the screen, a list with the types of gadgets that can be created. For this example, select Table and drag it to the dashboard's white background:
- When you release the element, a modal window will appear:
Select New Gadget. - You will see again a modal window where you will insert the gadget's name, then select the ontology you want to use - in this case OPENPLATFORM
The next step is defining which data is interesting and should be shown. In this case, launch a query like this one:select * from OPENPLATFORM where ROWNUM <= 3;
If you click Run Query , you will see the query's result and validate that it is what you need. When it fits your requirements, click on Continue .
- Now you see a new window where you can, on one hand, give a specific visualization format:
and on the other hand, select which fields in the ontology will be shown:
We can see in real time how our gadget is shown with the selected values. When it is satisfactory, click on