NOTE: ThisNOTA: Questo Task helps me inche mi aiuta a tracking an upstream bug in aciare un bug nel dataset del MiSE's Open Data dataset sui prezzi delle stazioni di rifornimento italiane. Here furtherQui ulteriori infoormazioni.
== Preamble (why I've found this issuemessa (perché ho trovato questo problema) ==
In 2015 I developed just another Italian fuel pumps comparator during a 24H hackaton promoted by a notable Italian insurance companyNel 2015 ho sviluppato un altro comparatore di pompe di benzina italiane durante un hackaton 24H promosso da una nota compagnia assicurativa italiana. Here theEcco il projectgetto: https://fuel.reyboz.it/. It's made with glue andÈ fatto con colla e spaghetti but it worked enough and we wonma ha funzionato abbastanza e abbiamo vinto. But this project is not the pointMa questo non è il punto.
ThatQuel tool was obviouslyera ovviamente based on aato su un dataset provided from thefornito dal [[ https://en.wikipedia.org/wiki/Ministry_of_Economic_Development_(Italyia) | MiSE - the Italian Ministry ofMinistero dello Sviluppo Economic Developmento ]]. WellBene, that dataset was borked since 2015 but now (~~2021~~ 2022) it's somehow even //more// borked and I don't have enough time to hotfix it every dayquel dataset era corrotto dal 2015 ma ora (~~2021~~ 2022) è in qualche modo ancora //molto più corrotto.
In shortIn breve, I'm sure thatsono sicuro che in a better world theun mondo migliore il MiSE should fix itsdovrebbe sistemare il suo dataset. TheIl problem is that I'm not able toa è che non sono stato in grado di contact thettare il MISE in any waynessun modo. I tried from the oHo provato dal sito ufficial website and triede e ho provato via social, and I triede ho provato via phonetelefono, but theirma i loro bugs in their nel loro dataset are still theresono ancora lì.
MoAltre FAQs::
* No, I have notnon ho violated any security systemo nessun sistema di sicurezza
* No, that was not a protectednon ho manipolato un settore di memory sectoria protetto
* No, I've not destroyed or damaged any synon ho distrutto o danneggiato alcun sistema
* It's just a borked* È solo un dataset and everyone in the world can see it's NOT my fault if it's borkedcorrotto e chiunque nel mondo può vedere che NON è colpa mia se è così
* Who has the ability to fix? The MISE.* Chi ha la capacità di riparare? Not meIl MISE.
== Steps to re== Passi per riproduce ==rre il problema ==
1. Download thScaricare il file [[ https://www.mise.gov.it/images/exportCSV/anagrafica_impianti_attivi.csv | anagrafica_impianti_attivi.csv ]] from [[da https://www.mise.gov.it/index.php/it/open-data/elenco-dataset/2032336-carburanti-prezzi-praticati-e-anagrafica-degli-impianti | Italian fuel pump dataset - MiSE ]]
2. Open withAprire con LibreOffice (set theimpostare il separator to the semicolon - Yes, I knowe sul punto e virgola - Sì, CSV means //comma// separated valueslo so, but they use a semicolonCSV significa letteralmente valori separati da //comma// (virgola) e invece loro usano usano il punto e virgola. Please don't fight about thisPer favore non litigate per questo. This is not my coreQuesto non è il nostro problem.)a principale.
3. Note that theNotate che il dataset is borked at least on the è corrotto almeno sull'ID `46593` (linea 29) on a rowsu una riga related toiva a `MEGA SERVICE S.A.S.`
Quick overviewPanoramica rapida (scroll to lineorrere fino alla riga 29):
{P17, lines=40, highlight=29}
IMPORTANTE: Note that unclosed `"`. It doesn't take hours of CSV inspectionta che non è chiuso `"`. It's already on line 29Non ci vogliono ore di ispezione del file. You really cannot say that you have not noticed itÈ già alla linea 29 su svariate migliaia.
== Problema n. 1 ==
TheIl MiSE clearly is not using a suitable library tohiaramente non sta usando una libreria adatta per generate are un CSV and thise questo causes aa un dataset malformed datasetato.
Solution:zione:
PleaseSi prega di adopt a //real// CSVttare un //vero// standard CSV. For examplePer esempio, do not just use a semicolon as glue for your raw datanon usare un punto e virgola come collante per i tuoi dati grezzi.
Reference:Riferimento:
* https://en.wikipedia.org/wiki/Comma-separated_values onsu Wikipedia
* https://www.php.net/manual/en/function.fputcsv.php foper PHP
* https://pythonspot.com/files-spreadsheets-csv/ foper Python
* http://commons.apache.org/proper/commons-csv/ foper Java
* ...
== Problema n. 2 ==
TheIl MiSE is not properly cleaning user inputnon sta ripulendo correttamente l'input dell'utente.
Please `trim` your values and remove doublePer favore ripulite i valori dell'utente rimuovendo i doppi spaceszi. RemovRimuovendo le tabsulazioni. RemoveRimuovendo i newlines. Remove all the shitRimuovendo tutto lo schifo dell'utente.
Example: avoid someone called "` Mario Rossi `" (note spaces at the beginning and at the end and in the middle)sempio: evitate qualcuno chiamato "`Mario Rossi `" (notare gli spazi all'inizio e alla fine e nel mezzo). Di questi esempi il dataset è intasato. E non possiamo correggerlo noi perché viene sovrascritto ogni mattino e non si capisce come contribuire.
== Problema n. 3 ==
"CSV" meanssignifica "//comma//-separated values" butma MiSE generates //semicolon//-separated values.
Proposed solutionSoluzione proposta: wontfix. It's too late to change that nowÈ troppo tardi per cambiarlo ora.
Even if it's too late to fix thisAnche se è troppo tardi per risolvere la cosa, it is not too late tonon è troppo tardi per inform peoplare la gente: please remember that theer favore ricordate che la `C` in `CSV` meanssignifica `COMMA` and note non `SEMICOLON`.
== Proposed solution for all of these== Soluzione proposta per tutti questi 3 problems ==i ==
Adopt whatever CSVAdottare qualsiasi libraryreria CSV, instead of just usinginvece di usare semplicemente ";" as glue between whatever raw valuecome collante tra qualsiasi valore grezzo.
This will fix a very badQuesto risolverà un approccio di programming approach that is actuallyazione non ideale che sta effettivamente compromising that MiSE'settendo il dataset every daydel MiSE ogni giorno, at least sincealmeno dal 2015.
== In the meanwhile ==Inoltre, sarebbe carino spiegare alle persone come viene creato questo dataset e come correggere un problema.
Someone should== Nel frattempo ==
Qualcuno dovrebbe contact the fuel pumpttare la pompa di benzina `MEGA SERVICE S.A.S. DI TERMINI MICHELE &C 123 di Licata, Km. 15+500, LICATA 92023 AG` asking them to kindly remove thechiedendo loro di togliere gentilmente il `"` from their namedal loro nome, since thedato che il MiSE cannot handle thatnon può gestire quel case without breaking the wholeo senza rompere tutto il dataset for yearsper anni.