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

fix: issues in exporters and citations for PermaLink/non-DOI PIDs #10790

Merged
merged 20 commits into from
Feb 6, 2025
Merged
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
2b2da99
fix: remove unnecessary slash in perma PIDs in DDI exporters
vera Aug 22, 2024
c8cdb8b
fix: remove doi property for perma PIDs in BibTeX citation
vera Aug 22, 2024
ccf74f9
fix: fix PID formatting in EndNote XML citation
vera Aug 22, 2024
34a795c
fix: use correct PID separator in DDI exporters (WIP)
vera Aug 22, 2024
825d503
fix: use correct PID separator in DDI exporters (WIP)
vera Aug 23, 2024
b8a068e
fix: use correct PID separator in DDI exporters
vera Aug 23, 2024
70031f3
fix: use GlobalId methods to create PID URLs/strings in DdiExportUtil
vera Aug 26, 2024
f6e1b06
fix: set separator when creating new dataset
vera Aug 27, 2024
46de8fb
test: add tests for DDI exports for datasets with PermaLinks
vera Aug 27, 2024
3275eba
Merge branch 'develop' into fix/perma-exporters-and-citations
vera Oct 23, 2024
07e327c
fix: fix failing DdiExportUtilTest by updating PermaLink config
vera Oct 23, 2024
a553458
fix: improve PID formatting in EndNote XML citation output
vera Oct 25, 2024
ae058d1
release note
qqmyers Oct 25, 2024
7317ac9
Merge branch 'develop' into fix/perma-exporters-and-citations
vera Dec 5, 2024
cf3ced8
Merge branch 'develop' into fix/perma-exporters-and-citations #10790
pdurbin Dec 18, 2024
0d75b88
rename sql script #10790
pdurbin Dec 18, 2024
746b2b4
new test and doc update
qqmyers Jan 17, 2025
43dcb00
Merge pull request #2 from GlobalDataverseCommunityConsortium/fix/per…
vera Jan 20, 2025
ed03452
Merge branch 'develop' into fix/perma-exporters-and-citations
vera Jan 20, 2025
b078516
Merge branch 'develop' into fix/perma-exporters-and-citations
vera Feb 5, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: improve PID formatting in EndNote XML citation output
vera committed Oct 25, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit a5534586d896db79b6d1106ac5aa557f7afa2d09
28 changes: 21 additions & 7 deletions src/main/java/edu/harvard/iq/dataverse/DataCitation.java
Original file line number Diff line number Diff line change
@@ -38,6 +38,10 @@
import org.apache.commons.text.StringEscapeUtils;
import org.apache.commons.lang3.StringUtils;

import static edu.harvard.iq.dataverse.pidproviders.doi.AbstractDOIProvider.DOI_PROTOCOL;
import static edu.harvard.iq.dataverse.pidproviders.handle.HandlePidProvider.HDL_PROTOCOL;
import static edu.harvard.iq.dataverse.pidproviders.perma.PermaLinkPidProvider.PERMA_PROTOCOL;

/**
*
* @author gdurand, qqmyers
@@ -597,11 +601,21 @@ private void createEndNoteXML(XMLStreamWriter xmlw) throws XMLStreamException {
}

xmlw.writeStartElement("urls");
xmlw.writeStartElement("related-urls");
xmlw.writeStartElement("url");
xmlw.writeCharacters(getPersistentId().asURL());
xmlw.writeEndElement(); // url
xmlw.writeEndElement(); // related-urls
if (persistentId != null) {
if (PERMA_PROTOCOL.equals(persistentId.getProtocol()) || HDL_PROTOCOL.equals(persistentId.getProtocol())) {
xmlw.writeStartElement("web-urls");
xmlw.writeStartElement("url");
xmlw.writeCharacters(getPersistentId().asURL());
xmlw.writeEndElement(); // url
xmlw.writeEndElement(); // web-urls
} else if (DOI_PROTOCOL.equals(persistentId.getProtocol())) {
xmlw.writeStartElement("related-urls");
xmlw.writeStartElement("url");
xmlw.writeCharacters(getPersistentId().asURL());
xmlw.writeEndElement(); // url
xmlw.writeEndElement(); // related-urls
}
}
xmlw.writeEndElement(); // urls

// a DataFile citation also includes the filename and (for Tabular
@@ -619,9 +633,9 @@ private void createEndNoteXML(XMLStreamWriter xmlw) throws XMLStreamException {
xmlw.writeEndElement(); // custom2
}
}
if (persistentId != null) {
if (persistentId != null && "doi".equals(persistentId.getProtocol())) {
xmlw.writeStartElement("electronic-resource-num");
String electResourceNum = persistentId.asString();
String electResourceNum = persistentId.asRawIdentifier();
xmlw.writeCharacters(electResourceNum);
xmlw.writeEndElement();
}
4 changes: 2 additions & 2 deletions src/test/java/edu/harvard/iq/dataverse/DataCitationTest.java
Original file line number Diff line number Diff line change
@@ -266,7 +266,7 @@ public void testToEndNoteString_withTitleAndAuthor() throws ParseException {
"<edition>V1</edition>" +
"<publisher>LibraScholar</publisher>" +
"<urls><related-urls><url>https://doi.org/10.5072/FK2/LK0D1H</url></related-urls></urls>" +
"<electronic-resource-num>doi:10.5072/FK2/LK0D1H</electronic-resource-num>" +
"<electronic-resource-num>10.5072/FK2/LK0D1H</electronic-resource-num>" +
"</record>" +
"</records>" +
"</xml>";
@@ -295,7 +295,7 @@ public void testToEndNoteString_withoutTitleAndAuthor() throws ParseException {
"<edition>V1</edition>" +
"<publisher>LibraScholar</publisher>" +
"<urls><related-urls><url>https://doi.org/10.5072/FK2/LK0D1H</url></related-urls></urls>" +
"<electronic-resource-num>doi:10.5072/FK2/LK0D1H</electronic-resource-num>" +
"<electronic-resource-num>10.5072/FK2/LK0D1H</electronic-resource-num>" +
"</record>" +
"</records>" +
"</xml>";