Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Enhancement to improve linking between databus, MOSS and OEMetadata #139

Closed
1 task done
carstenhoyerklick opened this issue Mar 12, 2024 · 4 comments
Closed
1 task done
Assignees
Labels
enhancement New feature or request

Comments

@carstenhoyerklick
Copy link

carstenhoyerklick commented Mar 12, 2024

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

@carstenhoyerklick carstenhoyerklick added the enhancement New feature or request label Mar 12, 2024
@carstenhoyerklick carstenhoyerklick changed the title Your title should make sense if said after "The issue is <your issue title>" Enhancement to improve linking between databus, MOSS and OEMetadata Mar 12, 2024
@holycrab13
Copy link

holycrab13 commented Mar 18, 2024

@kurzum
Copy link

kurzum commented Apr 3, 2024

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

@jh-RLI
Copy link
Contributor

jh-RLI commented Apr 3, 2024

@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

image

# 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>/

@Ludee
Copy link
Member

Ludee commented Oct 14, 2024

I just inspected the suggestion for additional fields here: #158

@Ludee Ludee closed this as completed Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

No branches or pull requests

6 participants