From 16f209b90bcb69f3f2f46f60186cb798ad8fd522 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 | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pygeometa/schemas/ogcapi_records/__init__.py b/pygeometa/schemas/ogcapi_records/__init__.py index 1826b1b..1e4446e 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,13 @@ 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])) + print("FORMATS", formats) + formats2 = set(formats) + record['properties']['formats'] = [{'name': f} for f in formats2] LOGGER.debug('Checking for contacts') record['properties']['contacts'] = self.generate_contacts(