This raises an exception since concatenating a string with None is not a valid operation. This could be fairly easily fixed by adding in the MI_Metadata as a valid element to find as well.
In fact, it looks like the data.gov fork of ckanext-spatial does just that:
https://github.com/GSA/ckanext-spatial/blob/datagov/ckanext/spatial/lib/csw_client.py#L171
Additionally, cases in which root elements which weren't MD_Metadata or MI_Metadata should be handled early so that a sane error message is raised, rather than an error about concatenating string to None, which does not make the reason for failure particularly clear .
Attempting to harvest from a CSW with ISO metadata starting with
MI_Metadata
, rather thanMD_Metadata
fails:https://github.com/ckan/ckanext-spatial/blob/master/ckanext/spatial/lib/csw_client.py#L178-L189
Essentially, the call to
.find
does not findMD_Metadata
, and so returnsNone
, which gets propagated down to this line:This raises an exception since concatenating a string with
None
is not a valid operation. This could be fairly easily fixed by adding in theMI_Metadata
as a valid element to find as well. In fact, it looks like the data.gov fork of ckanext-spatial does just that: https://github.com/GSA/ckanext-spatial/blob/datagov/ckanext/spatial/lib/csw_client.py#L171 Additionally, cases in which root elements which weren'tMD_Metadata
orMI_Metadata
should be handled early so that a sane error message is raised, rather than an error about concatenating string to None, which does not make the reason for failure particularly clear .