4

I can already find data about Brazilian cities/states (e.g. population, localization, crime rates etc...), on some websites such as the government's open data portal and census data (which unfortunately is a mess).

Is there any API for this information, that would make it easier to query?

2 Answers 2

3

Both the Brazilian Community CKAN instance http://br.ckan.net/dataset and the Brazilian Government's official Data Portal (CKAN-powered) which you link to, have APIs.

There's also the World Bank API: http://data.worldbank.org/

2

You could use dbpedia and its sparql endpoint for this. The following SPARQL query would return all metrics except crime rates, you asked for.

PREFIX dbo: <http://dbpedia.org/ontology/> 
PREFIX dbr: <http://dbpedia.org/resource/>
PREFIX dbp: <http://dbpedia.org/property/>
SELECT * WHERE { 
?city rdf:type dbo:City . 
?city foaf:isPrimaryTopicOf ?wikipediaPage .
?city dbo:country dbr:Brazil .
?city rdfs:label ?cityLabel .
?city dbp:populationTotal ?population .
?city <http://www.w3.org/2003/01/geo/wgs84_pos#long> ?longitude .
?city <http://www.w3.org/2003/01/geo/wgs84_pos#long> ?latitude .
}

All the attributes that are mentioned in for example the dbpedia entry of Sao Paolo are available through sparql queries.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.