Top Description Inners Fields Constructors Methods
org.jabref.logic.importer.util

public Class GrobidService

extends Object
Class Inheritance
Imports
java.io.IOException, java.nio.file.Files, .Path, java.util.ArrayList, .List, .Optional, org.jabref.logic.importer.ImportFormatPreferences, .ParseException, org.jabref.logic.importer.fetcher.GrobidPreferences, org.jabref.logic.importer.fileformat.BibtexParser, org.jabref.model.entry.BibEntry, org.jsoup.Connection, .Jsoup

Implements an API to a GROBID server, as described at https://grobid.readthedocs.io/en/latest/Grobid-service/#grobid-web-services

Note

Currently a custom GROBID server is used... https://github.com/NikodemKch/grobid

The methods are structured to match the GROBID server api. Each method corresponds to a GROBID service request. Only the ones already used are already implemented.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum

Field Summary

Modifier and TypeField and Description
private final GrobidPreferences

Constructor Summary

AccessConstructor and Description
public
GrobidService(GrobidPreferences grobidPreferences)

Method Summary

Modifier and TypeMethod and Description
private static List<BibEntry>
getBibEntries(ImportFormatPreferences importFormatPreferences, String httpResponse)

public Optional<BibEntry>

Returns:

A BibEntry for the String
processCitation
(String rawCitation, ImportFormatPreferences importFormatPreferences, GrobidService.ConsolidateCitations consolidateCitations)

Calls the Grobid server for converting the citation into a BibEntry

public List<BibEntry>
processPDF(Path filePath, ImportFormatPreferences importFormatPreferences)

public List<BibEntry>
processReferences(List<Path> pathList, ImportFormatPreferences importFormatPreferences)

public List<BibEntry>
processReferences(Path filePath, ImportFormatPreferences importFormatPreferences)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

grobidPreferencesback to summary
private final GrobidPreferences grobidPreferences

Constructor Detail

GrobidServiceback to summary
public GrobidService(GrobidPreferences grobidPreferences)

Method Detail

getBibEntriesback to summary
private static List<BibEntry> getBibEntries(ImportFormatPreferences importFormatPreferences, String httpResponse) throws IOException, ParseException
processCitationback to summary
public Optional<BibEntry> processCitation(String rawCitation, ImportFormatPreferences importFormatPreferences, GrobidService.ConsolidateCitations consolidateCitations) throws IOException, ParseException

Calls the Grobid server for converting the citation into a BibEntry

Returns:Optional<BibEntry>

A BibEntry for the String

Exceptions
IOException:
if an I/O exception during the call occurred or no BibTeX entry could be determined
processPDFback to summary
public List<BibEntry> processPDF(Path filePath, ImportFormatPreferences importFormatPreferences) throws IOException, ParseException
processReferencesback to summary
public List<BibEntry> processReferences(List<Path> pathList, ImportFormatPreferences importFormatPreferences) throws IOException, ParseException
processReferencesback to summary
public List<BibEntry> processReferences(Path filePath, ImportFormatPreferences importFormatPreferences) throws IOException, ParseException
org.jabref.logic.importer.util back to summary

public final Enum GrobidService.ConsolidateCitations

extends Enum<GrobidService.ConsolidateCitations>
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final int
public static final GrobidService.ConsolidateCitations
public static final GrobidService.ConsolidateCitations
public static final GrobidService.ConsolidateCitations

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public int
public static GrobidService.ConsolidateCitations
public static GrobidService.ConsolidateCitations[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

codeback to summary
private final int code
NOback to summary
public static final GrobidService.ConsolidateCitations NO
WITH_DOI_ONLYback to summary
public static final GrobidService.ConsolidateCitations WITH_DOI_ONLY
WITH_METADATAback to summary
public static final GrobidService.ConsolidateCitations WITH_METADATA

Constructor Detail

ConsolidateCitationsback to summary
private ConsolidateCitations(int code)

Method Detail

getCodeback to summary
public int getCode()
valueOfback to summary
public static GrobidService.ConsolidateCitations valueOf(String name)
valuesback to summary
public static GrobidService.ConsolidateCitations[] values()