Skip to content

Commit

Permalink
in line with geopython#1045 and geopython#1044, update the record dat…
Browse files Browse the repository at this point in the history
…es to only reflect the record, since most of the metadata schema's do not advertise a record creation date, we can only duplicate create and modified
  • Loading branch information
pvgenuchten committed Nov 20, 2024
1 parent 4a27826 commit f429b4e
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions pycsw/ogc/api/records.py
Original file line number Diff line number Diff line change
Expand Up @@ -1165,17 +1165,21 @@ def record2json(record, url, collection, mode='ogcapi-records'):
record.otherconstraints = [record.otherconstraints]
record_dict['properties']['license'] = ", ".join(record.otherconstraints)

record_dict['properties']['updated'] = record.insert_date

if record.type:
record_dict['properties']['type'] = record.type

if record.date_creation:
record_dict['properties']['created'] = record.date_creation
record_dict['properties']['updated'] = record.insert_date # this is always populated

if record.date: # date is used in some schema's (DC)
record_dict['properties']['updated'] = record.date

if record.date_modified:
if record.date_modified: # used in ISO
record_dict['properties']['updated'] = record.date_modified

# pycsw does not capture date of record creation, use updated
record_dict['properties']['created'] = record_dict['properties']['updated']

if record.language:
record_dict['properties']['language'] = record.language

Expand Down

0 comments on commit f429b4e

Please sign in to comment.