Skip to content

Commit 4c20962

Browse files
authored
update to latest OARec (#251)
1 parent 05e98f5 commit 4c20962

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

pygeometa/schemas/ogcapi_records/__init__.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,9 @@ def write(self, mcf: dict, stringify: str = True) -> Union[dict, str]:
116116
'title': title[0],
117117
'description': description[0],
118118
'themes': [],
119-
'language': self.lang1,
119+
'language': {
120+
'code': self.lang1
121+
},
120122
'type': mcf['metadata']['hierarchylevel'],
121123
},
122124
'links': []
@@ -169,12 +171,12 @@ def write(self, mcf: dict, stringify: str = True) -> Union[dict, str]:
169171
for v in mcf['distribution'].values():
170172
format_ = get_charstring(v.get('format'), self.lang1, self.lang2)
171173
if format_[0] is not None:
172-
formats.append(format_)
174+
formats.append(format_[0])
173175

174176
LOGGER.debug('Checking for formats')
175177
if formats:
176-
record['properties']['formats'] = list(
177-
set([f[0] for f in formats]))
178+
formats2 = set(formats)
179+
record['properties']['formats'] = [{'name': f} for f in formats2]
178180

179181
LOGGER.debug('Checking for contacts')
180182
record['properties']['contacts'] = self.generate_contacts(

0 commit comments

Comments
 (0)