noi-techpark / it.bz.opendatahub.databrowser

Explore and navigate through Open Data you need to build your next service.
https://databrowser.opendatahub.com
GNU Affero General Public License v3.0
9 stars 7 forks source link

WebcamInfo Model changes #425

Closed RudiThoeni closed 11 months ago

RudiThoeni commented 1 year ago

Hi all

With the Webcam Import of different Datasources, I had to make some changes to the WebcamInfo Datamodel.....

Changes:

GpsInfo (object) to GpsInfo (array of objects) (like on ODHActivityPoi and other Endpoints, eliminated this case that was only here)

Added:

WebcamProperties  --> new Object see Swagger
Detail  --> known Object
ImageGallery  --> known Object
ContactInfos  --> known Object
VideoItems  --> known Object

Set to readonly (compatibility reasons)

Webcamurl --> refers to WebcamProperties.WebcamUrl  
Streamurl --> refers to WebcamProperties.StreamUrl  
Previewurl --> refers to WebcamProperties.PreviewUrl
Webcamname --> refers to WebcamProperties.Detail.Language.Title

Can this changes be adapted to the Databrowser configured view of webcams?

RudiThoeni commented 1 year ago

I eliminated the case 2 listed here https://github.com/noi-techpark/it.bz.opendatahub.databrowser/issues/117 because it was only present on WebcamInfo Model

gappc commented 1 year ago

@RudiThoeni thanks for the notice.

I took a look at the model, some questions came up:

It would be nice if we could schedule a short meeting to discuss the open questions.

To answer your question about Data Browser adaption: yes, of course we can adapt :) The changes required depend on whether they affect only the /v1/WebcamInfo endpoint.

Is there some deadline we need to meet?

RudiThoeni commented 1 year ago

The main reason of changing GpsInfo (object) --> GpsInfo (array) was to reduce complexity and remove this one exception used on WebcamInfo only.... see the referred issue (Case 2)......https://github.com/noi-techpark/it.bz.opendatahub.databrowser/issues/117

cheers Rudi

RudiThoeni commented 1 year ago

Here some mails between Sergio, You and me last year about this GpsInfo object mismatch.... where we made a quick hack to solve.........


From: Rudolf Thoeni, NOI Sent: Friday, August 12, 2022 11:04 To: Sergio Evola evola.sergio97@gmail.com Cc: Christian Gapp gapp.christian@gmail.com Subject: RE: WebcamInfo file config

Hi Sergio

I have done a quick hack and added an additional field “GpsInfos” which is a list…. (https://api.tourism.testingmachine.eu/v1/WebcamInfo)

I had to use a new dield because otherwise I would break the current api……… but I think on the databrowser the field name is configurable, so you can use the GpsInfo component to visualize?

I will open a Github issue for GPS stuff because here we have some inconsistences in the api and we need to do further investigation on how to solve….

cheers

-- Digital Technologies Rudi Thoeni

T +39 0471 066 673 r.thoeni@noi.bz.it

NOI Techpark Südtirol / Alto Adige A.-Volta-Straße / Via A. Volta, 13A I-39100 Bozen / Bolzano www.noi.bz.it

From: Sergio Evola evola.sergio97@gmail.com Sent: giovedì, 11. agosto 2022 18:00 To: Rudolf Thoeni, NOI r.thoeni@noi.bz.it Subject: Re: WebcamInfo file config

Thank you, Rudi, that would help for the development of the new DataBrowser.

Best, Sergio.

Il giorno gio 11 ago 2022 alle ore 17:56 Rudolf Thoeni, NOI [r.thoeni@noi.bz.it](mailto:r.thoeni@noi.bz.it) ha scritto:

Hi Sergio

Thx for the explanation i will have a look at it tomorrow, maybe I can change it,

cheers

-- Digital Technologies Rudi Thoeni

T +39 0471 066 673 r.thoeni@noi.bz.it

NOI Techpark Südtirol / Alto Adige A.-Volta-Straße / Via A. Volta, 13A I-39100 Bozen / Bolzano www.noi.bz.it

From: Sergio Evola [evola.sergio97@gmail.com](mailto:evola.sergio97@gmail.com) Sent: giovedì, 11. agosto 2022 17:45 To: Rudolf Thoeni, NOI [r.thoeni@noi.bz.it](mailto:r.thoeni@noi.bz.it) Subject: Re: WebcamInfo file config

Hi Rudi,

In the WebcamInfo dataset GpsInfo is not stored into a list as you can see. This causes problems with the component in the databrowser. Is this how it's supposed to be?

ODHActivityPOI:

"GpsInfo": [ { "Gpstype": "position", "Altitude": 1413, "Latitude": 46.5575176279939, "Longitude": 11.7262208461761, "AltitudeUnitofMeasure": "m" } ], WebcamInfo:

"GpsInfo": { "Gpstype": "position", "Altitude": null, "Latitude": 46.682945, "Longitude": 11.122952, "AltitudeUnitofMeasure": null },

Il giorno gio 11 ago 2022 alle ore 17:40 Rudolf Thoeni, NOI [r.thoeni@noi.bz.it](mailto:r.thoeni@noi.bz.it) ha scritto:

Hi

This is a "historical" issue I had to introduce using Postgres...........

GpsInfo is always stored as a list List

In order to realize Geosorting on Postgres I had to change from a List to a Dictionary so that I can access the right Gps Info via the Dictionary key GpsPoints is a Dictionary Dictionary<key, GpsInfo>

But, in the Data Model the Dictionary GpsPoint has only a GETTER which takes the GpsInfoList and returns it as Dictionary, The GpsPoint List has a SET + GET and the info is stored there....

So the info is identical, and up to the user which he wants to use.....

For the Databrowser I think the GpsInfo field component is enough,

cheers

-- Digital Technologies Rudi Thoeni T +39 0471 066 673 r.thoeni@noi.bz.it

NOI Techpark Südtirol / Alto Adige A.-Volta-Straße / Via A. Volta, 13A I-39100 Bozen / Bolzano www.noi.bz.it

-----Original Message----- From: Christian Gapp [gapp.christian@gmail.com](mailto:gapp.christian@gmail.com) Sent: giovedì, 11. agosto 2022 16:42 To: Sergio Evola [evola.sergio97@gmail.com](mailto:evola.sergio97@gmail.com) Cc: Rudolf Thoeni, NOI [r.thoeni@noi.bz.it](mailto:r.thoeni@noi.bz.it); Stefano Seppi, NOI [s.seppi@noi.bz.it](mailto:s.seppi@noi.bz.it) Subject: Re: WebcamInfo file config

Hi Sergio,

unfortunately there is no component for "GpsPoints", but there is one for the details of "GpsInfo" (https://github.com/noi- techpark/it.bz.opendatahub.databrowser/blob/development/databrowser/src/domai n/cellComponents/components/cells/gpsListCell/GpsListCell.vue).

@Rudi: what's the difference between the two?

@Sergio: could you please open up a GitHub discussion where we can share that and related information and discuss on how to implement such a component for table/detail/quick/edit views?

Thx Christian

On 11.08.22 16:34, Sergio Evola wrote:

Hey Christian, My mistake according to the designs of the list view, the webcams dataset doesn't need a location in the view, instead, it needs GPS. In this case, is there a CellComponent I can use for it?

Ex:

|"GpsPoints": { "position": { "Gpstype": "position", "Altitude": null, "Latitude": 47.0496988, "Longitude": 12.1266379, "AltitudeUnitofMeasure": "m"} },|

Il giorno gio 11 ago 2022 alle ore 16:20 Christian Gapp <gapp.christian@gmail.com mailto:[gapp.christian@gmail.com](mailto:gapp.christian@gmail.com)> ha scritto:

Hi Sergio,

that's something like a foreign key relation, which is not resolved yet
for the table / detail view.

In the edit view that's also a problem, there I implemented the
InputReferenceCell
(https://github.com/noi-

techpark/it.bz.opendatahub.databrowser/blob/development/databrowser/src/domai n/cellComponents/components/cells/inputReferenceCell/InputReferenceCell.vue

https://github.com/noi-techpark/it.bz.opendatahub.databrowser/blob/de velopment/databrowser/src/domain/cellComponents/components/cells/input ReferenceCell/InputReferenceCell.vue)

which could be used as template for a new render component (please be
aware that the InputReferenceCell itself is not perfect and has some
rough edges - feedback is welcome).

If you're interested, it would be very helpful if you could take on the
task to implement such a component. The best place to start would be to
open a discussion on GitHub with a short problem description and a
sketch of the solution. If you're not interested that's fine, too -
just
let me know ;)

Thx,
Christian

On 11.08.22 16:05, Sergio Evola wrote:
 > Hi Christian,
 >
 > I was working on the Webcams config files, and I noticed that the
 > location is not specified directly in the records; instead it
gives the
 > municipality ID that then should be resolved inside the municipality
 > dataset.
 >
 > Example:
 >
 > "WebcamAssignedOn": [ { "Id": "99a8b1d4a8d64303b1b965aa7c20fa60",
 > "Type": "Municipality", "LastChange": "2021-03-04T09:47:27.3317404"
 >
 > }
 >
 > In the databrowsers is this already implemented, in a way that I
can use
 > this ID in the listview config file? best regards, Sergio.
 >
gappc commented 1 year ago

@RudiThoeni thank you for the answers

@sseppi we need to add this to our planning

gappc commented 1 year ago

@RudiThoeni while implementing the changes I saw that VideoItems is required on the WebcamInfo endpoint, while it is not required on the ODHActivityPoi endpoint. Note that the OpenAPI specification does not say that it is required (see definition of WebcamInfo type on https://api.tourism.testingmachine.eu/swagger/index.html).

The screenshot below shows the error while saving an existing Webcam record.

image

Steps to reproduce:

  1. log in into the Data Browser on the TEST environment (https://databrowser.opendatahub.testingmachine.eu) to be able to modify a Webcam record
  2. open https://databrowser.opendatahub.testingmachine.eu/dataset/edit/tourism/v1/WebcamInfo/11F3689902134955A087F384CB8B3E11#Webcam%20Details
  3. change the record, e.g. put the number 1 into the Altitude field
  4. try to save => error shows

Should I handle VideoItems on the WebcamInfo endpoint as required or non-required?

RudiThoeni commented 1 year ago

Hi @gappc Thx for figuring it out, i forgot to set it explicitely as nullable..... should now be ok, https://github.com/noi-techpark/odh-api-core/commit/e002cdce98cb848fb4cab6b764c9e5807d68ea90

gappc commented 1 year ago

@RudiThoeni thank you for the quick fix, now it works :+1:

gappc commented 12 months ago

Hey @RudiThoeni, I still struggle a bit to get to the bottom of the topic.

Given our discussion in #117 I thought that all GPS related info except GpsPoints is obsolete. For sure I missed the part where you say "When it comes to Edit, here i have to think more about it..."

To eliminate misunderstandings, here is what I think I understood so far:

If my assumptions are correct, I think we need further adjustments to the endpoints, e.g. Accommodation has a GpsPoints property, but it has no GpsInfo array that could be modified.

Given that there are still some differences in the endpoints, I think we need to:

What's your opinion on this? Did I miss something?

RudiThoeni commented 12 months ago

Hi @gappc

Your assumptions are right, at the moment we have

Maybe this is a good opportunity to clean up this whole GPS Mess....... and to switch completely to the GpsPoints Property (Edit and Visualization) and mark all other as obsolete, set it to readonly..... and to ensure that

What you think about it? We need to coordinate this changes between Api / Databrowser in a good way

Maybe we can have a short meeting this week to discuss this?

gappc commented 11 months ago

Hi @RudiThoeni, yes I agree, it would be good if we could agree on one model, the one you mentioned seems reasonable. I'll write you a email to schedule a meeting :+1:

RudiThoeni commented 11 months ago

We defined on our meeting:

I will write when the field GpsPoints is set from readonly to writeable. All other fields (flat Latitude,Longitude....... GpsInfo etc... will be set to readonly)

gappc commented 11 months ago

The changes are merged as of commit f3c0bd9cc38e17e1f40dd1662792ccb652d1c92c

@sseppi @RudiThoeni please check (e.g. https://databrowser.opendatahub.testingmachine.eu/dataset/table/tourism/v1/WebcamInfo) and close this issue if it's ok

sseppi commented 11 months ago

I had a look and it seems to be fine from my point of view. @RudiThoeni what do you think? Can we close this issue?

RudiThoeni commented 11 months ago

@gappc @sseppi looks good, issue can be closed, let me know when the current databrowser version is/will be deployed on prod, because i have also to update data/api on prod at the same time

RudiThoeni commented 11 months ago

As mentioned in issue https://github.com/noi-techpark/it.bz.opendatahub.databrowser/issues/435 we will use GpsInfo as the field where GPS Info is stored