crosscite / content-negotiation

DOI content negotiation
https://data.crosscite.org
MIT License
3 stars 4 forks source link

Issue-125 Update gems to appropriate version #123

Closed ashwinisukale closed 11 months ago

ashwinisukale commented 1 year ago

Issue - https://github.com/datacite/datacite/issues/1942

We upgraded the bolognese gem and its dependency gems to appropriate versions.

I have verified the changes by running test case for different DOI which is not recorded by the VCR. All tests are passing.

I have checked Bolognese gem in this repo, can successfully call the DOI with XML response for https://api.stage.datacite.org/dois/10.70112/igka4u

ashwini ~/Documents/WorkSpace/CrossCite/content-negotiation issue-1942-upgrade-gems > curl -LH "Accept: application/x-datacite+xml" https://api.stage.datacite.org/dois/10.70112/igka4u
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<resource xmlns="http://datacite.org/schema/kernel-4" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://datacite.org/schema/kernel-4 http://schema.datacite.org/meta/kernel-4/metadata.xsd">
  <identifier identifierType="DOI">10.70112/IGKA4U</identifier>
  <creators>
    <creator>
      <creatorName>TTT, Pham</creatorName>
      <affiliation>(Inra)</affiliation>
    </creator>
  </creators>
  <titles>
    <title>Dataset with api</title>
  </titles>
  <publisher>Portail Data Inra</publisher>
  <publicationYear>2019</publicationYear>
  <resourceType resourceTypeGeneral="Dataset">Not specified</resourceType>
  <contributors/>
  <descriptions>
    <description descriptionType="Abstract">Test description</description>
  </descriptions>
</resource>% 
codycooperross commented 1 year ago

I noticed that lupo was showing some errors with the 1.11.4 bolognese release: https://github.com/datacite/lupo/pull/1019 Maybe it's best to hold off on merging this until we figure out why those are happening.

I recreated the problematic DOI in staging: 10.81360/ffc3-tj52 With this branch, I no longer get an error, which is great, but I am seeing some ? characters. We should also look into those, because they don't seem to happen with earlier bolognese versions.

Request:

curl -LH "Accept: application/x-datacite+xml" http://localhost:8085/10.81360/ffc3-tj52

XML with ? characters:

<?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">10.81360/FFC3-TJ52</identifier>
  <creators>
    <creator>
      <creatorName nameType="Personal">Pankatz-Reu??, Miriam</creatorName>
      <givenName>Miriam</givenName>
      <familyName>Pankatz-Reu??</familyName>
      <affiliation>Universit??t Bielefeld, Medizinische Fakult??t OWL, Referat Studium und Lehre, Bielefeld, Deutschland</affiliation>
    </creator>
    <creator>
      <creatorName nameType="Personal">Peters, Tim</creatorName>
      <givenName>Tim</givenName>
      <familyName>Peters</familyName>
      <affiliation>Universit??t Bielefeld, Medizinische Fakult??t OWL, AG Allgemein- und Familienmedizin, Bielefeld, Deutschland</affiliation>
    </creator>
    <creator>
      <creatorName nameType="Personal">L??tzsch, Rebecca</creatorName>
      <givenName>Rebecca</givenName>
      <familyName>L??tzsch</familyName>
      <affiliation>Universit??t Bielefeld, Medizinische Fakult??t OWL, Bielefeld, Deutschland</affiliation>
    </creator>
    <creator>
      <creatorName nameType="Personal">Malchus, Karoline</creatorName>
      <givenName>Karoline</givenName>
      <familyName>Malchus</familyName>
      <affiliation>Universit??t Bielefeld, Medizinische Fakult??t OWL, Referat Studium und Lehre, Bielefeld, Deutschland</affiliation>
    </creator>
  </creators>
  <titles>
    <title xml:lang="de">Studierende als Forschende: Gestaltung einer interdisziplin??ren Forschungswerkstatt zur qualitativen Versorgungsforschung im ersten Studienabschnitt des Bielefelder Modellstudiengangs Medizin</title>
  </titles>
  <publisher>German Medical Science GMS Publishing House</publisher>
  <publicationYear>2023</publicationYear>
  <resourceType resourceTypeGeneral="ConferencePaper">Conference Abstract</resourceType>
  <subjects>
    <subject subjectScheme="dewey" schemeURI="http://dewey.info/" classificationCode="610" xml:lang="en">Medicine and health</subject>
  </subjects>
  <dates>
    <date dateType="Issued">2023-09-11</date>
  </dates>
  <language>de</language>
  <alternateIdentifiers>
    <alternateIdentifier alternateIdentifierType="URN">urn:nbn:de:0183-23gma0161</alternateIdentifier>
    <alternateIdentifier alternateIdentifierType="Doc">23gma016</alternateIdentifier>
  </alternateIdentifiers>
  <relatedItems>
    <relatedItem relatedItemType="ConferenceProceeding" relationType="IsPublishedIn">
      <titles>
        <title>Jahrestagung der Gesellschaft f??r Medizinische Ausbildung (GMA)</title>
        <title titleType="Subtitle">Osnabr??ck, 14.-16.09.2023</title>
      </titles>
      <publicationYear>2023</publicationYear>
      <number numberType="Other">DocV-03-04</number>
    </relatedItem>
  </relatedItems>
  <sizes/>
  <formats>
    <format>text/html</format>
  </formats>
  <version/>
  <rightsList>
    <rights rightsURI="https://creativecommons.org/licenses/by/4.0/legalcode" rightsIdentifier="cc-by-4.0" rightsIdentifierScheme="SPDX" schemeURI="https://spdx.org/licenses/" xml:lang="de">Creative Commons Attribution 4.0 International</rights>
  </rightsList>
  <descriptions>
    <description xml:lang="de" descriptionType="Abstract">Fragestellung/Zielsetzung: Zunehmende Fortschritte in der Medizin erfordern von angehenden ??rzt*innen ein evidenzbasiertes Denken und Handeln. Mit den aktuellen Bestrebungen f??r eine St??rkung der wissenschaftlichen Kompetenzen angehender ??rzt*innen [ref:1], [zum vollst??ndigen Text gelangen Sie ??ber die oben angegebene URL]</description>
  </descriptions>
</resource>
ashwinisukale commented 1 year ago

Thank a lot @codycooperross for the review, Yes I am working on upgrading the Lupo gem version today. Then I will check why we get the ? in the response.

ashwinisukale commented 1 year ago

@codycooperross the ? in the XML is a prolog https://www.w3schools.com/xml/xml_syntax.asp Its a part of XML body.

codycooperross commented 1 year ago

@codycooperross the ? in the XML is a prolog https://www.w3schools.com/xml/xml_syntax.asp Its a part of XML body.

There seems to be a discrepancy between the text encoding in the response between main and this branch.

With this curl command: curl -LH "Accept: application/vnd.datacite.datacite+xml" http://localhost:8085/10.82537/9vfw-rj81

I see this in the feature branch output (with question marks):

<?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">10.82537/9VFW-RJ81</identifier>
  <creators>
    <creator>
      <creatorName nameType="Personal">Pankatz-Reu??, Miriam</creatorName>
      <givenName>Miriam</givenName>
      <familyName>Pankatz-Reu??</familyName>
      <affiliation>Universit??t Bielefeld, Medizinische Fakult??t OWL, Referat Studium und Lehre, Bielefeld, Deutschland</affiliation>
    </creator>
    <creator>
      <creatorName nameType="Personal">Peters, Tim</creatorName>
      <givenName>Tim</givenName>
      <familyName>Peters</familyName>
      <affiliation>Universit??t Bielefeld, Medizinische Fakult??t OWL, AG Allgemein- und Familienmedizin, Bielefeld, Deutschland</affiliation>
    </creator>
    <creator>
      <creatorName nameType="Personal">L??tzsch, Rebecca</creatorName>
      <givenName>Rebecca</givenName>
      <familyName>L??tzsch</familyName>
      <affiliation>Universit??t Bielefeld, Medizinische Fakult??t OWL, Bielefeld, Deutschland</affiliation>
    </creator>
    <creator>
      <creatorName nameType="Personal">Malchus, Karoline</creatorName>
      <givenName>Karoline</givenName>
      <familyName>Malchus</familyName>
      <affiliation>Universit??t Bielefeld, Medizinische Fakult??t OWL, Referat Studium und Lehre, Bielefeld, Deutschland</affiliation>
    </creator>
  </creators>
  <titles>
    <title xml:lang="de">Studierende als Forschende: Gestaltung einer interdisziplin??ren Forschungswerkstatt zur qualitativen Versorgungsforschung im ersten Studienabschnitt des Bielefelder Modellstudiengangs Medizin</title>
  </titles>
  <publisher>German Medical Science GMS Publishing House</publisher>
  <publicationYear>2023</publicationYear>
  <resourceType resourceTypeGeneral="ConferencePaper">Conference Abstract</resourceType>
  <subjects>
    <subject subjectScheme="dewey" schemeURI="http://dewey.info/" classificationCode="610" xml:lang="en">Medicine and health</subject>
  </subjects>
  <dates>
    <date dateType="Issued">2023-09-11</date>
  </dates>
  <language>de</language>
  <alternateIdentifiers>
    <alternateIdentifier alternateIdentifierType="URN">urn:nbn:de:0183-23gma0161</alternateIdentifier>
    <alternateIdentifier alternateIdentifierType="Doc">23gma016</alternateIdentifier>
  </alternateIdentifiers>
  <sizes/>
  <formats>
    <format>text/html</format>
  </formats>
  <version/>
  <rightsList>
    <rights rightsURI="https://creativecommons.org/licenses/by/4.0/legalcode" rightsIdentifier="cc-by-4.0" rightsIdentifierScheme="SPDX" schemeURI="https://spdx.org/licenses/" xml:lang="de">Creative Commons Attribution 4.0 International</rights>
  </rightsList>
  <descriptions>
    <description xml:lang="de" descriptionType="Abstract">Fragestellung/Zielsetzung: Zunehmende Fortschritte in der Medizin erfordern von angehenden ??rzt*innen ein evidenzbasiertes Denken und Handeln. Mit den aktuellen Bestrebungen f??r eine St??rkung der wissenschaftlichen Kompetenzen angehender ??rzt*innen [ref:1], [zum vollst??ndigen Text gelangen Sie ??ber die oben angegebene URL]</description>
  </descriptions>
</resource>

And this in the main branch output (without question marks and with special characters):

<?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">10.82537/9VFW-RJ81</identifier>
  <creators>
    <creator>
      <creatorName nameType="Personal">Pankatz-Reuß, Miriam</creatorName>
      <givenName>Miriam</givenName>
      <familyName>Pankatz-Reuß</familyName>
      <affiliation>Universität Bielefeld, Medizinische Fakultät OWL, Referat Studium und Lehre, Bielefeld, Deutschland</affiliation>
    </creator>
    <creator>
      <creatorName nameType="Personal">Peters, Tim</creatorName>
      <givenName>Tim</givenName>
      <familyName>Peters</familyName>
      <affiliation>Universität Bielefeld, Medizinische Fakultät OWL, AG Allgemein- und Familienmedizin, Bielefeld, Deutschland</affiliation>
    </creator>
    <creator>
      <creatorName nameType="Personal">Lätzsch, Rebecca</creatorName>
      <givenName>Rebecca</givenName>
      <familyName>Lätzsch</familyName>
      <affiliation>Universität Bielefeld, Medizinische Fakultät OWL, Bielefeld, Deutschland</affiliation>
    </creator>
    <creator>
      <creatorName nameType="Personal">Malchus, Karoline</creatorName>
      <givenName>Karoline</givenName>
      <familyName>Malchus</familyName>
      <affiliation>Universität Bielefeld, Medizinische Fakultät OWL, Referat Studium und Lehre, Bielefeld, Deutschland</affiliation>
    </creator>
  </creators>
  <titles>
    <title xml:lang="de">Studierende als Forschende: Gestaltung einer interdisziplinären Forschungswerkstatt zur qualitativen Versorgungsforschung im ersten Studienabschnitt des Bielefelder Modellstudiengangs Medizin</title>
  </titles>
  <publisher>German Medical Science GMS Publishing House</publisher>
  <publicationYear>2023</publicationYear>
  <resourceType resourceTypeGeneral="ConferencePaper">Conference Abstract</resourceType>
  <subjects>
    <subject subjectScheme="dewey" schemeURI="http://dewey.info/" xml:lang="en">Medicine and health</subject>
  </subjects>
  <dates>
    <date dateType="Issued">2023-09-11</date>
  </dates>
  <language>de</language>
  <alternateIdentifiers>
    <alternateIdentifier alternateIdentifierType="URN">urn:nbn:de:0183-23gma0161</alternateIdentifier>
    <alternateIdentifier alternateIdentifierType="Doc">23gma016</alternateIdentifier>
  </alternateIdentifiers>
  <sizes/>
  <formats>
    <format>text/html</format>
  </formats>
  <version/>
  <rightsList>
    <rights rightsURI="https://creativecommons.org/licenses/by/4.0/legalcode" rightsIdentifier="cc-by-4.0" rightsIdentifierScheme="SPDX" schemeURI="https://spdx.org/licenses/" xml:lang="de">Creative Commons Attribution 4.0 International</rights>
  </rightsList>
  <descriptions>
    <description xml:lang="de" descriptionType="Abstract">Fragestellung/Zielsetzung: Zunehmende Fortschritte in der Medizin erfordern von angehenden Ärzt*innen ein evidenzbasiertes Denken und Handeln. Mit den aktuellen Bestrebungen für eine Stärkung der wissenschaftlichen Kompetenzen angehender Ärzt*innen [ref:1], [zum vollständigen Text gelangen Sie über die oben angegebene URL]</description>
  </descriptions>
</resource>

Are you able to reproduce this? Is there a change in bolognese that would have affected text encoding?

ashwinisukale commented 1 year ago

Hi @codycooperross I guess misunderstood your question earlier, are you talking about the ? mark in the familyname element, I thought you are talking about <?xml version="1.0" encoding="UTF-8"?> this line.

codycooperross commented 1 year ago

Hi @codycooperross I guess misunderstood your question earlier, are you talking about the ? mark in the familyname element, I thought you are talking about <?xml version="1.0" encoding="UTF-8"?> this line.

Apologies—yes, I was referring to the question marks in the creatorName, affiliation, etc.

ashwinisukale commented 11 months ago

@codycooperross

On master branch and on this branch I get the same response, both has ? in the creatorName

ashwini ~/Documents/WorkSpace/CrossCite/content-negotiation master > curl -LH "Accept: application/vnd.datacite.datacite+xml" http://localhost:8085/10.82537/9vfw-rj81  
<?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">10.82537/9VFW-RJ81</identifier>
  <creators>
    <creator>
      <creatorName nameType="Personal">Pankatz-Reu??, Miriam</creatorName>