Open f-innatech opened 5 days ago
Hey @f-innatech sorry to hear that. I can reproduce this locally. I will let you know once i found the reason.
The tutorial may not be very clear. If you are only uploading the metadata, you should not add the query wrapper element when preparing the query payload:
json={"query": data} -> json=data.
But I think it's worth preventing this in the API.
Additionally i found some other errors in the metadata and fixed them here:
"start": "01.01.2020",
"end": "31.12.2050",
to
"start": "2020-01-01",
"end": "2050-12-31",
Internally, the metadata is checked with a tool called [omi] (https://github.com/OpenEnergyPlatform/omi). It is currently being revised and will become much more usable (as a CLI tool), but it still helps to find errors. Unfortunately there is no tutorial explaining how to use omi yet.
Hello,
im trying to upload metadata for my tables on the OEP. However, even after meticously following the instructions from here: https://openenergyplatform.github.io/academy/tutorials/01_api/02_api_upload/#notes-on-data-types
and using three different json examples. I always get the same error: Exception: Failed to upload metadata to table all_ghg_emissions_by_sector. Status code: 400, Response: {"reason": "metadata string does not contain an id"}
I used the example for metadata from the above link, json metadata that I copied from this entry: https://openenergyplatform.org/dataedit/view/scenario/eu_leg_data_2014_eio_ir_article23_t1 which already contains full metadata and my indivudally created metadata based on the scheme provided. THis is the table im trying to upload to: https://openenergyplatform.org/dataedit/view/model_draft/all_ghg_emissions_by_sector
here is the function i used to try and upload the metadata. I tried to do it for one of my own tables on the model_draft schema
def upload_metadata_to_table(api_url, table_name, path_json):
Check if the JSON file exists
json_ghg.json test.json