Workshops

Workshop on the Platform. Part I: Preliminary Concepts and Ontologies

This is the first part of a Worshop on the Platform that you can do in our free and open access instance of CloudLab. Throughout this workshop, we will cover the following subjects:

  • Modeling two ontologies: we will model the ontologies of this case study, one of them using a «GSMA Datamodel» as a base and the other one creating the data structure from scratch.
  • Ingest from an Open Data portal using the Flow Engine: we will define two information flows that will retrieve information from the Open Data of the city of Barcelona and we will store this information in the previously defined ontologies.
  • Creation of a GIS viewer: one of the ontologies we have modeled will store georeferenced information. We will define a GIS viewer in the Platform to show this information on a map.
  • Creation of a Dashboard: we will create a simple Dashboard that will visually structure the information stored in the platform and coming from the Open Data portal.
  • Display in an API REST: we will use the API Manager to display an operation with the information of one of the ontologies.

The example will consist, as we say, in loading data from the Open Data portal of the city of Barcelona. Specifically, two resources from their bike rental service dataset will be chosen. These resources are:

  • The inventory of rental stations.
  • The state of each station, which is refreshed periodically.

Within the diagram of Platform components, in the following image we can see marks on the components with which we are going to work:

  1. Control Panel: is the web interface which we will use to work with the Platform.
  2. Flow Engine: the flow engine that will ingest the data from the Open Data service of the Barcelona City Council. In the example, two flows will be defined: one to query and create the inventory of stations on the platform, and the other one to query and periodically update the status of the stations.
  3. Semantic Broker: it provides the entry point of the information in the Platform. It verifies the access permissions to the information and it checks that the information is correct according to the scheme defined in the ontology and, if so, it passes the information to the storage module. In our case, the Semantic Broker transparentlyprovides the Flow Engine with the point where it has to dump the information queried in the Open Data portal, and it is in charge of validating it with the scheme defined in the ontologies.
  4. Multimodel Persistence: it provides the physical infrastructure (databases) for information storage, query and maintenance. In the example, this module provides the database where the inventory and status information of bicycle stations is stored, as well as the query engine.
  5. Geo Services: this facilitates the GIS visualization of the information stored in the platform and that has a geographic component. In our example, the GIS viewer will allow the creation of an HTML5 and JavaScript viewer that visualizes the georeferencing of the stations in the inventory ontology.
  6. Dashboard Engine: it allows the creation and graphic visualization, through HTML5 web components, of the information stored in the Platform. In the example, we will create a Dashboard that shows a GIS viewer with the inventory of georeferenced bicycles, the status of all stations, as well as a filter that indicates the comparison between electric and mechanical bicycles available in each rental station.
  7. API Manager: it facilitates integration with other systems, allowing the information stored on the platform to be exploited by other systems, in a standard way and controlled by an API REST. In the example, we will create an API REST with an operation that allows us to know the list of stations whose available bicycles are below a threshold specified by a parameter in the API.
Onesait Platform modules used.

Ontology Modeling

The modeling of an ontology is inherent to the information it has to store. Therefore, to create the ontologies we will first query the information returned by the Bicing Open Data service.

Open Data Portal.

Specifically, we will use these two resources:

  • Inventory: that returns station inventory in the following format:
{
   "station_id": 1,
   "name": "GRAN VIA CORTS CATALANES, 760",
   "physical_configuration": "ELECTRICBIKESTATION",
   "lat": 41.3979779,
   "lon": 2.1801069,
   "altitude": 16.0,
   "address": "GRAN VIA CORTS CATALANES, 760",
   "post_code": "08013",
   "capacity": 46,
   "nearby_distance": 1000.0
}
  • Status: which is periodically updated, returning the status of each station in the following format:
{
	"station_id": 1,
	"num_bikes_available": 11,
	"num_bikes_available_types": {
		"mechanical": 11,
		"ebike": 0
	},
	"num_docks_available": 34,
	"is_installed": 1,
	"is_renting": 1,
	"is_returning": 1,
	"last_reported": 1593426290,
	"is_charging_station": true,
	"status": "IN_SERVICE"
}

In this way, we will moderate two ontologies:

BicingBCN_Inventory: with the inventory of stations. To create this ontology, we will use a GSMA template that already defines a standard for this type of information and that, through previous transformation during the ingest, is compatible with the one returned by the Open Data service. We can find information about this datamodel in this link.

To create the ontology: Once registered in the Platform, follow the following steps:

  • Choose the menu option: Development > My Ontologies and then the «Create» button.
Menu.
  • Select the «Creation Step by Step» option.
  • Create the ontology specifying: name, description, meta-information, and select the «GSMA-Bikestation» data template.
  • Click «Update Schema» to generate the ontology’s JSON scheme.
  • Finally, click on «New».

BicingBCN_Status: ontology with the status (available bikes) of each of the stations. In this case, we will not use an ontology template, but we will create it, one property at a time. The properties that the ontology will have are based on the ones returned by the Open Data service, which are:

  • station_id
  • numBikesAvailable
  • numBikesMechanical
  • numBikesElectric
  • status

The process to create the BicingBCN_Status ontology is the same as for BicingBCN_Inventory, except for the template, which in this case will be empty (template General > Empty Base) and the properties will be added manually using the «Add New Property» button:

Add one by one the properties indicated above that way, as you can see in the following image:

Finish the ontology creation generating the scheme by clicking «Update Schema» and lastly the «New» button.

Bear in mind that this Workshop has been performed by different users of the Platform, and that one of the restrictions existing when creating Ontologies is that there cannot be two Ontologies with the same name.

Therefore, we advise you to modify the name of the Ontologies, for example adding your username at the end: BicingBCN_Status_rbarrio.

This ends this first part of the Workshop. We will continue with the next part: Data Intake.

We hope you found it interesting and do not hesitate to leave us a comment with your suggestions or questions.

✍🏻 Author(s)

One thought on “Workshop on the Platform. Part I: Preliminary Concepts and Ontologies

Leave a Reply

Your email address will not be published. Required fields are marked *