Brazilian Laws: Modeling the Brazilian legislation in Wikidata

Screenshot of the tool WikiProject Brazilian Laws Legislation Importer tool on Toolforge.

For the first time, the Brazilian legislation (about 28 thousand laws and decree-laws) is available in an open, structured and semantic platform. The Brazilian Constitution of 1988, in its sole paragraph of Article 1 says “All power emanates from the people, who exercise it by means of elected representatives or directly, as provided by this Constitution“. In order to fully exercise the power, people should have at their disposal all the information available, and for that to happen, the data and metadata released by the government should be open, that is, anyone should be able to access, use, analyze and share, without any control mechanism.

The main goal of open data is to promote transparency. When it comes to government actions, open data is an important initiative to ensure accountability of government officials, and provide the society with tools to obtain knowledge about itself and its rules is essential in the ideal democratic process. Therefore, by the definitions presented, the Brazilian legislation is not transparent nor open, as they aren’t available in open formats that allow anyone to access, use, analyze or share it.

Meaning to solve this problem, or at least minimize it, a project for WikiCite was initiated in November of 2020 with the goal of uploading to Wikidata all the data and metadata for the Brazilian legislation, available in official sources. In total, around 28 thousand items were created. That brought Brazil to third place in number of legislation items on Wikidata among other countries.

The scripts and the process we developed to execute this task are shared in the WikiProject page and a handout, so others can follow and adapt it to their own projects (around legislation items or not); We think these documentations can help other communities and projects as a guide on how to model and upload their information. We also developed a tool on Toolforge to facilitate the importation of new items of Brazilian legislation into Wikidata, so the users don’t have to manually create the items and find the properties generally used.

Video tutorial on how to navigate and use the WikiProject Brazilian Laws Legislation Importer

This project was a great opportunity to develop a clear methodology and explore different solutions to problems, especially when scraping data and metadata. For the future, we hope to coordinate with the Wikisource community members and others institutions interested in this topic to work on the importation of the texts of the Brazilian legislation on that project, which could enable deeper analysis of their contents in a simple, open, and queriable platform.