VForWaTer / metacatalog

Modular metadata management platform for environmental data.
https://vforwater.github.io/metacatalog
GNU General Public License v3.0
3 stars 1 forks source link

JSON details NaN #149

Closed AlexDo1 closed 3 years ago

AlexDo1 commented 3 years ago

I just wanted to load some (Bühlot) details in metacatalog and got an error.

The column ID_Buhlot I load into details contains some NaN values, resulting in the following error:

InvalidTextRepresentation: invalid input syntax for type json
LINE 1: ...hesaurus_id) VALUES (4, 'ID_Buhlot', 'id_buhlot', '{"__liter...
                                                             ^
DETAIL:  Token "NaN" is invalid.
CONTEXT:  JSON data, line 1: {"__literal__": NaN...

I didn´t do much research but it looks like JSON does not support NaN by default (?).

mmaelicke commented 3 years ago

Yeah, the JSON value would be null I think, but the main idea of a document-centric data structure like JSON is to omit anything that does not have a value.

What details are added, that do not have values?

AlexDo1 commented 3 years ago

In this case, only the Buhlot_ID detail contains NaN for some entries Buhlot_ID could also be stored as external_id, but there is also the ID_V4W column, which I store as external_id at the moment.

Now that I look at it again, Buhlot_ID looks more 'external', we should maybe use that as external_id, but I was going to ask you that anyway.

mmaelicke commented 3 years ago

Yeah, take Buhlot_ID and add the other one only as detail if it is present

AlexDo1 commented 3 years ago

Okay, I will do that.

mmaelicke commented 3 years ago

@AlexDo1 Then, there is no real issue with the details, right? I will close the issue, you can re-open if I got you wrong