Open carstenhoyerklick opened 5 months ago
@holycrab13 @kurzum @JonathanJustavino
Update: @JonathanJustavino implemented an upload prototype here: https://github.com/JonathanJustavino/databus-upload .env (https://github.com/JonathanJustavino/databus-upload?tab=readme-ov-file#credentials) and jsonld (https://github.com/JonathanJustavino/databus-upload/blob/master/example-upload/metadata.json) needs to be configured in advance
Insights and Issues:
@kurzum Regarding the oep http api usage:
We have this tutorial that demonstrates the usage using python: https://openenergyplatform.github.io/academy/tutorials/01_api/02_api_upload/
In general the endpoints are:
# do something like
auth_headers = {"Authorization": "Token %s" % token}
topic_name can be "model_draft" or "sandbox" (only for testing)
PUT request to https://openenergy-platform.org/v0/schema/<topic_name>/tables/<table_name>/
The Requests must include the table definition --> use the "query" field {"query": table_schema}
# NOTE: first column should be numerical column named `id`.
{
"columns": [
{"name": "id", "data_type": "bigserial", "primary_key": True},
{"name": "name", "data_type": "varchar(18)", "is_nullable": False},
{"name": "is_active", "data_type": "boolean"},
{"name": "capacity_mw", "data_type": "float"},
{"name": "installation_datetime_utc", "data_type": "datetime"},
]
}
POST request to https://openenergy-platform.org/v0/schema/<topic_name>/tables/<table_name>/rows/new
Add data to the request:
{"query": table_data }
table_data = {
"name": "test",
"is_active": "true",
"capacity_mw": "12.12",
"installation_datetime_utc": "2023-12-12",
}
POST request to https://openenergy-platform.org/v0/schema/<topic_name>/tables/<table_name>/rows/<row_id>
include data
POST request to https://openenergy-platform.org/v0/schema/<topic_name>/tables/<table_name>/meta/
add metadata json
DELETE request to https://openenergy-platform.org/v0/schema/<topic_name>/tables/<table_name>/
Description of the issue
we just had a discussion on how to improve the link between databus und OEMetadata. It needs a few addtional header fields in OEMetadata 2.0.
Ideas of solution
Describe possible ideas for solution and evaluate advantages and disadvantages.
Workflow checklist