Skip to content
This repository was archived by the owner on Jul 3, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
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
5 changes: 4 additions & 1 deletion mdingestion/command/harvest.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,7 @@ def _harvest(self, identifier, fromdate=None, clean=False, limit=None, dry_run=F
unit=' records',
total=_harvester.total(),
disable=silent):
_harvester.write_record(record, pretty_print=True)
try:
_harvester.write_record(record, pretty_print=True)
except Exception:
logging.exception(f"Harvesting of {identifier} failed.")
14 changes: 12 additions & 2 deletions mdingestion/community/bluecloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def _find(self, name):
def update(self, doc):
doc.discipline = ['Marine Science']
doc.description = self._find('Abstract')
doc.source = self._find('OnlineResourceUrl')
doc.source = self.source()
doc.publication_year = self._find('Last_Update')
doc.contributor = self._find('Organisations')
doc.contact = ['blue-cloud-support@maris.nl']
Expand All @@ -43,7 +43,17 @@ def update(self, doc):
doc.keywords = self.keywords()
doc.publisher = self.publishers()

# TODO: fix list problem in json parser = json.py in Carsten weiss wo
def source(self):
source = []
oru_urls = self._find("OnlineResourceUrl")
for oru in oru_urls:
if "http" in oru:
url = oru
else:
url = f"https://data.blue-cloud.org{oru}"
source.append(url)
return source

def instruments(self):
instruments = []
instruments.extend(self._find('Instruments'))
Expand Down