jsonxmlspatialckandata-harvest

How can I display an XML page instead of JSON, for a dataset


I am using the pycsw extension to produce a CSW file. I have harvested data from one CKAN instance [1], into another [2], and am now looking to run the pycsw 'paster load' command:

paster ckan-pycsw load -p /etc/ckan/default/pycsw.cfg -u [CKAN INSTANCE]

I get the error:

Could not pass xml doc from [ID], Error: Start tag expected, '<' not found, line 1, column 1

I think it is because when I visit this url:

[CKAN INSTANCE 2]/harvest/object/[ID]

It comes up with a JSON file as opposed to an XML (which it is expecting)

I have run the pycsw load command on other ckan instances and have had no problems with them. They also display an XML file at the url stated above, so I wanted to know how to get CKAN to serve an XML file instead of JSON?

Thanks in advance for any help!


Solution

  • As you've worked out, your datasets need to be in ISO(XML) format to load into a CSW server. A CKAN only has a copy of the dataset in ISO(XML) format if it harvested them from a CSW.

    If you use the CKAN(-to-CKAN) harvester in the chain then the ISO(XML) record doesn't get transferred with it. So you'd either need to add this functionality to the CKAN(-to-CKAN) harvester, or get rid of the CKAN-to-CKAN harvest step.

    Alternatively if the record originated in a CKAN, then it has no ISO(XML) version anyway, and you'd need to create that somehow.