oemetadata
oemetadata copied to clipboard
Enhancement to improve linking between databus, MOSS and OEMetadata
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
- [x ] I am aware of the workflow in CONTRIBUTING.md
@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:
- Zenodo accepts anything without validation
- License field has high heterogenity
- addition to JSON-LD to connect online infrastructure with files via Prov-O
@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:
get your api token & inlcude in all requests
# do something like
auth_headers = {"Authorization": "Token %s" % token}
Create new table:
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"},
]
}
Upload data
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",
}
Update data
POST request to https://openenergy-platform.org/v0/schema/<topic_name>/tables/<table_name>/rows/<row_id>
include data
Upload metadata
POST request to https://openenergy-platform.org/v0/schema/<topic_name>/tables/<table_name>/meta/
add metadata json
Delete Table
DELETE request to https://openenergy-platform.org/v0/schema/<topic_name>/tables/<table_name>/
I just inspected the suggestion for additional fields here: #158