Open mhogeweg opened 6 years ago
The error response is being returned due to a bug inside the data processing componentry within GeoPlatform which will be fixed in the upcoming release.
Exporting any GeoPlatform CBO object as JSON is the same as just requesting the object directly:
https://sit-ual.geoplatform.us/api/items/aede9f610a7aebbaaa208b25d29d0811/export?format=json is equivalent to... https://sit-ual.geoplatform.us/api/items/aede9f610a7aebbaaa208b25d29d0811
The api client library will be updated, though, to handle this case in order to return a more readable error indicating what went wrong and to contain clearer, more specific documentation.
cool. I'm looking to see if I can hook up a 'multi-source' search widget to the Geoplatform API. you may see some more questions in the following weeks. one of the things I'll ask of the API is to return the item's metadata as XML. The above example returns an XML of sorts, but that doesn't appear to be a full ISO metadata document. Is there an item you know of that does have full metadata? or is it a seek and ye shall find situation?
The current mechanism to get XML is the export feature using 'iso19139'.
For items created within the GeoPlatform, all data configured is exported to the appropriate ISO or ISO-GP extension property. For items imported from ISO (such as from Data.gov), there is currently some data loss possible during export if the item is modified after import (the original ISO values will not be exported in favor of the more current changed values).
In either case, we only export out what we can populate data with. Many metadata documents from places such as Data.gov have some incompleteness. That being said, exported XML from GP should be ISO-compliant.
I was looking at the API and specifically the Export Item resource. I ended up with this request:
https://sit-ual.geoplatform.us/api/items/aede9f610a7aebbaaa208b25d29d0811/export?format=json
this returns an HTTP 406 error (Not Acceptable) wrapped in JSON. But json is listed as one of the options for the format parameter
leaving off the format parameter does produce an ISO encoded XML document: https://sit-ual.geoplatform.us/api/items/aede9f610a7aebbaaa208b25d29d0811/export