Open Data Tenerife Cabildo
-
As we saw in previous posts with the visualization of tabular data, the Open Data Portal of the Cabildo de Tenerife allows you to visualize certain datasets in graph format, which helps you to understand the most relevant information .
Today, through different datasets available on the portal, we will focus on how to work with this type of visualization and the advantages it offers us.
To begin with, let's open the "Incidents on Tenerife roads" dataset. Once in the dataset, we enter the visualization of any of its resources in CSV format and, in turn, on the left side of the screen we access the "Chart" option.This is where we start configuring our chart.
Within this option, we will see 10 different types of graphs, from which we can choose:
For all these types of graphs we will have the option to export them in three different formats or print them by accessing the menu available with the three dots button at the top right of the graph.
Bar Chart
Barcharts summarize and compare categorical data using proportional bar lengths to represent values. Bar charts are composed of an X-Axis and a Y-Axis. The X-Axis represents discrete categories that correspond to one or more bars. The Y-Axis is where we can see the values, i.e. the numbers or quantities to be expressed.
We have already selected a data set, the chart option and we have decided that we want to generate a bar chart. How do we proceed?
When we select this typology, a drop-down menu will appear in which we can select the value we want to display on the X-axis. This time we will choose "incidence_type".
The portal will generate a graph where you can see, at a glance, the different types of incidents reported on the roads and for each of them the number of occurrences, clearly distinguishing which are the most or least common.
The Y Axis shows the operation being carried out, as shown in the previous graph, the occurrence count is performed, but we can also obtain the Average, Sum, Minimum or Maximum of the different numerical variables of the resource. For example, when selecting the set "Tenerife Weather Stations",we select for the X Axis "municipality_name" and in the Y Axis the "Sum" of the column "sensors_quantity". This way we can analyze the sum of the values collected by municipality name.
In this graph the total number of meteorological sensors per municipality is obtained.
Column chart
Acolumn chart, like a bar chart, allows us to compare data using different column lengths .
We represent the same examples as in the previous section vertically.
As with the bar chart (and the rest of the charts from now on), by choosing a resource that contains numerical data and not simply categorical (text) data, we can use an operation other than counting and perform an operation using the desired numerical column.
Funnel plot
A funnel chart is a graphical representation used to visualize how data moves through a process. In a funnel plot, the value of the dependent variable decreases in later stages of the process.
Let's change the data set and take as a reference the data set "Influx of recreational areas in Tenerife". We want to know the percentage of affluence according to the type of unit (tourism, tent, motorhome, etc). To do this, we will choose the funnel plot and in the X Axis we choose "unit" and in the Y Axis "Sum" from the column "quantity".
In the graph we can see the percentage according to the type of unit, taking into account the quantity column, ordered from highest to lowest .
This chart has the option of "eliminating" some specific cases, i.e., by clicking on the values in the legend, the percentages are recalculated, eliminating the selected values from the chart, which will remain in the legend in gray color.
Pie chart
Pie chartsshow categories as a proportion or percentage of the whole. Use pie charts to show the composition of the data of a category in which each segment is proportional to the quantity it represents.
We will perform the same example as in the previous case, but using the pie chart.
In the previous graph we can see that the users of the camping and recreational areas have a preference for the use of tourism to access these areas. As in the previous graph, we can "eliminate" some specific cases by clicking on the values in the legend.
Area chart
Anarea chartis a chart that combines aline chartand a bar chart to show changes in quantities over time.
For this type of chart, it is strictly necessary that the column selected for the X-Axis is of type date (e.g. 2023-01-02T08:36:00).
Within the set of "Nature activity bookings in Tenerife", we will go to the area graph option and select for the X Axis "start_date" and in the Y Axis "Sum" and the column "number_of_people". In this way, we will be able to analyze the sum of people enrolled in nature activities collected by date.
In the upper area of the graph there is a gray bar that allows us to select the period of dates to be displayed.
Histogram graph
A histogram is a graphical representation of a numerical and continuous variable in the form of bars, where the surface of the bar indicates the total number of values in the interval.
For this type of representation it is necessary that the resource has at least one numerical column.
In this case we are interested in knowing how the number of available places is distributed taking into account the set "Tourist accommodations in Tenerife".
We have grouped the number of places available in Tenerife's accommodations in 5 intervals and we can see that 502 accommodations have less than 272 places and 7 have more than 1086.
Line graph
Line chartsallow us to visualize changes over a continuous range, such as time or distance. Visualizing change with a line chart allows you to see the overall trend at a glance and simultaneously compare multiple trends.
Again, as with the area chart, the X-Axis column needs to be of type date in order to display information. If you select a data set that does not meet this condition, you will not be able to view the line chart or the area chart.
To exemplify this, we will do it again through the set "Reservations of nature activities in Tenerife", but visualizing other information. In order to analyze the number of caravans used in the activities we select "start_date" in the X Axis and in the Y Axis "Sum" in the column "caravan_quantity".
In the upper area of the graph there is a gray bar that allows us to select the period of dates to be displayed.
Rectangle chart
The rectangle chart allows us to have a hierarchical view of the data from rectangles whose size depends on the chosen data.
We return to the data set "Influx of recreational areas in Tenerife". This time we want to know which recreational areas are receiving more affluence during 2023. In Axis X we will choose "toponymy". In theY Axis , we will choose as operation to apply "Sum" and the "quantity" column .
Radial chart
Radial chartsare used to evaluate different options based on multiple variables. They allow us to display one or more variables in a two-dimensional graph; each radius corresponds to one variable.
We access the data set "Sensors of the meteorological stations of Tenerife". This time we want to know the number of meteorological sensors of each type. To do this, we can choose the type of radialgraph , in the X Axis "sensor_name" and in the Y Axis "Count".
With the gray bar we can remove values from the graph.
Scatter plot
Scatter plots show numerical coordinates on the X-axis and Y-axis. They are used to find out to what extent one variable is affected by another.
For this type of representation it is necessary that the resource has at least two numerical columns.
We are going to use the data set "Nature activity reservations in Tenerife" to see the correlation between people and caravans.
It can be seen that there is no linear relationship between the number of people and the number of caravans. In addition, this graph allows you to view specific data by dragging the ends of the gray bars at the top and right of the graph.
-
The Cabildo de Tenerife's Open Data portal includes a SPARQL Point, which allows queries to search for sets containing a specific word or specific resources.
SPARQL(SPARQL Protocol and RDF Query Language) is a query language designed to retrieve and manipulate data stored in RDF (Resource Description Framework) format, a standard for representing information on the semantic web.
The tool used to store and query this data is Virtuoso, which stores the data in the form of RDF graphs formed by subject-predicate-object triples, representing the relationships between entities and the values they have for certain properties.
In the following, we will explain in more detail what it consists of and how it is used.
ACCESS TO THE SPARQL POINT
To access the SPARQL Point of the portal datos.tenerife.es you have to deploy the Data tab, located at the top left of the Home page.
After accessing the SPARQL Point, a screen will appear with different options that will allow you to narrow down your search.
With SPARQL it is possible to create complex queries that relate elements to each other by taking advantage of the RDF network structure. The SPARQL syntax is similar to SQL queries, since it consists of SELECT, WHERE, FILTER, ORDER BY, etc. operators.
It incorporates a series of prefixes(PREFIX) that serve to abbreviate long URIs(Uniform Resource Identifier) and make queries more readable and compact.
In the Query Text box you can enter the desired queries, following the indications explained in the following points, and execute them by clicking on the Execute Query button. Once the query has been executed, the result will be displayed in a new tab. To re-launch another query either use the browser's back button or click on the SPARQL | HTML5 table options. Finally, by clicking on the Reset button we delete the entered query and see the example query.
On the other hand, in the SPARQL Point of the Cabildo's Open Data portal you can choose the format in which to obtain the results of the query using the different values of the drop-down "Results format": Auto, HTML, SpreadSheet, XML, JSON, Javascript, Turtle, RDF/XML, N-Triples, CSV and TSV.
In addition, at the bottom of the page you can choose between three different options:
- Strict checking of void variables: When you run a SPARQL query, you can use variables that do not have a value assigned to them (void variables). This option indicates whether you want the system to perform a strict check of these variables to ensure that they are not used incorrectly or inappropriately in your query. If you enable this option, the system may throw an error if it finds empty variables that should not be there, according to the query rules.
- Log debug info at the end of output: This option suggests that, when enabled, debugging details will be logged at the end of the query result. Debugging information usually includes internal details of the query execution process and can be useful for identifying problems or understanding how the query is processed. Note, however, that this option may not be effective for some queries or specific output formats.
- Generate SPARQL compilation report: Instead of executing the SPARQL query this option indicates that a report will be generated showing how the query would be compiled or processed internally. This report could be useful to understand the performance or efficiency of the query without having to fully execute it. It may help to identify possible optimizations before the actual execution.
USE SPARQL POINT
To understand SPARQL it is best to use an example and explain it part by part.
Suppose we have a series of RDF graphs describing information or metadata about published datasets and resources, having information about the title, description, publisher, format, etc.
In this case, we would perform a simple SPARQL query to get the first hundred datasets or resources and their links sorted by their title:
PREFIX dct: <http://purl.org/dc/terms/> Select distinct ?URL ?title where { ?URL dct:title ?title } order by desc(?title) LIMIT 100.
The explanation of the code is as follows:
- PREFIX: This prefix assigns the alias"dct" to the base URI " http://purl.org/dc/terms/". It is used to abbreviate the URIs in the query.
- SELECT: Specifies the variables we want to retrieve in the query results. In this case, we want to get the first hundred datasets or resources with their URLs. The distinct clause ensures that only unique results are displayed (no repeats).
- WHERE: Defines the RDF triple pattern to be searched in the network:
- ?URL dct:title ?title: Here we are looking for triples where some set has a title. The variable ?title will be used to represent those titles.
We can also get any other kind of information that we have in the RDF, description, publisher...
In this way, the SPARQL query would give us results like the following:
Referring to the Cabildo de Tenerife Open Data portal we will show a series of examples of SPARQL queries to retrieve information about published data.
In this case, Virtuoso relies on the portal's metadata catalog provided at https://datos.tenerife.es/es/datos/tablero?resourceId=17e64992-df93-4c8d-b9a5-5c860b1e978c to obtain the metadata of the published sets and resources to create the RDF graphs.
EXAMPLES
In the following, we will explain, with different examples, the different types of search that can be performed in the portal.
- Obtain the name and link of all the datasets and resources of the portal:Inthis way you can obtain the name and link (URL) of all the datasets and their resources (distributions) published in the portal .
PREFIX dct: <http://purl.org/dc/terms/> SELECT distinct ?name ?URL WHERE{ ?URL dct:title ?name }
- Filtering by text strings:
In this case we want to retrieve those sets that have the word "tourism" in their title (?title):
PREFIX dct: <http://purl.org/dc/terms/> PREFIX dcat: <http://www.w3.org/ns/dcat#> SELECT * WHERE { ?dataset dct:title ?title . FILTER (CONTAINS(LCASE(?title), "tourism")) }
The result would be this:
- Search for a dataset or resource by its specific name:
Get the URLs of the datasets or resources with title "Bus stops".
PREFIX dct: <http://purl.org/dc/terms/> SELECT * WHERE { ?URL dct:title "Bus stops" }
- Filter by resource type
In the open data portal a dataset can have the same resource in several formats (distributions), so when querying in the SPARQL point we will get repeated results with the same title, which we can differentiate by adding a resource type column.
In the following query we will search by means of the FILTER clause for those sets that have the word "centers" and we will obtain their links, titles and formats:
PREFIX dct: <http://purl.org/dc/terms/> SELECT WHERE { ?URL dct:title ?title. ?URL dct:format ?format . FILTER (CONTAINS(LCASE(?title), "centers")) } order by asc(?title)
There is also the possibility of filtering to get only GeoJSON type resources.
In this case, there are two ways of searching, whose result would be the same:
- Using FILTER:
PREFIX dct: <http://purl.org/dc/terms/> SELECT * WHERE { ?URL dct:title ?title. ?URL dct:format ?format. FILTER (CONTAINS(LCASE(?title), "centers")) FILTER (CONTAINS(LCASE(?format), "geojson")) })
- Indicating the text string in the triplet:
PREFIX dct: <http://purl.org/dc/terms/> SELECT * WHERE { ?URL dct:title ?title. ?URL dct:format "GeoJSON" FILTER (CONTAINS(LCASE(?title), "centers")) }
- Get information about the publisher of the data:
This information is collected in the dcat:contactPoint field. In the following query we are going to retrieve those sets whose publisher or contact point is the Technical Service of Agriculture and Rural Development (AgroCabildo):
PREFIX dct: <http://purl.org/dc/terms/> PREFIX dcat: <http://www.w3.org/ns/dcat#> SELECT distinct ?URL ?title ?contact_point WHERE { ?URL dct:title ?title. ?URL dcat:contactPoint ?contact_point. FILTER (CONTAINS(LCASE(STR(?contact_point)), "agricultural technical service") }) } ORDER BY ASC(?title)
So much for the training on the SPARQL Point of datos.tenerife.es, but we encourage you to continue learning more about our portal and all the possibilities it offers.
-
The visualization and study of the interconnections between data makes it possible to optimize the use of Open Data and is an essential element for the assimilation, understanding and analysis of data.
With this objective in mind, the Cabildo de Tenerife' sOpen Data portal offersusers a wide range of data visualization and analytics options, which we explain below, in order to make the most of its possibilities .
Inaddition to visualizing data through the dataset itself, you can opt for the function called "Dashboard", which allows you to visualize in parallel several graphs or datasets, configuring "dashboards" or "boards" based on the different visualizations and allowing you to share, embed or download the results obtained .
HOW DOES THE DATA.TENERIFE.ES DASHBOARD WORK?
After entering the home page of the Portal datos.tenerife.es, you will have to access the "Data" block, through the option located at the top right of the page. When you open the "Data" menu, you will see, among the different options, the "Dashboard" function.
When accessing it, a button is displayed to select a resource to be displayed on the dashboard, in an agile and simple way. Clicking on the "select now" button displays a new window with a search bar, where you can enter the words corresponding to the data you wish to locate .
There is also the option of choosing one of the data sets already displayed under the search bar.
There is the possibility offiltering the search results through the options available on the left side of the window, by format, category or organization, in order to narrow down the results to be obtained.
After typing the corresponding words in the search bar (or selecting the desired dataset), you will access the list of resources (distributions) available for this dataset, which can be displayed on the dashboard. Depending on the format of the resource you choose, the data will be displayed as atable, graph or map.
One of the main functionalities of the Dashboard lies in the possibility of being able to combine and compare different data. Once you have selected a first resource to be displayed, the "Add Dashboard" button will appear at the bottom of the page, allowing you to display different resources from one or more datasets simultaneously on the same page .
The Cabildo's Datos Abiertos portal allows you to combine up to three different dashboards, which generates a wide range of possibilities for data comparison.
PRACTICAL EXAMPLE: ACCESSIBILITY AND TRADE DATA
As a practical example, we are going to show you how you could visualize and cross-reference different resources related to accessibility, a section in which the portal offers from the visualization of the locations of parking spaces reserved for people with reduced mobility to the stairs and elevators that exist in pedestrian routes, among many other options .
In this practical example, we propose to select the data included in the Accessibility Map phases 1 and 2 of Tenerife and choose, as an example, the parking spaces reserved for people with reduced mobility, in GeoJSON format, to display them clearly on a map, as shown below .
By zooming in on the desired area, you will be able to view the locations of the different parking spaces reserved for people with reduced mobility and find out, among other details, their level of accessibility .
Atthe bottom of the page, under the map, you can obtain a URL to share the map or the HTML code to insert this map in your own web page.
HOW TO COMPARE AND COMBINE RESOURCES ON A MAP?
Since one of the main functionalities of the map visualization lies in the possibility tocombine and compare different data, several resources can be added, using the "Add new resource" button, located on the left side of the map. This function is also available through the dataset and is particularly useful for combining or comparing information.
Continuing with the example we have started from, we will again include "accessibility" in the search and select within the Accessibility Map phases 1 and 2 the resource of accessible toilets for public use in GeoJSON or SHP format, which will allow us to visualize its location, on the same map, with a different color than the parking spaces.
The portal also gives the option to choose different backgrounds or to activate or not the resources that had been added, as can be seen in the upper right box of the map itself. In this way, each of the resources represented can be identified.
HOW TO ADD ANOTHER BOARD WITH GRAPHS OR TABLES?
In order to get to know the different forms of visualization that we can add to the board, we will incorporate different resources. As an example, let's look at the existing datasets within the "commerce"category , where we find the commercial food establishments of the island, available in different formats. In this case, we are going to add the information offered by the portal in XLS format, which will be displayed by default using the table visualization.
In this case, the Portal offers a very interesting possibility. This is thegraphicaldisplay . Thus, by choosing this option, you can not only graphically represent the data but also download or export the resulting graph.
In the case of data from food stores, after selecting the Chartoption , you must choose the type of chart to be used and then the fields or attributes that contain the values to be represented.
In this example, the column chart has been chosen and the representation using the "municipality" field, which allows you to see the distribution by localities of the food stores.
The Cabildo de Tenerife Portal incorporates different types of graphs: bar, column, funnel, pie, histogram, histogram, area, line, rectangle, radial and scatter .
Thus, the possibilities generated are very broad. One could, for example, opt for a pie chart showing the distribution by "activities".
Inaddition, in the case of the graphs, by clicking on the"three dots" in the upper right-hand corner of the box, thegraph can bedownloaded in PNG, JPG, PDF or printed .
With these brief examples, we have tried to offer a quick and simple view of the possibilities of "combining and interconnecting" the resources of the Cabildo de Tenerife's Open Data portal , but it is clear that the possibilities are almost endless .
So it only remains to encourage you to access datos.tenerife.es and to develop the visualizations that most interest you to embed and share data in an agile and effective way .
-
In the Open Data Portal of the Cabildo de Tenerife you can find several datasets in different formats. Today we will focus on how to work with tabular data visualization from the portal, which allows us to understand and analyze datasets more effectively, taking as an example the dataset "Tenerife Weather Stations".
Column selection
When we access the visualization of a dataset that is in a format that can be displayed as a table, such as a .csv file, we will be able to see a table that presents a large number of fields. However, it is possible that not all columns are relevant to our particular task. The Portal offers the possibility to customize the display of the data by selecting the columns we want to show. To do this, simply click on the three dots next to any of the column names, and a menu will pop up, allowing you to select the specific columns you are interested in from among all the existing ones. This is especially useful when we are looking to focus on specific information and want to avoid the visual clutter that can result from the presentation of unnecessary data.
This table display will always show an _id column that consecutively numbers each row of data, although it is not a column of the data set itself.
Sorting data
The ability to sort data is another feature of this portal visualization. Many times we need to sort the data according to a particular column, either alphabetically or numerically. The process is simple: just click on the name of the column you want to use as a sorting criterion. Automatically, the table is reorganized to present the data sorted by the values of the selected column in ascending order (and if you click again, in descending order). This feature is especially useful when we are looking for patterns or trends in the data that can only be detected through proper organization.
In addition, this type of visualization also allows the sorting of columns according to our needs. You simply click on the column you want to move and drag it to a new location. This makes it easier to visualize the data of interest.
Viewing rows
At the bottom of the table we can see at any time the number of rows in the data set. To avoid the possibility that displaying a large number of rows may make it difficult to manage the data, in the same place we can choose how many rows we want to display at a time, which can facilitate the assimilation of the information.
By default, when there are many rows of data to be displayed, they will be divided into several pages. It is from the bottom of the table where we can navigate between them to access all the available information, as well as identify which page we are on.
It should be noted that the display of data in table has a limitation of 32,000 records, so in data sets containing more records we can see a warning like this:
Data filtering
On many occasions, it is essential to filter the data to focus on a specific subset that is relevant to our needs. The tabular display incorporates filtering options that simplify this process; we only need to indicate the name of the field to filter by, the operator to use and the value to compare with.
The operators that can be used are like, equal(=), different (!=), greater than(>), less than(<), less than or equal(<=) and greater than or equal(>=). Depending on whether the column contains numeric data or text, it will make sense to use one operator or others. Let's look at two examples:
We are conducting a study on incidents on roads in Tenerife and we want to know how many occurred during the month of August. In the field to filter we are going to select the column incident_start_date, the operator like and, in the value to filter, we write 2023-08. With this filter we will get all the results for the month of August, without the need for an exact match.
Now let's imagine that we want to identify the weather stations located in La Orotava. To do so, we will use the filtering options located at the top of the table. In this case, in the field to filter we will select the field "municipality_name", the operator = and in the Value to filter we will write "La Orotava". When applying the filter, the table is automatically adjusted to show only the rows that meet this criterion, where the municipality matches exactly "La Orotava".
Finally, if we want to remove any filters that may be active in the table, just click on the "Clear" button at the top right.
The visualization of tabular data through the Open Data Portal of the Cabildo de Tenerife is a powerful tool to understand and analyze relevant information. The ability to customize information by selecting specific columns, sorting data in a consistent way and filtering it based on specific criteria facilitates the use of the datasets and their reuse. By adopting a user-centered approach, providing intuitive tools, the portal facilitates the exploration and exploitation of information, thus contributing to understanding and informed decision making in a variety of contexts.
-
In the Open Data Portal of the Cabildo de Tenerife you will find a multitude of data sets of different themes and characteristics. These data can be viewed from the portal itself or downloaded for consultation.
Visualizations are graphical representations of data that allow to communicate in a simple and effective way the information they contain. These visualizations help users to quickly understand a situation, identify trends and make informed decisions.
Depending on the data set we want to consult, it will provide us with different resources in formats that we can download and/or visualize from the portal itself.
Currently, the formats supported by the portal and directly viewable are JSON, GeoJSON, CSV, Esri Shapefile (SHP), TXT, RDF, PDF, PNG, JPEG, API, KML, RSS, SVG, XML and HTML. On the other hand, the formats that can only be downloaded are XLS/XLSX, GeoPackage(GPKG), KMZ, GPX, ODS, TSV or ZIP.
Let's see several of the data formats that we can find in the portal and how we can visualize them in each case:
ESRI Shapefile (SHP)
The SHP format contains spatial data used for the exchange of geographic information between Geographic Information Systems.
This type of file allows us to obtain data visualizations on a map.
GeoJSON
The GeoJSON format is an open standard format designed to represent simple geographic elements, together with their non-spatial attributes.
As in the previous case, this format allows us to visualize the data on a map.
JSON
Acronym for JavaScript Object Notation, it is a simple text format for the exchange of data completely independent of the JavaScript language, but which uses conventions that are widely known, being constituted by an ordered list and collections of name/value pairs.
CSV
CSV files are documents in a simple open format for representing data in table form, in which columns are separated by commas and rows by line breaks.
The visualization of these files gives us many possibilities, as you can see in the following example, since we can visualize it as a table, graph or even on a map.