use of org.edamontology.pubfetcher.Fetcher in project edammap by edamontology.
the class UtilMain method run.
private static void run(UtilArgs args, Version version) throws IOException, ParseException, ReflectiveOperationException {
List<PublicationIds> publicationIds = null;
List<String> webpageUrls = null;
List<String> docUrls = null;
if (args.pubQuery != null)
publicationIds = pubQuery(args.pubQuery, args.queryType, args.fetcherArgs);
if (args.webQuery != null)
webpageUrls = webQuery(args.webQuery, args.queryType, args.fetcherArgs);
if (args.docQuery != null)
docUrls = docQuery(args.docQuery, args.queryType, args.fetcherArgs);
if (args.allQuery != null) {
if (publicationIds == null)
publicationIds = pubQuery(args.allQuery, args.queryType, args.fetcherArgs);
else
publicationIds.addAll(pubQuery(args.allQuery, args.queryType, args.fetcherArgs));
if (webpageUrls == null)
webpageUrls = webQuery(args.allQuery, args.queryType, args.fetcherArgs);
else
webpageUrls.addAll(webQuery(args.allQuery, args.queryType, args.fetcherArgs));
if (docUrls == null)
docUrls = docQuery(args.allQuery, args.queryType, args.fetcherArgs);
else
docUrls.addAll(docQuery(args.allQuery, args.queryType, args.fetcherArgs));
}
FetcherUtil.run(args.fetcherUtilArgs, new Fetcher(), args.fetcherArgs, publicationIds, webpageUrls, docUrls, version);
Util.run(args, version);
}
use of org.edamontology.pubfetcher.Fetcher in project edammap by edamontology.
the class PubMedApps method meshQuery.
private static void meshQuery(FetcherArgs fetcherArgs) throws IOException, ParseException, URISyntaxException {
String meshQuery = new URI("https", "eutils.ncbi.nlm.nih.gov", "/entrez/eutils/esearch.fcgi", "db=pubmed&term=" + MESH_QUERY + "&retmax=1000000", null).toASCIIString();
Set<String> pmids = new LinkedHashSet<>();
Document doc = new Fetcher().getDoc(meshQuery, null, fetcherArgs);
if (doc != null) {
for (Element id : doc.getElementsByTag("Id")) {
pmids.add(id.text());
}
}
for (String pmid : pmids) {
System.out.println(pmid + "\t\t");
}
}
Aggregations