Giter VIP home page Giter VIP logo

Comments (2)

richardhallett avatar richardhallett commented on June 30, 2024

The goal here should be to never discard regardless if url or not.
I think the proposal of using something like how name_identifiers works makes sense to me.

from bolognese.

ashwinisukale avatar ashwinisukale commented on June 30, 2024

I was able to reproduce this bug locally with following steps.

This works

  1. From this fixture file remove schemeURI attribute and keep affiliationIdentifier with URL
    <affiliation schemeURI="https://ror.org" affiliationIdentifier="https://ror.org/05bp8ka05" affiliationIdentifierScheme="ROR"> Metadata Game Changers </affiliation>

After processing this XML file at bolognese/spec/author_utils_spec.rb:163. We will see that creators with affiliation will have affiliationIdentifier in the response after processing this metadata.

(byebug) subject.creators[0]
{"nameType"=>"Personal", "name"=>"Robinson, Erin", "givenName"=>"Erin", "familyName"=>"Robinson", "nameIdentifiers"=>[{"schemeUri"=>"https://orcid.org", "nameIdentifierScheme"=>"ORCID"}], "affiliation"=>[{"name"=>"Metadata Game Changers", "affiliationIdentifier"=>"https://ror.org/05bp8ka05", "affiliationIdentifierScheme"=>"ROR"}]}

This won't work

  1. From this fixture file remove schemeURI attribute and keep affiliationIdentifier without URL like below,
<creator>
    <creatorName nameType="Personal">Erin Robinson</creatorName>
    <nameIdentifier schemeURI="https://orcid.org/" nameIdentifierScheme="ORCID"> https://orcid.org/0000-0001-9998-0114 </nameIdentifier>
    <affiliation affiliationIdentifier="05bp8ka05" affiliationIdentifierScheme="ROR"> Metadata Game Changers </affiliation>
</creator>

Now in the test file add byebug bolognese/spec/author_utils_spec.rb:163 and check subject after processing the schema. we will see affiliation attribute in the response does not have affiliationIdentifier.

(byebug) subject.creators[0]
{"nameType"=>"Personal", "name"=>"Robinson, Erin", "givenName"=>"Erin", "familyName"=>"Robinson", "nameIdentifiers"=>[{"schemeUri"=>"https://orcid.org", "nameIdentifierScheme"=>"ORCID"}], "affiliation"=>[{"name"=>"Metadata Game Changers", "affiliationIdentifierScheme"=>"ROR"}]}

from bolognese.

Related Issues (20)

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.