Closed chrwm closed 1 year ago
Update, this is still the case FYI @christian-rli
Hey, I can't reproduce the issue, can you please send a non-working example?
I used:
import requests
from urllib.parse import quote
MOSS_URL = "http://moss.tools.dbpedia.org/annotation-api-demo/submit"
class MossError(Exception):
"""Raised if submitting metadata to MOSS fails"""
def submit_metadata_to_moss(databus_identifier, metadata):
# generate the URI for the request with the encoded identifier
api_uri = f"{MOSS_URL}?id={quote(databus_identifier)}"
response = requests.put(api_uri, headers={"Content-Type": "application/ld+json"}, json=metadata)
if response.status_code != 200:
raise MossError(
f"Could not submit metadata for DI '{databus_identifier}' to MOSS. "
f"Reason: {response.reason}"
)
metadata = requests.get("https://openenergy-platform.org/api/v0/schema/scenario/tables/ksz2050_r2_ks80_co2_emissions_industrial_processes/meta/").json()
databus_id = "https://energy.databus.dbpedia.org/denis/OEP/rli_dibt_windzone"
submit_metadata_to_moss(databus_id, metadata)
and it works without problems.
Sorry this works fine, mistake on my end, respectively on the current script.
has to be changed to
databus_identifier = f"{DATABUS_URI_BASE}/{ACCOUNT_NAME}/{GROUP}/{table_name}"
When using the script to register tables on the databus, the submission to MOSS currently fails.
The function below, responsible for registering in MOSS, needs to be checked
https://github.com/LOD-GEOSS/databus-snippets/blob/46cbbeadad56fc528d822b70841753b59f57d59a/moss.py#L12-L20