use of org.jabref.logic.importer.fetcher.CrossRef in project jabref by JabRef.
the class WebFetchers method getIdBasedFetchers.
public static List<IdBasedFetcher> getIdBasedFetchers(ImportFormatPreferences importFormatPreferences) {
ArrayList<IdBasedFetcher> list = new ArrayList<>();
list.add(new ArXiv(importFormatPreferences));
list.add(new AstrophysicsDataSystem(importFormatPreferences));
list.add(new IsbnFetcher(importFormatPreferences));
list.add(new DiVA(importFormatPreferences));
list.add(new DoiFetcher(importFormatPreferences));
list.add(new MedlineFetcher());
list.add(new TitleFetcher(importFormatPreferences));
list.add(new MathSciNet(importFormatPreferences));
list.add(new CrossRef());
list.add(new LibraryOfCongress());
list.sort(Comparator.comparing(WebFetcher::getName));
return list;
}
use of org.jabref.logic.importer.fetcher.CrossRef in project jabref by JabRef.
the class WebFetchers method getIdFetchers.
public static List<IdFetcher> getIdFetchers(ImportFormatPreferences importFormatPreferences) {
ArrayList<IdFetcher> list = new ArrayList<>();
list.add(new CrossRef());
list.add(new ArXiv(importFormatPreferences));
list.sort(Comparator.comparing(WebFetcher::getName));
return list;
}
use of org.jabref.logic.importer.fetcher.CrossRef in project jabref by JabRef.
the class WebFetchers method getSearchBasedFetchers.
public static List<SearchBasedFetcher> getSearchBasedFetchers(ImportFormatPreferences importFormatPreferences) {
ArrayList<SearchBasedFetcher> list = new ArrayList<>();
list.add(new ArXiv(importFormatPreferences));
list.add(new GvkFetcher());
list.add(new MedlineFetcher());
list.add(new AstrophysicsDataSystem(importFormatPreferences));
list.add(new MathSciNet(importFormatPreferences));
list.add(new zbMATH(importFormatPreferences));
list.add(new GoogleScholar(importFormatPreferences));
list.add(new DBLPFetcher(importFormatPreferences));
list.add(new CrossRef());
list.sort(Comparator.comparing(WebFetcher::getName));
return list;
}
use of org.jabref.logic.importer.fetcher.CrossRef in project jabref by JabRef.
the class WebFetchers method getEntryBasedFetchers.
public static List<EntryBasedFetcher> getEntryBasedFetchers(ImportFormatPreferences importFormatPreferences) {
ArrayList<EntryBasedFetcher> list = new ArrayList<>();
list.add(new AstrophysicsDataSystem(importFormatPreferences));
list.add(new DoiFetcher(importFormatPreferences));
list.add(new MathSciNet(importFormatPreferences));
list.add(new CrossRef());
list.sort(Comparator.comparing(WebFetcher::getName));
return list;
}
use of org.jabref.logic.importer.fetcher.CrossRef in project jabref by JabRef.
the class CrossrefFetcherEvaluator method main.
public static void main(String[] args) throws IOException, InterruptedException {
Globals.prefs = JabRefPreferences.getInstance();
try (FileReader reader = new FileReader(args[0])) {
BibtexParser parser = new BibtexParser(Globals.prefs.getImportFormatPreferences());
ParserResult result = parser.parse(reader);
BibDatabase db = result.getDatabase();
List<BibEntry> entries = db.getEntries();
AtomicInteger dois = new AtomicInteger();
AtomicInteger doiFound = new AtomicInteger();
AtomicInteger doiNew = new AtomicInteger();
AtomicInteger doiIdentical = new AtomicInteger();
int total = entries.size();
CountDownLatch countDownLatch = new CountDownLatch(total);
ExecutorService executorService = Executors.newFixedThreadPool(5);
for (BibEntry entry : entries) {
executorService.execute(new Runnable() {
@Override
public void run() {
Optional<DOI> origDOI = entry.getField(FieldName.DOI).flatMap(DOI::parse);
if (origDOI.isPresent()) {
dois.incrementAndGet();
try {
Optional<DOI> crossrefDOI = new CrossRef().findIdentifier(entry);
if (crossrefDOI.isPresent()) {
doiFound.incrementAndGet();
if (origDOI.get().getDOI().equalsIgnoreCase(crossrefDOI.get().getDOI())) {
doiIdentical.incrementAndGet();
} else {
System.out.println("DOI not identical for : " + entry);
}
} else {
System.out.println("DOI not found for: " + entry);
}
} catch (FetcherException e) {
e.printStackTrace();
}
} else {
try {
Optional<DOI> crossrefDOI = new CrossRef().findIdentifier(entry);
if (crossrefDOI.isPresent()) {
System.out.println("New DOI found for: " + entry);
doiNew.incrementAndGet();
}
} catch (FetcherException e) {
e.printStackTrace();
}
}
countDownLatch.countDown();
}
});
}
countDownLatch.await();
System.out.println("---------------------------------");
System.out.println("Total DB size: " + total);
System.out.println("Total DOIs: " + dois);
System.out.println("DOIs found: " + doiFound);
System.out.println("DOIs identical: " + doiIdentical);
System.out.println("New DOIs found: " + doiNew);
executorService.shutdown();
}
}
Aggregations