Developers

APIS available

The Open Data portal of the Diputación Provincial de Badajoz has a set of commands and functions served through an API (Application Programming Interface) REST as a way to simplify the operations on the different elements that make up the data portal open, as well as provide developers with access and manipulation of structures and data sets through programming. The implemented API is the one that is incorporated by CKAN. Some of the examples of the methods implemented by this are:

In addition, the CKAN API also has a Python library that collects all its methods. The full documentation of it is available at: http://docs.ckan.org/en/latest/api/index.html

On the other hand, each element identified by a URI is served in RDF / N3 format from its own application. For example, to obtain the serialization of the pour point whose identifier is number 4: https://datosabiertos.dip-badajoz.es/get/datos/urbanismo-e-infraestructuras/puntos-vertido/Puntos_Vertido/4

SPARQL point

The open data portal of the Diputación Provincial de Badajoz also has a SPARQL query point, which allows you to use this language to consult the information serialized in RDF and stored in the Triplestore. The result of the queries can be returned in HTML, XML, JSON, Javascript, NTriples, RDF / XML, CSV and TSV formats.

The point of consultation is available at: https://datosabiertos.dip-badajoz.es/sparql

Some examples of consultation are the following:

  • Obtain the name, type and surface of all the health centers in the province:

select ?ba_nombreCentroAsistencial ?ba_tipoCentroAsistencial ?ba_superficieCubierta where{ ?uri a ba:CentroAsistencial. ?uri ba:nombreCentroAsistencial ?ba_nombreCentroAsistencial. ?uri ba:tipoCentroAsistencial ?ba_tipoCentroAsistencial . ?uri ba:superficieCubierta ?ba_superficieCubierta . }

  • Obtain the length, diameter, state and coordinates of the sanitation branches of the province:

select ?ba_longitudRamal ?ba_estado ?ba_diametro ?schema_line where{ ?uri a ba:RamalSaneamiento. ?uri ba:longitudRamal ?ba_longitudRamal. ?uri ba:estado ?ba_estado. ?uri ba:diametro ?ba_diametro. ?uri schema:line ?schema_line. }

  • Obtain the municipality code, the name and the type of town hall in the province:

select ?ba_codigoMunicipio ?ba_nombreCasaConsistorial ?ba_tipoCasaConsistorial where{ ?uri a ba:CasaConsistorial. ?uri ba:codigoMunicipio ?ba_codigoMunicipio. ?uri ba:nombreCasaConsis ?ba_nombreCasaConsistorial. ?uri ba:tipoCasaConsis ?ba_tipoCasaConsistorial. }