Skip to content

Commit

Permalink
Add graphic overview and purpose to dataset
Browse files Browse the repository at this point in the history
Also add graphic_overview to table harvester
  • Loading branch information
mjanez committed Feb 13, 2024
1 parent 1760920 commit dcb0bdc
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ogc2ckan/ckan_datasets/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ def __init__(self, ckan_id, name, owner_org, license_id):
self.owner_org = owner_org
self.private = False
self.groups = []
self.graphic_overview = None
# use http://<ckan_url>/api/action/organization_list to see the organization ids in your CKAN site
self.license_id = license_id
self.identifier = None
Expand Down Expand Up @@ -142,6 +143,9 @@ def set_private(self, private):
def set_groups(self, groups):
self.groups = groups

def set_graphic_overview(self, graphic_overview):
self.graphic_overview = graphic_overview

def set_publisher_uri(self, publisher_uri):
self.publisher_uri = publisher_uri

Expand Down Expand Up @@ -351,6 +355,7 @@ def dataset_dict(self):
'owner_org': self.owner_org,
'private': self.private,
'groups': self.groups,
'graphic_overview': self.graphic_overview,
'title': self.title,
'notes': self.notes,
'license_id': self.license_id,
Expand Down Expand Up @@ -448,6 +453,7 @@ def dataset_dict(self):
'owner_org': self.owner_org,
'private': self.private,
'groups': self.groups,
'graphic_overview': self.graphic_overview,
'title_translated': self.title_translated,
'notes_translated': self.notes_translated,
'license_id': self.license_id,
Expand Down
6 changes: 6 additions & 0 deletions ogc2ckan/ckan_datasets/geodcatap.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ def __init__(self, ckan_id, name, owner_org, license_id):
self.owner_org = owner_org
self.private = False
self.groups = []
self.graphic_overview = None
# use http://<ckan_url>/api/action/organization_list to see the organization ids in your CKAN site
self.license_id = license_id
self.identifier = ckan_id
Expand Down Expand Up @@ -181,6 +182,9 @@ def set_private(self, private):
def set_groups(self, groups):
self.groups = groups

def set_graphic_overview(self, graphic_overview):
self.graphic_overview = graphic_overview

def set_publisher_uri(self, publisher_uri):
self.publisher_uri = publisher_uri

Expand Down Expand Up @@ -402,6 +406,7 @@ def dataset_dict(self):
'owner_org': self.owner_org,
'private': self.private,
'groups': self.groups,
'graphic_overview': self.graphic_overview,
'title': self.title,
'notes': self.notes,
'license_id': self.license_id,
Expand Down Expand Up @@ -505,6 +510,7 @@ def dataset_dict_multilang(self):
'owner_org': self.owner_org,
'private': self.private,
'groups': self.groups,
'graphic_overview': self.graphic_overview,
'title_translated': self.title_translated,
'notes_translated': self.notes_translated,
'license_id': self.license_id,
Expand Down
8 changes: 8 additions & 0 deletions ogc2ckan/harvesters/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,14 @@ def get_dataset(self, ckan_info: CKANInfo, record: str, table_dataset: object =
metadata_profile = getattr(table_dataset, 'metadata_profile', OGC2CKAN_HARVESTER_MD_CONFIG['metadata_profile'])
dataset.set_metadata_profile(metadata_profile)

# Set graphic overview
graphic_overview = getattr(table_dataset, 'graphic_overview', None)
dataset.set_graphic_overview(graphic_overview)

# Set purpose
purpose = getattr(table_dataset, 'purpose', None)
dataset.set_purpose(purpose)

# Set Responsible Parties (Point of contact, Resource publisher and Resource contact/maintainer)
self.set_default_responsible_parties(dataset, self.default_dcat_info, ckan_info, table_dataset)

Expand Down

0 comments on commit dcb0bdc

Please sign in to comment.