-
Notifications
You must be signed in to change notification settings - Fork 0
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
Story/cite-177 There needs to be an import from Crossref #22
Conversation
…rossrefReferenceImportProcessor accordingly
Can one of the admins verify this patch? |
} | ||
return file; | ||
} | ||
protected abstract BibEntryIterator getbibIterator(KafkaJobMessage message, JobInfo info); |
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.
should be getBibEntryIterator
public final static String EDITED_BOOK = "edited-book"; | ||
public final static String PROCEEDINGS_ARTICLE = "proceedings-article"; | ||
public final static String DISSERTATION = "dissertation"; | ||
public final static String BOOK_SECTION = "book-section"; |
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.
this already exists (BOOK_CHAPTER
)
@@ -12,6 +12,34 @@ public class Publication implements BibEntry { | |||
public final static String NEWS_ITEM = "newspaperArticle"; | |||
public final static String PROCEEDINGS_PAPER = "conferencePaper"; | |||
public final static String DOCUMENT = "document"; | |||
// publication types in CrossRef | |||
public final static String MONOGRAPH = "monograph"; |
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.
we can use BOOK
instead
public final static String POSTED_CONTENT = "posted-content"; | ||
public final static String COMPONENT = "component"; | ||
public final static String EDITED_BOOK = "edited-book"; | ||
public final static String PROCEEDINGS_ARTICLE = "proceedings-article"; |
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.
this is the same as PROCEEDINGS_PAPER
I believe
@@ -81,45 +65,105 @@ public void init() { | |||
itemTypeMapping.put(Publication.NEWS_ITEM, ItemType.NEWSPAPER_ARTICLE); | |||
itemTypeMapping.put(Publication.PROCEEDINGS_PAPER, ItemType.CONFERENCE_PAPER); | |||
itemTypeMapping.put(Publication.DOCUMENT, ItemType.DOCUMENT); | |||
itemTypeMapping.put(Publication.MONOGRAPH, ItemType.BOOK); | |||
itemTypeMapping.put(Publication.JOURNAL_ISSUE, ItemType.JOURNAL_ARTICLE); |
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.
this is wrong I believe, an issue is not an article. I think we will simply not deal with those and not import issues.
meta.setIssns(issnList); | ||
|
||
List<Contributor> contributors = new ArrayList<>(); | ||
if(item.getChair() != null) { |
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.
?
|
||
private ArticleMeta parseArticleMeta(Item item) { | ||
ArticleMeta meta = new ArticleMeta(); | ||
meta.setArticleTitle(String.join(", ", item.getTitle())); |
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.
?
ref.setReferenceId(itemRef.getKey()); | ||
ref.setReferenceString(itemRef.getUnstructured()); | ||
ref.setReferenceStringRaw(itemRef.getUnstructured()); | ||
references.add(ref); |
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.
?
BibEntry nextEntry = new Publication();; | ||
|
||
try { | ||
Item item = crossrefService.get(info.getDois().get(currentIndex)); |
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.
instead of keeping an int around, just get an interator from the dois list and keep that
@@ -13,6 +13,7 @@ | |||
import com.fasterxml.jackson.databind.node.ObjectNode; | |||
|
|||
import edu.asu.diging.citesphere.importer.core.model.BibEntry; | |||
import edu.asu.diging.citesphere.importer.core.model.impl.Publication; |
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.
is this needed?
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 think the abstract import processor should still stay in the impl
package, it's part implementation after all.
|
||
private ArticleMeta parseArticleMeta(Item item) { | ||
ArticleMeta meta = new ArticleMeta(); | ||
meta.setArticleTitle(String.join(", ", item.getTitle())); |
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.
this still
ref.setReferenceId(itemRef.getKey()); | ||
ref.setReferenceString(itemRef.getUnstructured()); | ||
ref.setReferenceStringRaw(itemRef.getUnstructured()); | ||
references.add(ref); |
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.
this still
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.
unaddressed comments
Looks fine. Once the Citesphere PR is ready to be tested, I'll deploy this. |
private ArticleMeta parseArticleMeta(Item item) { | ||
ArticleMeta meta = new ArticleMeta(); | ||
meta.setArticleTitle(item.getTitle().get(0)); | ||
meta.setShortTitle(String.join(", ", item.getTitle().subList(1, item.getTitle().size()))); |
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.
That doesn't seem right. Why would the short title be a concatenation of all other titles? If zotero doesn't allow additional titles, then we might just want to drop them for now.
contributors.addAll(mapPersonToContributor(item.getTranslator(), ContributionType.TRANSLATOR)); | ||
} | ||
// List of chair | ||
if(item.getChair() != null) { |
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.
is that all contributor types that crossref knows?
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.
Yes. crossref has 4 types of contributors - authors, editors, translators & chair
} | ||
meta.setContributors(contributors); | ||
|
||
meta.setAuthorNotesCorrespondence(null); |
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.
isn't that the default?
meta.setLanguage(item.getLanguage()); | ||
ReviewInfo review = new ReviewInfo(); | ||
if (item.getReview() != null) { | ||
review.setFullDescription(item.getReview().getCompetingInterestStatement()); |
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.
is full description the same as competing interest statement?
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.
Yes.
private Reference mapSingleReference(edu.asu.diging.crossref.model.Reference itemRef) { | ||
Reference ref = new Reference(); | ||
ref.setAuthorString(itemRef.getAuthor()); | ||
ref.setContributors(null); |
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.
same as before, isn't that the default value?
...n/java/edu/asu/diging/citesphere/importer/core/service/parse/iterators/CrossRefIterator.java
Show resolved
Hide resolved
@@ -81,45 +66,99 @@ public void init() { | |||
itemTypeMapping.put(Publication.NEWS_ITEM, ItemType.NEWSPAPER_ARTICLE); | |||
itemTypeMapping.put(Publication.PROCEEDINGS_PAPER, ItemType.CONFERENCE_PAPER); | |||
itemTypeMapping.put(Publication.DOCUMENT, ItemType.DOCUMENT); | |||
itemTypeMapping.put(Publication.BOOK, ItemType.BOOK); |
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.
duplicate of line 63
itemTypeMapping.put(Publication.EDITED_BOOK, ItemType.BOOK); | ||
itemTypeMapping.put(Publication.PROCEEDINGS_PAPER, ItemType.CONFERENCE_PAPER); | ||
itemTypeMapping.put(Publication.DISSERTATION, ItemType.THESIS); | ||
itemTypeMapping.put(Publication.BOOK_CHAPTER, ItemType.BOOK_SECTION); |
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.
duplicate
.../main/java/edu/asu/diging/citesphere/importer/core/service/impl/AbstractImportProcessor.java
Show resolved
Hide resolved
@@ -0,0 +1,157 @@ | |||
package edu.asu.diging.citesphere.importer.core.service.parse.crossref; |
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.
should be moved to an impl
package
import edu.asu.diging.crossref.model.Person; | ||
|
||
@Component | ||
public class CrossRefParser implements ICrossRefParser { |
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.
needs javadoc and tests
} | ||
|
||
@Test | ||
public void testParseJournalMeta_WithValidData() { |
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.
test method names should follow our naming convention (documented in confluence)
// we might want to devise a way to decide if the | ||
// service might be down and we should stop sending requests. | ||
} | ||
return nextEntry; |
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.
shouldn't this return null if there was an exception? Otherwise it would just return an empty publication, which doesn't seem to make much sense.
Guidelines for Pull Requests
If you haven't yet read our code review guidelines, please do so, You can find them here.
Please confirm the following by adding an x for each item (turn
[ ]
into[x]
).Please provide a brief description of your ticket
The user should be able to search in crossref to references to import. whatever search results from Crossref a user selects should then be imported into citesphere. This could be all search results or just a few or one.
For now, let's put add an entry to the import menu and let the user select which group to import the results into from a dropdown menu.
The importing should be done from Citesphere Importer (not Citesphere), similar how entries from files are imported.
For querying crossref, this library should be used: https://github.com/diging/crossref-connect. However, this is not yet released into maven central, so talk to Julia before picking up this ticket.
... Put ticket description here and add link to ticket ...
https://diging.atlassian.net/browse/CITE-177
Are there any other pull requests that this one depends on?
diging/citesphere-messages#12
diging/citesphere#271
Anything else the reviewer needs to know?
... describe here ...