bundestag / gesetze-tools

Scripts to maintain German law git repository
GNU Lesser General Public License v3.0
114 stars 21 forks source link

🔧 [Refactor] Raw data standard format #37

Open ulfgebhardt opened 3 years ago

ulfgebhardt commented 3 years ago

:zap: Refactor ticket

We should store the raw data (json) in a standard format. I propose the one generated by the https://github.com/bundestag/scapacra-bt scraper tool. All data objects have the following structure in common:

{
  "meta": {
    "url": "https://www.bundestag.de/abgeordnete/biografien/A/517818-517818"
    ...
  },
  "data": {
    "id": "517818",
    ...
  }
}

So basically the object is split into a meta and a data part. The meta part holds at least an url field while data definies at least an id field.

Motive

We want to unify stuff and make it easy to understand and parse. Maybe you want to match laws with deputies and named polls or what not. Having a similar structure might help people do that.

Additional context

Example: https://github.com/bundestag/DeputyProfiles/blob/master/data/517818.json

image

darkdragon-001 commented 3 years ago

I am not convinced by this proposal because of the following reasons (experience mostly on my work in BGBl scraper parsing a table of contents tree):

Furthermore, different data needs to be handled differently anyways and one has to thoroughly identify what which field means anyway when working with the data. Properties with too generic names often lead to false assumptions when interpreting data.

Nevertheless, the output data structure should be documented in the README.md.