cioos-siooc / ckan

CKAN is an open-source DMS (data management system) for powering data hubs and data portals. CKAN makes it easy to publish, share and use data. It powers datahub.io, catalog.data.gov and europeandataportal.eu/data/en/dataset among many other sites.
http://ckan.org/
Other
2 stars 4 forks source link

Citation url is not matching datasets url for datasets imported from the metadata form #118

Closed ogsletcax closed 3 years ago

ogsletcax commented 3 years ago

The authority field is filled with "ca.cioos" by the metadata form tools.

The calculate_identifier method in https://github.com/cioos-siooc/ckanext-spatial/blob/e5130058fd117e8206131985ec3506c6c44bca2e/ckanext/spatial/model/harvested_metadata.py#L1565 calculate an id based on the authority field. So the resulting url is like https://catalogue.preprod.ogsl.ca/dataset/ca.cioos_656b0f87-59b7-440f-949e-84b1580c2b7c?local=fr

On ckan side the id is converted to something like https://catalogue.preprod.ogsl.ca/dataset/ca-cioos_656b0f87-59b7-440f-949e-84b1580c2b7c?local=fr)

should we change to authority value? Make it customizable in the export tool? or replace "." by "-" in the calculate_identifier method?

@fostermh @n-a-t-e @jeffcullis

fostermh commented 3 years ago

well isn't that interesting. I will have to look into why the '.' is converted to a '-' but my initial thought is that ckan uses a 'munge' function to clean the url's and it is doing a replace on '.'

ogsletcax commented 3 years ago

@fostermh indeed! munge_name function is used here https://github.com/cioos-siooc/ckanext-cioos_harvest/blob/4154ff81cf716b29ed6b224cc49c6250310822d1/ckanext/cioos_harvest/plugin.py#L310

Maybe munge_name could be used when returning a result in calculate_identifier?