Skip to content

Commit

Permalink
Merge pull request #102 from clowder-framework/101-dataset-metadata-j…
Browse files Browse the repository at this point in the history
…sonld

added metadata.jsonld for datasets
  • Loading branch information
max-zilla authored May 28, 2024
2 parents 701e968 + 49942f7 commit 9736f64
Showing 1 changed file with 3 additions and 3 deletions.
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

0 comments on commit 9736f64

Please sign in to comment.