Skip to content

Commit

Permalink
use conditionapplyingtoaccessanduse to populate oa-records:rights
Browse files Browse the repository at this point in the history
suggestion for #1077
  • Loading branch information
pvgenuchten committed Feb 5, 2025
1 parent fc07f93 commit 6392d21
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pycsw/core/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -1682,6 +1682,8 @@ def _parse_dc(context, repos, exml):
_set(context, recobj, 'pycsw:Publisher', md.publisher)
_set(context, recobj, 'pycsw:Contributor', md.contributor)
_set(context, recobj, 'pycsw:OrganizationName', md.rightsholder)
if len(md.rights) > 0 and None not in md.rights:
_set(context, recobj, 'pycsw:ConditionApplyingToAccessAndUse', ','.join(md.rights))
_set(context, recobj, 'pycsw:AccessConstraints', md.accessrights)
_set(context, recobj, 'pycsw:OtherConstraints', md.license)
_set(context, recobj, 'pycsw:Date', md.date)
Expand Down
4 changes: 4 additions & 0 deletions pycsw/ogc/api/records.py
Original file line number Diff line number Diff line change
Expand Up @@ -1201,6 +1201,10 @@ def record2json(record, url, collection, mode='ogcapi-records'):
record.otherconstraints = [record.otherconstraints]
record_dict['properties']['license'] = ", ".join(record.otherconstraints)

if record.conditionapplyingtoaccessanduse:
if isinstance(record.conditionapplyingtoaccessanduse, str) and record.conditionapplyingtoaccessanduse not in [None, 'None']:
record_dict['properties']['rights'] = record.conditionapplyingtoaccessanduse

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

if record.type:
Expand Down

0 comments on commit 6392d21

Please sign in to comment.