noi-techpark / bdp-commons

Open Data Hub time series data collectors (legacy)
GNU Affero General Public License v3.0
2 stars 12 forks source link

As Province of Bolzano I would like to integrate the statistics of usage of the suedtirolRadelt APP in the Open Data Hub, so to create a web-component and visualize them #665

Open rcavaliere opened 9 months ago

rcavaliere commented 9 months ago

240524_SpecificheIntegrazione_NOI_v1.1.pdf

rcavaliere commented 9 months ago

@dulvui @clezag we should include this activity in the next sprint. If you have time, have a look at the specification document, on how we should integrate this dataset. I am still clarifying some open points with the Data Provider.

sseppi commented 9 months ago

We decided to externalize the development and @rcavaliere will manage the market research.

rcavaliere commented 6 months ago

@clezag @dulvui can you please support @Giacomo92 and @SanaviaNicolas in the implementation of their first Data Collector? They have some technical questions for you in relation on how certain aspects can be implemented. I would be ideal if you can arrange some short meeting with them in the next days. Thanks!

dulvui commented 6 months ago

@rcavaliere We had a short talk yesterday at the Open Data Hub day and we decided that we will have a meeting with them to clarify some aspects on how to write data to the Open Data Hub. Can you send me an email with their contacts? So I can arrange a video-call

Giacomo92 commented 6 months ago

240207_SpecificheIntegrazione_NOI_v1.pdf @rcavaliere I have just uploaded the specification document with some comments as we agreed in our last call.

rcavaliere commented 6 months ago

@Giacomo92 here the document with the clarifications, not in track change mode, but hope you find all clarifications to you doubts. Actually, they are all minor points.

240524_SpecificheIntegrazione_NOI_v1.1.pdf

Giacomo92 commented 6 months ago

I have just opened PR #669. Please let me know if it works correctly. @dulvui Here are some questions for @rcavaliere :

rcavaliere commented 6 months ago

@Giacomo92 many thanks. We will integrate the PR at the beginning of next week, than I will provide you a feedback to these 2 points

dulvui commented 5 months ago

@rcavaliere @Giacomo92 I deployed now the first version of the data collector in testing Here the first visible GamificationAction stations https://mobility.api.opendatahub.testingmachine.eu/v2/flat,node/GamificationAction/

And here the CompanyGamificationAction stations, but no data is visible here yet https://mobility.api.opendatahub.testingmachine.eu/v2/flat,node/CompanyGamificationAction/

sseppi commented 5 months ago

Uau nice to see a new Dataset in the Open Data Hub.

@rcavaliere once we put online the new collector, we need to add the Dataset into the MetaData API to see it in the Dataset List on the Data Browser and the Open Data Hub website. There we need the following information:

rcavaliere commented 5 months ago

@Giacomo92 can you please check this implementation? The source should provide data for both type of stations! More in detail:

Giacomo92 commented 5 months ago

@rcavaliere

In the case of GamificationAction, we have just the station description but no types and data associated to it.

Ok I think it depends on the parameters that were passed in the API, if you can tell me which data you are interested in, I will already set the correct parameters on the API call

Moreover we still need to agree on the "position" data provision (via the CSV) file

_challengeid, latitude, logitude for GamificationAction _organisationid, latitude, logitude for CompanyGamificationAction

the fields "start", "end", "registrationStart", registrationEnd" in the metadata should be converted in a user-friendly format before stored

Which format do you prefer? I chose the timestamp by looking at other implementations in the repository

in the case of CompanyGamificationAction we have no stations stored, and of course no types and data associated

Ok I think it depends on the parameters that were passed in the API, if you can tell me which data you are interested in, I will already set the correct parameters on the API call

rcavaliere commented 5 months ago

Ok I think it depends on the parameters that were passed in the API, if you can tell me which data you are interested in, I will already set the correct parameters on the API call

As already described in the specification document, these are the types to be associated to a station = GamificationAction:

Screenshot from 2024-06-07 17-13-11

challenge_id, latitude, logitude for GamificationAction organisation_id, latitude, logitude for CompanyGamificationAction

OK, but where should I put this information? Can you create a CSV file (or similar), so that I fill in the positions?

Which format do you prefer? I chose the timestamp by looking at other implementations in the repository

Please use this kind of format, as you can see there for the dateTime fields: https://mobility.api.opendatahub.com/v2/flat,node/BikesharingStation/*/latest

Ok I think it depends on the parameters that were passed in the API, if you can tell me which data you are interested in, I will already set the correct parameters on the API call

Please have a look at the specification document, consider what provided in the paragraph COMPANY GAMIFICATION ACTIONS

I put the specification document again here. Please let me know in case of doubts, in case let us have a quick call

240524_SpecificheIntegrazione_NOI_v1.1.pdf

dulvui commented 4 months ago

@rcavaliere @Giacomo92 Also the measurements are now visible here

CompanyGamificationAction https://mobility.api.opendatahub.testingmachine.eu/v2/flat,node/CompanyGamificationAction/*/latest?where=sactive.eq.true&limit=-1

GamificationAction https://mobility.api.opendatahub.testingmachine.eu/v2/flat,node/GamificationAction/*/latest?where=sactive.eq.true&limit=-1

rcavaliere commented 4 months ago

@dulvui thanks for the update. I have checked the data flowing in our testing environment, and I have seen following aspects that need to be fixed:

@dulvui let me know if this something you can easily fix, otherwise we will ask @Giacomo92 to have a look at it.

dulvui commented 4 months ago

@rcavaliere I fixed now both issues

I also saw that now that there are two urls we use currently https://www.suedtirolradelt.bz.it/dashboard/api/opendata/challenges https://www.altoadigepedala.bz.it/dashboard/api/opendata/challenges

One url gives the results in German and the other in Italian. The German is currently used to get companies data and the Italian on for the challenges data. Is this okay and no problem if there are multiple languages or should I use only Italian or German? Using both for both calls would also be possible, but for that some additional work is needed for mapping and the data structure has to be defined on how both languages will be mapped.

rcavaliere commented 4 months ago

@dulvui thanks for the feedback. For the multilingual aspect, thanks for the input. If feasible, I would consider this just for the names of the stations. Can you implement this?

dulvui commented 4 months ago

@rcavaliere Okay I'll try to get use both languages for the names, and for the rest I'll only use one. Should not be too complicated, because I just need to make one more call with the other language and merge the 2 names to one, for the rest I'll not change anything.

rcavaliere commented 4 months ago

@dulvui thanks. However consider for the two type of stations the same language! Let's use German....

rcavaliere commented 4 months ago

@dulvui @Giacomo92 another thing: can you put me the link to the file for the provision of the coordinates of the stations?

Giacomo92 commented 4 months ago

Hello, thanks @dulvui for the fixes. @rcavaliere this is the links:

dulvui commented 4 months ago

@rcavaliere station names are now in German and Italian

rcavaliere commented 4 months ago

@dulvui perfect, now the open points are closed

rcavaliere commented 4 months ago

@dulvui please don't put this Data Collector in production, we need first to sign the Data Sharing contract with STA, owner of Suedtirol Radelt APP

rcavaliere commented 2 months ago

@dulvui @clezag can you check if the Data Collector is consuming the right points? We don't get data since 12.8, and the measurement associated to CompanyGamificationAction is nearly not available. Can you please check? I think the problem could be just in the reference to the right end-points?

The correct ones (please check the specs in the user story description): https://www.suedtirolradelt.bz.it/dashboard/api/opendata/challenges https://www.suedtirolradelt.bz.it/dashboard/api/opendata/organisations

clezag commented 2 months ago

@rcavaliere The data collector was permanently stuck doing the API request. Seems that the library used does not use a timeout per default. I've set a timeout of 30 seconds, so let's see if this crops up again. For now, since it's been restarted, it's collecting data again

rcavaliere commented 2 months ago

@clezag thanks for this. If I look at the measurementhistory table it seems to me that we just imported one record for each type, and then the Data Collector did not import any other data. Is there any logic that prevents the storage of new data every time the API is read? We could set here a hourly update of the data, we don't need this more frequently

clezag commented 2 months ago

@rcavaliere The issues are twofold I think:

I think to avoid data duplication, we can leave 1) as it is, so that only when something changes, a measurement is written

rcavaliere commented 2 months ago

@clezag then please clean up all the DB in the testing environment, use as key the challenge ID and try to redeploy it. Thanks!

clezag commented 2 months ago

@rcavaliere Now up in testing. I've removed the old data. The stationcode is now organization_id + challenge_id (I mistakenly wrote only challenge_id above, which is not unique)

rcavaliere commented 2 months ago

@clezag thanks a lot. In measurementhistory I currently see just one value per type in measurementhistory, but it could be that nobody used the Suedtirol Radelt APP yesterday afternoon and registered new kilometers... let's see in the next days if new data is entering, otherwise it could be that we have still things to fix.

rcavaliere commented 1 month ago

@clezag everything tested here and contrat signed, we can put in production

clezag commented 1 month ago

@rcavaliere deployed in production

sseppi commented 1 month ago

@rcavaliere can you please share with us the information to create the dataset on our website?

We need:

Thanks