Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

errors/questions for sw_stuttgart mapping doc #81

Closed
ThorstenFroehlinghaus opened this issue Jan 24, 2025 · 9 comments
Closed

errors/questions for sw_stuttgart mapping doc #81

ThorstenFroehlinghaus opened this issue Jan 24, 2025 · 9 comments

Comments

@ThorstenFroehlinghaus
Copy link

The mapping document https://github.com/binary-butterfly/ocpdb/blob/main/docs/mapping/sw_stuttgart.md for the mapping between https://new-poi.chargecloud.de/SW-Stuttgart and https://api.mobidata-bw.de/ocpdb/api/public/v1/locations?source=sw_stuttgart needs some clarifications and changes:

https://github.com/binary-butterfly/ocpdb/blob/main/docs/mapping/sw_stuttgart.md#source-location:

id is mapped to location.uid, not to location.id

country is not transformed to an OCPI 3 digit language code. Is the mapping wrong or the mapping documentation?

owner is not mapped to location.operator

https://github.com/binary-butterfly/ocpdb/blob/main/docs/mapping/sw_stuttgart.md#source-stadtwerkestuttgartcoordinates:

latidute/longitude are mapped to lat/lon, not to latidute/longitude

https://github.com/binary-butterfly/ocpdb/blob/main/docs/mapping/sw_stuttgart.md#source-evse:

uid is not mapped to location.id. it is not mapped at all. should it be mapped?

id is mapped to evse.uid, but not to evse.evse_id

https://github.com/binary-butterfly/ocpdb/blob/main/docs/mapping/sw_stuttgart.md#source-connector

is is mapped to connector.uid, not to connector.id

@the-infinity
Copy link
Contributor

id is mapped to location.uid, not to location.id
uid is not mapped to location.id. it is not mapped at all. should it be mapped?
id is mapped to evse.uid, but not to evse.evse_id
id is mapped to connector.uid, not to connector.id

Hmm. Correct, but also an interesting point, where the OCPDB was never super-specific about the (u)id mapping, but I guess it's the moment to clear this. We somehow have the issue that the (u)id in OCPI cannot be guaranteed to be unique, because different data sources can have the same uid. I do see two solutions:

  1. prefix (u)ids with the source uid. Has a quite high risk of breaking the length of (u)id: it's usually 36, and a lot of platforms use 36 characters by using UUIDs. When we prefix a UUID, it's not OCPI compliant any more.

  2. introduce the non-standard-compliant original_(u)id as we do in ParkAPI, and output an own (u)id. Then we can output a proper (u)id generated by us, and therefore be sure that it's max 36 characters and unique. Extension with non-standard-parameters gets compliant with OCPI 2.3, which is not released yet.

I slightly prefer the second option. What do you think, @ThorstenFroehlinghaus?

owner is not mapped to location.operator

Ups. Copy paste issue.

latidute/longitude are mapped to lat/lon, not to latidute/longitude

Uh, that's an issue at the output, the current output is not OCPI compliant. The documentation is correct, just not the actual output: https://api.mobidata-bw.de/ocpdb/documentation/public.html#/schemas/Location . I do output both now, and will remove lat / lon after a migration period.

country is not transformed to an OCPI 3 digit language code. Is the mapping wrong or the mapping documentation?

That was also a general issue in the OCPI output compatibility.

Except for the (u)id question, everything is resolved in #82

@ThorstenFroehlinghaus
Copy link
Author

ThorstenFroehlinghaus commented Jan 24, 2025 via email

@the-infinity
Copy link
Contributor

does the uid attribute in https://api.mobidata-bw.de/ocpdb/api/public/v1/locations need to be unique?

It's not allowed according to OCPI. If we keep within standards, we have to remove it. Instead, I would say that we backport the upcoming custom attribute functionality OCPI 2.3 and call it original_id, to make clear that this is the unique id from our data source. This also applies to source: this is not part of the OCPI standard.

Holger suggested that it makes sense to support a strict URL parameter, to filter all non OCPI 2.2.1 compliant values. I like that idea, because it brings two worlds together: the need of additional fields which are required on a data gathering platform, and the ability to output strict OCPI.

The id attribute in https://api.mobidata-bw.de/ocpdb/api/public/v1/locations is our own attribute, so we can generate a unique id, right?

Yea, this is unique already (and has the wrong type, it has to be a string).

@ThorstenFroehlinghaus
Copy link
Author

ThorstenFroehlinghaus commented Jan 24, 2025 via email

@the-infinity
Copy link
Contributor

OCPI is a bit inconsitent there: at locations and connectors, the unique identifier is called id, at evses, the unique identifier is called uid. To keep the logic, I think it would be best to use original_ as a prefix, so original_id at location and connector, and original_uid at evse. The rule behind it would be the prefix which always relates to the field name which exists in the standard.

@ThorstenFroehlinghaus
Copy link
Author

ThorstenFroehlinghaus commented Jan 24, 2025 via email

@the-infinity
Copy link
Contributor

Addressed with version 1.3.0

@ThorstenFroehlinghaus
Copy link
Author

@the-infinity
Copy link
Contributor

Addressed here: #88

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants