Skip to content

Commit 759b960

Browse files
authored
Merge branch 'geopython:master' into gbif-eml
2 parents b5faef5 + 49f9631 commit 759b960

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

pygeometa/schemas/ogcapi_records/__init__.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
import os
4949
from typing import Union
5050

51+
from pygeometa import __version__
5152
from pygeometa.core import get_charstring
5253
from pygeometa.helpers import json_dumps
5354
from pygeometa.schemas.base import BaseOutputSchema
@@ -121,6 +122,12 @@ def write(self, mcf: dict, stringify: str = True) -> Union[dict, str]:
121122
'links': []
122123
}
123124

125+
if 'doi' in mcf['identification']:
126+
record['properties']['externalIds'] = [{
127+
'scheme': 'https://doi.org',
128+
'value': mcf['identification']['doi']
129+
}]
130+
124131
if self.lang1 is not None:
125132
record['properties']['language'] = {
126133
'code': self.lang1
@@ -242,6 +249,8 @@ def write(self, mcf: dict, stringify: str = True) -> Union[dict, str]:
242249
for value in mcf['distribution'].values():
243250
record['links'].append(self.generate_link(value))
244251

252+
record['generated_by'] = f'pygeometa {__version__}'
253+
245254
if stringify:
246255
return json_dumps(record)
247256

0 commit comments

Comments
 (0)