From 77c4e3749ed0299bb046adfa29a19a378da32dc4 Mon Sep 17 00:00:00 2001 From: Tom Kralidis Date: Wed, 2 Oct 2024 07:21:32 -0400 Subject: [PATCH] update to latest OARec --- pygeometa/schemas/ogcapi_records/__init__.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pygeometa/schemas/ogcapi_records/__init__.py b/pygeometa/schemas/ogcapi_records/__init__.py index 1826b1b..7295120 100644 --- a/pygeometa/schemas/ogcapi_records/__init__.py +++ b/pygeometa/schemas/ogcapi_records/__init__.py @@ -116,7 +116,9 @@ def write(self, mcf: dict, stringify: str = True) -> Union[dict, str]: 'title': title[0], 'description': description[0], 'themes': [], - 'language': self.lang1, + 'language': { + 'code': self.lang1 + }, 'type': mcf['metadata']['hierarchylevel'], }, 'links': [] @@ -169,12 +171,12 @@ def write(self, mcf: dict, stringify: str = True) -> Union[dict, str]: for v in mcf['distribution'].values(): format_ = get_charstring(v.get('format'), self.lang1, self.lang2) if format_[0] is not None: - formats.append(format_) + formats.append(format_[0]) LOGGER.debug('Checking for formats') if formats: - record['properties']['formats'] = list( - set([f[0] for f in formats])) + formats2 = set(formats) + record['properties']['formats'] = [{'name': f} for f in formats2] LOGGER.debug('Checking for contacts') record['properties']['contacts'] = self.generate_contacts(