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

added metadata.jsonld for datasets #102

Merged
merged 2 commits into from
May 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pyclowder/api/v1/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def download_metadata(connector, client, datasetid, extractor=None):
extractor -- extractor name to filter results (if only one extractor's metadata is desired)
"""
filterstring = "" if extractor is None else "&extractor=%s" % extractor
url = posixpath.join(client.host, 'api/datasets/%s/metadata?key=%s' % (datasetid, client.key + filterstring))
url = posixpath.join(client.host, 'api/datasets/%s/metadata.jsonld?key=%s' % (datasetid, client.key + filterstring))

# fetch data
result = requests.get(url, stream=True,
Expand Down Expand Up @@ -175,7 +175,7 @@ def remove_metadata(connector, client, datasetid, extractor=None):
!!! ALL JSON-LD METADATA WILL BE REMOVED IF NO extractor PROVIDED !!!
"""
filterstring = "" if extractor is None else "&extractor=%s" % extractor
url = posixpath.join(client.host, 'api/datasets/%s/metadata?key=%s' % (datasetid, client.key))
url = posixpath.join(client.host, 'api/datasets/%s/metadata.jsonld?key=%s' % (datasetid, client.key))

# fetch data
result = requests.delete(url, stream=True, verify=connector.ssl_verify if connector else True)
Expand Down Expand Up @@ -255,7 +255,7 @@ def upload_metadata(connector, client, datasetid, metadata):
headers = {'Content-Type': 'application/json'}
connector.message_process({"type": "dataset", "id": datasetid}, "Uploading dataset metadata.")

url = posixpath.join(client.host, 'api/datasets/%s/metadata?key=%s' % (datasetid, client.key))
url = posixpath.join(client.host, 'api/datasets/%s/metadata.jsonld?key=%s' % (datasetid, client.key))
result = requests.post(url, headers=headers, data=json.dumps(metadata),
verify=connector.ssl_verify if connector else True)
result.raise_for_status()
Expand Down
Loading