datacite / bolognese

Ruby gem and command-line utility for conversion of DOI metadata
MIT License
40 stars 14 forks source link

Nothing works #198

Open ChristianF88 opened 2 weeks ago

ChristianF88 commented 2 weeks ago

Hi everyone,

I just tried out the tool and I'm having a lot of issues. I'm not a ruby developer so I might be doing something wrong.

Here's my dockerfile:

FROM ruby:3.2
ENV LANG=C.UTF-8 \
    BUNDLER_VERSION=2.3.11
RUN apt-get update -qq && \
    apt-get install -y build-essential && \
    gem install bundler -v "$BUNDLER_VERSION"
RUN gem install bolognese
WORKDIR /app
ENTRYPOINT ["bolognese"]

Building the container via docker build -t bolognese-cli . and using the tool via docker run --rm bolognese-cli https://doi.org/10.7554/elife.01567.

Now when I use a "freshly" downloaded xml from datacite eg: https://api.datacite.org/application/vnd.datacite.datacite+xml/10.25678/0005jy and I run the tool I'm getting errors for any conversion I try:

docker run --rm bolognese-cli 0005jy.xml 
/usr/local/bundle/gems/maremma-5.0.0/lib/maremma.rb:262:in `gsub!': can't modify frozen String: "0005jy.xml" (FrozenError)
    from /usr/local/bundle/gems/maremma-5.0.0/lib/maremma.rb:262:in `block in from_xml'
    from /usr/local/bundle/gems/maremma-5.0.0/lib/maremma.rb:261:in `each'
    from /usr/local/bundle/gems/maremma-5.0.0/lib/maremma.rb:261:in `from_xml'
    from /usr/local/bundle/gems/bolognese-2.2.0/lib/bolognese/utils.rb:571:in `find_from_format_by_string'
    from /usr/local/bundle/gems/bolognese-2.2.0/lib/bolognese/utils.rb:519:in `find_from_format'
    from /usr/local/bundle/gems/bolognese-2.2.0/lib/bolognese/metadata.rb:74:in `initialize'
    from /usr/local/bundle/gems/bolognese-2.2.0/lib/bolognese/cli.rb:34:in `new'
    from /usr/local/bundle/gems/bolognese-2.2.0/lib/bolognese/cli.rb:34:in `convert'
    from /usr/local/bundle/gems/thor-1.3.2/lib/thor/command.rb:28:in `run'
    from /usr/local/bundle/gems/thor-1.3.2/lib/thor/invocation.rb:127:in `invoke_command'
    from /usr/local/bundle/gems/thor-1.3.2/lib/thor.rb:538:in `dispatch'
    from /usr/local/bundle/gems/thor-1.3.2/lib/thor/base.rb:584:in `start'
    from /usr/local/bundle/gems/bolognese-2.2.0/bin/bolognese:6:in `<top (required)>'
    from /usr/local/bundle/bin/bolognese:25:in `load'
    from /usr/local/bundle/bin/bolognese:25:in `<main>'

If I try to get the xml via the url, it returns "garbage":

docker run --rm bolognese-cli https://doi.org/10.25678/0005JY -t datacite
<?xml version="1.0" encoding="UTF-8"?>
<resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://datacite.org/schema/kernel-4" xsi:schemaLocation="http://datacite.org/schema/kernel-4 http://schema.datacite.org/meta/kernel-4/metadata.xsd">
  <identifier identifierType="DOI"/>
  <creators/>
  <titles/>
  <publisher/>
  <publicationYear/>
  <sizes/>
  <formats/>
  <version/>
</resource>

I tried all sorts of things (from argument, different conversions, different DOIs) but I am not able to get any (complete data). Any suggestions?

Thank you very much!