Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: OAI-Interface #479

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from

Conversation

riedde
Copy link
Contributor

@riedde riedde commented Aug 6, 2024

This PR introduces the possibility to export every object as a valid oai-xml-file. The feature is just basic at the moment and can be extended in the future.

@peterstadler
Copy link
Member

Thanks for the PR! Could you please rebase your branch on current develop? That should fix the issues with the failing tests

@peterstadler peterstadler linked an issue Aug 23, 2024 that may be closed by this pull request
@peterstadler peterstadler added this to the Release 4.12 milestone Aug 23, 2024
Copy link
Member

@peterstadler peterstadler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so far. There's one issue (calling a private function …) that hinders me to test further

modules/oai.xql Outdated Show resolved Hide resolved
modules/oai.xql Outdated Show resolved Hide resolved
Copy link
Member

@peterstadler peterstadler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found some more issues ;)

: return The date ad xs:dateTime or empty
:)
declare %private function oai:last-modified($docID) as xs:dateTime {
let $props := config:get-data-props($docID)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this function is called config:get-svn-props. A quick fix would be to adjust it here, the more elaborate way would be to duplicate such a function in the config module as e.g. config:get-version-control-props, link the old one to the new function and deprecate the old one, like:

(:~
 : Deprecated, please use config:get-version-control-props#1
 : This function is to be removed in the near future
:)

declare function config:get-svn-props($docID as xs:string) as map(*) {
    config:get-version-control-props($docID),
    wega-util:log-to-file('info', 'call to deprecated function `config:get-svn-props`!')
};

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, in my code it will be overwritten and the different name was to avoid myself to get confused. I'll fix that!

declare function oai:oai($model as map(*)) as node() {
<OAI-PMH xmlns="http://www.openarchives.org/OAI/2.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/ http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd">
<responseDate>{fn:current-dateTime()}</responseDate>
<request verb="GetRecord" identifier="{$lod-metadata?DC.identifier}" metadataPrefix="oai_dc">http://www.openarchives.org/OAI/2.0/oai_dc/</request>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable $lod-metadata is not available in this function. It's probably best to fetch lod:metadata first and append this to the main $model (see below)?!

Suggested change
<request verb="GetRecord" identifier="{$lod-metadata?DC.identifier}" metadataPrefix="oai_dc">http://www.openarchives.org/OAI/2.0/oai_dc/</request>
<request verb="GetRecord" identifier="{$model?lod?DC.identifier}" metadataPrefix="oai_dc">http://www.openarchives.org/OAI/2.0/oai_dc/</request>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand, but why does it work on my machine?

modules/oai.xql Outdated Show resolved Hide resolved
Co-authored-by: Peter Stadler <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add support for OAI-PMH
2 participants