Where is Project Open Data data.xml format defined

130 views Asked by At

I would like to convert a dataset into Project Open Data data.xml format so that I can ingest in via the DKAN harvester. I know there is data.json format but prefer to use data.xml as the data is already XML and I am comfortable transforming it.

I can't seem to find where the data.xml schema/format is defined and would be grateful for pointers.

1

There are 1 answers

0
acouch On

The data.json file is created by implementing the Open Data Schema Map module in DKAN.

You have a couple of options:

  1. Create a new endpoint at "/admin/config/services/odsm/add/api" and use XML as the output format and "Project Open Data v1.1" as the schema:

enter image description here

  1. You can do the same thing in code using hook hook_open_data_schema_apis_defaults() that Open Data Schema Map DKAN uses. Copy the declaration for "data_json" in your own module and change the endpoint to "'endpoint' => 'data.xml'," and the format to xml.

  2. You could use hook_open_data_schema_map_results_alter to alter the schema to use "data.xml" and format to XML in a custom module.