Verified Owner
Top Description Fields Constructors Methods
org.jabref.logic.importer.fetcher.citation.crossref

public Class CrossRefCitationFetcher

extends Object
implements CitationFetcher
Class Inheritance
All Implemented Interfaces
org.jabref.logic.importer.fetcher.citation.CitationFetcher, org.jabref.logic.importer.fetcher.citation.CitationCountFetcher
Imports
java.io.IOException, .InputStream, java.net.MalformedURLException, .URI, .URISyntaxException, java.util.List, .Optional, org.jabref.logic.ai.chatting.ChatModel, org.jabref.logic.ai.preferences.AiPreferences, org.jabref.logic.citationkeypattern.CitationKeyPatternPreferences, org.jabref.logic.importer.FetcherException, .ImportFormatPreferences, .ImporterPreferences, org.jabref.logic.importer.fetcher.CrossRef, org.jabref.logic.importer.fetcher.citation.CitationFetcher, org.jabref.logic.importer.plaincitation.PlainCitationParser, .PlainCitationParserChoice, .PlainCitationParserFactory, org.jabref.logic.importer.util.GrobidPreferences, org.jabref.logic.net.URLDownload, org.jabref.model.entry.BibEntry, org.jabref.model.entry.field.Field, .InternalField, .StandardField, org.jabref.model.entry.identifier.DOI, org.jabref.model.entry.types.StandardEntryType, org.jooq.lambda.Unchecked, org.slf4j.Logger, .LoggerFactory, tools.jackson.databind.JsonNode, .ObjectMapper

Uses CrossRef's REST API for getting paper information

Example URL: https://api.crossref.org/works/10.47397/tb/44-3/tb138kopp-jabref

Field Summary

Modifier and TypeField and Description
private final AiPreferences
private static final String
private final ChatModel
private final CitationKeyPatternPreferences
private final CrossRef
public static final String
private final GrobidPreferences
private final ImporterPreferences
private final ImportFormatPreferences
private static final Logger
private final ObjectMapper

Constructor Summary

AccessConstructor and Description
public
CrossRefCitationFetcher(ImporterPreferences importerPreferences, ImportFormatPreferences importFormatPreferences, CitationKeyPatternPreferences citationKeyPatternPreferences, GrobidPreferences grobidPreferences, AiPreferences aiPreferences, ChatModel chatModel)

Method Summary

Modifier and TypeMethod and Description
private void
private BibEntry
private BibEntry
getBibEntryFromDoi(String referenceDoi, JsonNode unstructured)

private BibEntry
public Optional<Integer>
public List<BibEntry>
public Optional<URI>
getCitationsApiUri(BibEntry entry)

Overrides default org.jabref.logic.importer.fetcher.citation.CitationFetcher.getCitationsApiUri.

CrossRef does not support fetching citations for a given entry.

public String
getName()

Implements org.jabref.logic.importer.fetcher.citation.CitationFetcher.getName.

Returns the localized name of this fetcher.

public List<BibEntry>
public Optional<URI>
getReferencesApiUri(BibEntry entry)

Overrides default org.jabref.logic.importer.fetcher.citation.CitationFetcher.getReferencesApiUri.

Returns the API URL for fetching references

private void
setField(BibEntry bibEntry, Field field, JsonNode reference, String path)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

aiPreferencesback to summary
private final AiPreferences aiPreferences
API_URLback to summary
private static final String API_URL
chatModelback to summary
private final ChatModel chatModel
citationKeyPatternPreferencesback to summary
private final CitationKeyPatternPreferences citationKeyPatternPreferences
crossRefForDoiback to summary
private final CrossRef crossRefForDoi
FETCHER_NAMEback to summary
public static final String FETCHER_NAME
grobidPreferencesback to summary
private final GrobidPreferences grobidPreferences
importerPreferencesback to summary
private final ImporterPreferences importerPreferences
importFormatPreferencesback to summary
private final ImportFormatPreferences importFormatPreferences
LOGGERback to summary
private static final Logger LOGGER
mapperback to summary
private final ObjectMapper mapper

Constructor Detail

CrossRefCitationFetcherback to summary
public CrossRefCitationFetcher(ImporterPreferences importerPreferences, ImportFormatPreferences importFormatPreferences, CitationKeyPatternPreferences citationKeyPatternPreferences, GrobidPreferences grobidPreferences, AiPreferences aiPreferences, ChatModel chatModel)

Method Detail

findDoiForEntryback to summary
private void findDoiForEntry(BibEntry clonedEntry)
getBibEntryFromDataback to summary
private BibEntry getBibEntryFromData(JsonNode reference)
getBibEntryFromDoiback to summary
private BibEntry getBibEntryFromDoi(String referenceDoi, JsonNode unstructured) throws FetcherException
getBibEntryFromTextback to summary
private BibEntry getBibEntryFromText(PlainCitationParser parser, String unstructured)
getCitationCountback to summary
public Optional<Integer> getCitationCount(BibEntry entry) throws FetcherException

Implements org.jabref.logic.importer.fetcher.citation.CitationCountFetcher.getCitationCount.

Crossref has no citation count feature

Annotations
@Override
getCitationsback to summary
public List<BibEntry> getCitations(BibEntry entry) throws FetcherException

Implements org.jabref.logic.importer.fetcher.citation.CitationFetcher.getCitations.

Not supported by CrossRef. Therefore, always returning an empty list.

Annotations
@Override
getCitationsApiUriback to summary
public Optional<URI> getCitationsApiUri(BibEntry entry)

Overrides default org.jabref.logic.importer.fetcher.citation.CitationFetcher.getCitationsApiUri.

CrossRef does not support fetching citations for a given entry.

Annotations
@Override
getNameback to summary
public String getName()

Implements org.jabref.logic.importer.fetcher.citation.CitationFetcher.getName.

Doc from org.jabref.logic.importer.fetcher.citation.CitationFetcher.getName.

Returns the localized name of this fetcher. The title can be used to display the fetcher in the menu and in the side pane.

Annotations
@Override
getReferencesback to summary
public List<BibEntry> getReferences(BibEntry entry) throws FetcherException

Implements org.jabref.logic.importer.fetcher.citation.CitationFetcher.getReferences.

Doc from org.jabref.logic.importer.fetcher.citation.CitationFetcher.getReferences.

Looks for hits which are cited by the given BibEntry. This typically is the "References" (or "Bibliography" or "Literature") section of a paper.

Annotations
@Override
getReferencesApiUriback to summary
public Optional<URI> getReferencesApiUri(BibEntry entry)

Overrides default org.jabref.logic.importer.fetcher.citation.CitationFetcher.getReferencesApiUri.

Doc from org.jabref.logic.importer.fetcher.citation.CitationFetcher.getReferencesApiUri.

Returns the API URL for fetching references

Annotations
@Override
setFieldback to summary
private void setField(BibEntry bibEntry, Field field, JsonNode reference, String path)