You are here

1.1 Functional features

1.1 Introduction

The portal Open Data BCN, the Ajuntament de Barcelona's open data service, is presented as a space optimized for all types of devices (PC, tablets and mobiles) in order to facilitate access to all users and visitors.

It is multi-language site (Catalan, Spanish and English) in its entirety and is licensed under CC BY (see Terms of use).

The header incorporates the official name Open Data BCN with the representative logo.

1.2 Home

The home page is structured in 5 sections:

  • Main bar: From where you can access all the information of the site distributed in the 8 concepts: About this site, Dataset catalogue, Present, Data Visualizations and Applications, Statistics, Developers, Agenda 2030-ODS and Project Diffusion.
  • Images: We use them to relate the portal with the city, its people and the projects and events more outstanding related to the Open Data Service.
  • Searchers: Designed to help you find the datasets. The search is enabled by words, based on the 5 main Themes in which the information is classified and also on the 17 SDGs of the 2030 Agenda for Sustainable Development.
  • Featured: Where the latest news, interviews, case stories and visualizations and apps are displayed, allowing the most recent activities of the site to be accessed by the user at a glance.
  • Citizen's space: Awhere users can register, ask questions, report incidents and write comments, as well as following up the trends in social networks.

1.3 About this site

All relevant information about Open Data BCN site is listed in the drop-down menu ‘About this site’, leading to 4 different pages:

  • Open Data BCN: Explains the mission and vision of the portal and its fit in the digital strategy of the Ajuntament de Barcelona (Barcelona city council).
  • Features of the Portal: Where you can get information about the functionalities and the technical features of the site.
  • Related initiatives: It reviews the different initiatives within and outside the City Council that may have some kind of relationship with the open data portal.
  • FAQs: Questions and answers about what is Open Data and the use of data.

1.4 Dataset Catalogue

The dataset catalogue is the main section of the Site, where users may find all information opened by Barcelona City Council in reusable formats.

The information is classified in 5 main topics: Administration, Urban environment, Population, Territory, Economy and Business which are also divided in sub topics.

The available filters make the selection of datasets more agile. Filtering is currently enabled by Tags (keywords), Formats, Licenses, geolocation, Update frequency, historical information, availability of the API CKAN, access tokens, Long Format and classification Agenda 2030-ODS.

The ordering of datasets is allowed by publication date (desc/asc) and popularity (desc/asc).

In the catalog main screen you can see for each dataset the title, the description, the theme / subtopic to which it belongs, the available formats, update frequency and the availability of historical information.

The catalog API is also accessible form this page. The information related to its operation can be found in the Developers Site.

1.4.1 Datasets

Once the dataset is selected, all the complete information of the dataset is shown: the metadata, additional information and field definition in “View complementary description and field definition”, the associated labels, the resources that compose it in the different available formats and the actions enabled on each one of them. Historical series are also included here if they have.

All resources can be downloaded, although in some cases, a 'key' within the 'Download' button indicates that an access token request is required for which an user account is necessary: My account. In the case of the .csv file format stored in the datastore, it is also possible to preview them in the form of a table, graphic or on a map, as well as access via API.

The preview initially shows a maximum of 100 records, and you can see the rest by substituting the desired value in the corresponding box. Keep in mind that the option 'Graph' shows the original data as they have been stored, not allowing any kind of calculation.

The .xls .xlsx formats allow the visualization of the resource with the Excel Online.

Regarding the token requirement and the API, all documentation is found in developer's site.

It is also enabled the functionality to embed the information displayed on the screen in other sites and reports, as well as share content in social networks.

It is also allowed to make comments on each dataset in order to establish a dialogue between the reusers of the same.

1.5 Present

The drop-down menu ‘Present’ contains links to Portal news, News, Interviews and Case Stories. It has two main goals: On the one hand to make known the changes and improvements that are periodically implemented in the portal, such as new sections or functionalities and the incorporation of new datasets. On the other hand, it wants to bring the culture of Open Data to the citizen, facilitating histories of use and all kinds of information related to open data.

1.6 Data Visualizations and Applications

It is the page that wants to publicize the projects that users work on and want to share on the portal. In the section 'Visualizations by themes' you can find the views of the datasets that have aroused the most representative interest on the part of the users.

1.7 Statistics

This section allows you to quantify the volume of data, the activity on the datasets, on the resources and the monthly activity registered by the portal. The link "More information" with direct access to the dataset Catalog of open data of the City Council of Barcelona - Open Data BCN allows to extend this statistical information.

  • Data volume: It shows the amount and the level of quality of the datasets published (, resources, formats and historical series of which Open Data BCN has. A classification of the data sets by theme and sub-theme and also by Main SDG assigned to each of them is also presented graphically.
  • Dataset Activity: A linear graph is shown with the evolution of publication of datasets, as well as lists with the last datasets added, modified, most visited recently (last 15 days) and most visited (since 23/02/2017 Inauguration of the new portal), most downloaded resources (by IP) (since 23/02/2017 Inauguration of the new portal) and most downloaded (Absolute values) (since 23/02/2017 Inauguration of the new portal).
  • Resource Activity: They are listed, the most downloaded resources in the last 15 days by IP and in absolute values.
  • Monthly activity on the portal: The indicators relating to visits, page views, percentage of bounces and average duration of the visit are presented. Three bar charts show visits per day, visits per local time, and page views per day. Visits are also shown graphically by device type (PC, mobile and others), by language (Catalan, Spanish and English) and by city/country. And finally, 3 more graphs with user requests, comments to the datasets and the evolution of the user registry.

It offers the possibility of downloading in .png format different graphic information of this page.

1.8 Reusers

It's the page that is meant to provide useful information for app developers and a more technical target audience.

1.9 Agenda 2030-ODS

Section dedicated to showing the integration between Open Data BCN and the 2030 Agenda for Sustainable Development.

1.10 Diffusion Projects

1.10.1 Barcelona Dades Obertes Challenge

Section with all the information regarding the Barcelona Dades Obertes Challenge, a contest that promotes the use of open data as an educational resource in the centers of the city of Barcelona.This challenge comes to an end with the celebration of the Fourth edition_2021.

1.10.2 World Data Viz Challenge Barcelona-Kobe

Section with all the information about the World Data Viz Challenge Barcelona-Kobe, an annual contest of creation of data visualizations that began being held on the occasion of the 25 years of twinning between the cities of Barcelona and Kobe (Japan) in 2018. The 2020 year edition is the last held.

2. Technical features


2.1. Introduction

The Ajuntament de Barcelona Open Data portal has been developed with a mixed installation of Drupal and CKAN on Ubuntu. The installed version of Drupal is 7.63 (with php 5.6) and the version of CKAN is 2.6.0, latest stable versions available in open source at the time of its creation.

2.2. CKAN

The Dataset Catalog section is the one that uses the CKAN software, which has been developed by the Open Knowledge Foundation.

The following open source CKAN extensions have been installed:

  • qa: This extension analyzes the resources of each of the CKAN datasets and gives them an "openness score" based on Tim Berners-Lee's five stars of opennes.
  • fluent:This extension provides a way to store and return multi-language fields in CKAN datasets, resources, and organizations.
  • hierarchy:Functionality for creating a hierarchy of organizations.
  • officedocs: Functionality for previewing Microsoft Office documents.
  • pdfview: Functionality for previewing pdfs.
  • report: Functionality that provides a reporting infrastructure.
  • scheming: This extension provides a way to configure and share CKAN schemas using a JSON schema description.
  • geoview: Functionality for previewing geospacing views in CKAN.
  • archiver: Extension that provides the user a cached copy in case of a broken link. It also tells the user is the links is broken.
  • drupal: Module developed by Open Data Canada. This module contains a paster command that allows you to generate the Drupal nodes for comments in the datasets.

In addition to these extensions, the developers of the portal have created two CKAN extensions that add required functionalities and are published in the Ajuntament de Barcelona's GITHUB.

On the one hand, odatabcn extension adds certain appearance customizations as well as some new functionalities, such as:

  • customizing the menu
  • customizing the dataset listing
  • customizing the dataset detail
  • customizing the resource detail
  • filter customization
  • calculating the number of downloads per resource
  • Drupal nodes loading for comments in datasets, related to Drupal Open Data Canada CKAN Packages
  • downloading the catalogue in CSV format

On the other hand, the federagobes extension generates an RDF file for the Open Data BCN catalogue according to the Technical Standard for Interoperability of technical resources to federate its datasets both in the portal and the European Data Portal.

2.3. Drupal

The home has been developed in Drupal, installing all the extensions necessary for the correct evolution of the portal, examples of these modules are the following:

  • Entity API: This module extends the Drupal kernel API to provide a unified way to deal with entities and their properties.
  • Multilingual content: Enables node options to create multilingual content.
  • Internationalization: Extends Drupal support for multilingual features.
  • Taxonomy: Enables the organization of content in categories.
  • RDF: Enriches content with metadata so that other applications (search engines, aggregators, etc.) better understand their relationships and attributes.
  • Variable: Provides a record for metadata about Drupal variables and API interfaces.
  • Views: It allows to create lists and queries to customized database.
  • Views Bootstrap: Bootstrap components.
  • Path Breadcrumbs: Allows you to create custom path-breadcrumbs.
  • CAPTCHA: CAPTCHA module for forms addition.
  • reCAPTCHA: Use the Google webservice reCAPTCHA to improve the CAPTCHA system.
  • Open Data Canada CKAN Packages: Comment module developed by Open Data Canada and that the team of developers has adapted to the characteristics of the Open Data BCN portal.
  • Sort comments: Allows you to modify the comments ordering.
  • Login Destination: Customize the destination to which the user is redirected after login and logout.
  • Login Disable: Allow the disabling of user logins by role.
  • LESS CSS Preprocessor: Allows themes or modules to use LESS files.
  • BCN Brand: Module to add the Corporate Bar of the Barcelona City Council.
  • Bcn_megamenu: Generates simple megamenu blocks.
  • Bcn_settings: Configures common settings for bcn modules.
  • Charts: A graphical API for Drupal that provides graphic elements and view integration.
  • Google Charts: Graphics integration module with Google graphics.

Regarding the implementation of the access tokens, we have developed a module called opendata_tokens which generates, stores and regenerates tokens per user, necessary for specified resources. It is also added to the GITHUB repository of the Ajuntament de Barcelona.