Indikator
Indikator

Reputation: 73

Microsoft Academic Graph CalcHisotgram Being Aborted

I'm using the CalcHistogram endpoint to query the total number of paper entities for every year from around 1980 to 2018. A typical response looks like this:

{
  "expr": "Y=2001",
  "num_entities": 4179575,
  "histograms": []
}

That's 4179575 papers from the year 2001.

However, starting at around year 2002 (the exact year is not consistent), the return values are being aborted.

{
  "expr": "Y=2002",
  "histograms": [],
  "aborted": true
}

This is what my request looks like. I've tried using both GET and POST methods.

GET 
https://api.labs.cognitive.microsoft.com/academic/v1.0/calchistogram? expr=Y=2002&model=latest&count=10&offset=0 HTTP/1.1
Host: api.labs.cognitive.microsoft.com

Any ideas on why this is being aborted or how I can find the total number of papers for each year?

Thanks!

Upvotes: 0

Views: 52

Answers (1)

Indikator
Indikator

Reputation: 73

Found that CalcHistogram endpoint also accepts a timeout parameter. The api will try to evaluate the query until timeout (which defaults to 1000 milli) is reached, at which point it returns aborted: true.

So, just add timeout: 5000 to your request.

Upvotes: 1

Related Questions