Coder Social home page Coder Social logo

Resumption token not read about oai-pmh HOT 6 CLOSED

paperhive avatar paperhive commented on June 12, 2024
Resumption token not read

from oai-pmh.

Comments (6)

andrenarchy avatar andrenarchy commented on June 12, 2024

Thank you for reporting the issue! This might be a problem with how xml2js parses the returned XML – or possibly the ._ is just wrong :). Can you check how it works with another OAI PMH provider? I never experienced any problems but maybe the ones I used don't use resumption tokens...

from oai-pmh.

danmichaelo avatar danmichaelo commented on June 12, 2024

Goodness, _ contains the character content (see "charkey" at https://github.com/Leonidas-from-XIV/node-xml2js) if the element has attributes.

So it works for repositories that returns

<resumptionToken completeListSize="119657" cursor="0">oai_dc////100</resumptionToken>

but not for

<resumptionToken>oai_dc////100</resumptionToken>

The completeListSize and cursor attributes are not required by the OAI-PMH spec, so some repos provide them, others not. xml2js has an option called explicitCharkey, which I guess makes sure _ is always there, but that could probably also mess up lots of other things? What do you think about just adding a fallback?

resumptionToken: self.currentResult.resumptionToken._ || self.currentResult.resumptionToken,

from oai-pmh.

andrenarchy avatar andrenarchy commented on June 12, 2024

Jeez, you never stop learning what could go wrong when parsing XML... ;)

I think explicitCharkey makes sense. The object structure should really be independent from the presence of attributes. I don't have time to test this myself right now (or in the next 2 days) but of course I'm happy to review a PR if you have time to do it!

from oai-pmh.

danmichaelo avatar danmichaelo commented on June 12, 2024

Don't think I'll be able to pull together a PR. Made a quick attempt of setting explicitCharkey though, but then everything stopped working :D Or well, I got zero results. Guess some more ._s have to be sprinkled around the code first for it to work.

from oai-pmh.

andrenarchy avatar andrenarchy commented on June 12, 2024

I tried to test it here but unfortunately the URL in your original post leads to a 403 HTTP error with the following message:

Unauthorized access to the OAI services – please contact the system administrator for assistance

from oai-pmh.

danmichaelo avatar danmichaelo commented on June 12, 2024

This one should work I think:

oai-pmh list-records -p marc21 -s oai_komplett http://bibsys-network.alma.exlibrisgroup.com/view/oai/47BIBSYS_NETWORK/request

from oai-pmh.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.