25
$\begingroup$

I found at Twitter that is possible to search for arXiv articles with Mathematica, e.g. the following code:

arXiv = ServiceConnect["ArXiv"];
articles = arXiv["Search", {"Query" -> "Mathematica"}];
articles[All, {"URL", "Title"}]

gives as result:

enter image description here

My question is:

  1. How can I specify the time range in between the articles were published?

  2. Is it possible to combine search keywords with binary operators (AND, OR, etc.)?

UPDATE:

To my second question:

articles = 
  arXiv["Search", {"Query" -> {"Title" -> {"Mathematica" | "Solving"}}}];

searches for all articles containing "Mathematica" OR "Solving" in "Title"

articles = 
  arXiv["Search", {"Query" -> {"Title" -> {"Mathematica", "Solving"}}}];

searches for all articles containing "Mathematica" AND "Solving" in "Title"

$\endgroup$
  • 4
    $\begingroup$ Interesting that you only get 10 results - on the ArXiv web page there are more than 1000 hits - ah one needs a , MaxItems -> 250 or some such. $\endgroup$ – user21 Dec 3 '16 at 19:34
  • 1
    $\begingroup$ Just use google :) $\endgroup$ – M.R. Dec 7 '16 at 16:11
4
$\begingroup$

Following up on the previous answer you can restrict by date pretty trivially using Mathematica:

arXiv = ServiceConnect["ArXiv"];
articles = arXiv["Search", {
    "Query" -> "Mathematica",
    "MaxItems" -> 1000, 
    "SortBy" -> "DateSubmitted"}];

selectFromRange[articles_, dmin_, dmax_] :=

 With[{min = DateObject@Normal@dmin, max = DateObject@Normal@dmax},
  articles[Select[min < #Published < max &]]
  ];

selectFromRange[articles, DateObject@Today[{"Year"}], Today]

Looking through the API documentation there doesn't seem to be a way to restrict within an API call and so any processing by date would have to be done after the fact anyway.

$\endgroup$
  • 1
    $\begingroup$ That could be shortened a fair bit: articles[Select[#Updated ~Between~ {DateObject[{2016, 12, 20}], Today} &]]. $\endgroup$ – J. M. will be back soon Dec 29 '16 at 18:54
  • 1
    $\begingroup$ I figured for generality I'd leave the conversion of an arbitrary DateObject to it's most expanded form. Size comparisons for DateObjects with the different degrees of specificity, e.g., DateObject[{2016, 12}] and DateObject[{2016, 12, 10}] don't evaluate and the Normal scheme gets them to (by expanding to a DateList. One error though is that Today["Year"] should be DateObject@Today[{"Year"}]. $\endgroup$ – b3m2a1 Dec 29 '16 at 18:59
  • 1
    $\begingroup$ Huh. This works, tho: articles[Select[#Published ~Between~ {DateObject[{2016, 10}], DateObject[{2016, 12}]} &]] $\endgroup$ – J. M. will be back soon Dec 29 '16 at 19:17
  • 1
    $\begingroup$ That should select anything from Dec 11 2016. Try: Between[DateObject[{2016, 12, 10}], {DateObject[{2016, 10}], DateObject[{2016, 12}]}] to see what I mean. You get DateObject[{2016, 12, 10}] <= DateObject[{2016, 12}] as a return. $\endgroup$ – b3m2a1 Dec 29 '16 at 19:20
18
$\begingroup$

Something like this:

arXiv = ServiceConnect["ArXiv"];

articles = 
  arXiv["Search", {"Query" -> {"Abstract" -> {"Eigenvalues", 
        "Mathematica"}}, MaxItems -> 25, "SortBy" -> "DateSubmitted"}];
articles[All, {"URL", "Title", "Published"}]

Looking at the help page has more info: ArXiv

$\endgroup$
  • 4
    $\begingroup$ This successfully sorts the results by date, but how do you restrict results to be between a date range, as requested by the OP? $\endgroup$ – QuantumDot Dec 3 '16 at 20:12
  • 1
    $\begingroup$ Yes, this is one of the questions ... the rest I found also in the help. $\endgroup$ – mrz Dec 3 '16 at 21:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.