-
Notifications
You must be signed in to change notification settings - Fork 487
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
base: develop
Are you sure you want to change the base?
Changes from 3 commits
2b2da99
c8cdb8b
ccf74f9
34a795c
825d503
b8a068e
70031f3
f6e1b06
46de8fb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -163,7 +163,7 @@ private static void createStdyDscr(XMLStreamWriter xmlw, DatasetDTO datasetDto) | |
String persistentAuthority = datasetDto.getAuthority(); | ||
String persistentId = datasetDto.getIdentifier(); | ||
|
||
String pid = persistentProtocol + ":" + persistentAuthority + "/" + persistentId; | ||
String pid = persistentProtocol + ":" + persistentAuthority + ("perma".equals(persistentAgency) ? "" : "/") + persistentId; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. permalinks can have a separator - seems like we need to add that to the DTO? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes! I just tested with a PermaLink PID that uses a separator and it is indeed missing in the DDI exports. I thought maybe it would be merged into the authority, like I think a configured DOI authority and shoulder are merged in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. shoulder just becomes part of the identifier There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah I see There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've just pushed a commit adding the separator to the DTO. It's marked as WIP because for some reason it doesn't work yet (separator is always If I am on the wrong track with that commit, please let me know! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we really need to change the domain object? Can't we delegate the PID string generation to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This issue is now fixed. Tested with DOI, PermaLink without separator and PermaLink with separator For PermaLinks with separators, the database needs to be manually updated ( There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
@qqmyers would you prefer a solution using the GlobalId method instead of adding the separator to the database? I could take a look at implementing it that way instead (later today or on Monday) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. At first I was thinking that you didn't need the new column on dvobject (you can use PidUtil.parseAsGlobalID(String protocol, String authority, String identifier) to get a GlobalId), but it actually solves a limitation of permalinks right now - you can't have two providers that differ only by the separator because we don't store the separator and have to infer it. With that in mind, I think the new column is a good way to go. (I'd still use the GlobalId convenience methods whenever they're available, to avoid replicating the formatting code - looked like you mostly do that now except in DDIExportUtil where there's weirdness from tests sending null identifiers and for the one format with { in it.) |
||
String pidUri = pid; | ||
//Some tests don't send real PIDs - don't try to get their URL form | ||
if(!pidUri.equals("null:null/null")) { | ||
|
@@ -344,7 +344,7 @@ private static void writeDocDescElement (XMLStreamWriter xmlw, DatasetDTO datase | |
writeFullElement(xmlw, "titl", dto2Primitive(version, DatasetFieldConstant.title), datasetDto.getMetadataLanguage()); | ||
xmlw.writeStartElement("IDNo"); | ||
writeAttribute(xmlw, "agency", persistentAgency); | ||
xmlw.writeCharacters(persistentProtocol + ":" + persistentAuthority + "/" + persistentId); | ||
xmlw.writeCharacters(persistentProtocol + ":" + persistentAuthority + ("perma".equals(persistentAgency) ? "" : "/") + persistentId); | ||
xmlw.writeEndElement(); // IDNo | ||
xmlw.writeEndElement(); // titlStmt | ||
xmlw.writeStartElement("distStmt"); | ||
|
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>doi:10.5072/FK2/LK0D1H</electronic-resource-num>" + | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's weird that this old test expected There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @qqmyers commented above that this slash might be required by EndNote, although it does look weird to me 🤔 |
||
"</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>doi:10.5072/FK2/LK0D1H</electronic-resource-num>" + | ||
"</record>" + | ||
"</records>" + | ||
"</xml>"; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Has it been verified that an initial : after protocol is OK for EndNote import? It seems like the original code used / because ICPSR did. Can someone look at what EndNote exports and make sure we match it here? @adam3smith says he can check this next week if no one else has access.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, I wondered about that slash there. I tried to find some info on the EndNote XML format but found only this schema, which didn't specify anything about the format of
electronic-resource-num
, so I thought it might have been a mistake to use the slash. It would be great if someone could check.