gdcc/xoai

Add mechanism for defining an attribute to be added to the "metadata" element of a Record.

Closed this issue · 2 comments

It is with a heavy heart that I am opening this issue.
One of the less pretty custom extensions of the original XOAI that Dataverse have been using was the way the harvesting server was sending the client the uri for the proprietary json export:

<metadata directApiCall="https://dataverse.foo.edu/api/datasets/export?exporter=dataverse_json&persistentId=..."/>

The plan was to get rid of supplying this uri as an attribute of the metadata element. However, the consensus on the Dataverse side so far has been that we can't afford to make the new OAI server incompatible with the existing clients using dataverse_json.
So this issue is to request adding a mechanism for defining an arbitrary attribute for the "metadata" element in the written "record" section.

We can consider it a temporary measure; that will only be used for as long as there are instances running pre-v6 versions of Dataverse and using dataverse_json to harvest from other dataverses.

We need to be aware this is absolutely non-spec conformant - validating such a response against the OAI-PMH schema will fail.
That said, of course we need to provide backward compatibility.

IMHO it should be a configurable behaviour.

Idea for a solution:

  • There is an interface for a writer context since 563c03d to send granularity and token format to the writer. Also the RepositoryConfiguration is already an implementation of this interface.
  • We can use this to make it a configurable thing for the library (either in code only or the application allows for a configuration option)
  • The XmlWriter needs to be created by the implementing application, so we can make it accept your custom writer context.
  • This way, we can check in Metadata if the writing context allows to write attributes to the element. We of course must extend the Metadata model class to accept and write such attributes.

validating such a response against the OAI-PMH schema will fail.

It absolutely would. But we will continue showing this format as available only to other dataverses. No other client - including the OAI-PMH validating service - will be aware of its existence.