1

I am trying to use the Microsoft Academic Graph API with Python, to get information about the Author's Affiliations. However, the information provided in

https://learn.microsoft.com/en-us/azure/cognitive-services/academic-knowledge/graphsearchmethod

is not clear to me.

I have also read Microsoft Academic Graph Search - retrieving all papers from a journal within a time-frame?

I am trying with something like this:

import requests

url = "https://westus.api.cognitive.microsoft.com/academic/v1.0/graph/search"

querystring = {"mode":"json%0A"}

payload = "{}"

response = requests.request("POST", url, data=payload, params=querystring)

print(response.text)

What should I put in "payload" to retrieve the affiliation of, for example, the Author "John Doe" ?

Laura
  • 1,192
  • 2
  • 18
  • 36
  • Your first link, to the Microsoft docs page, includes a full example of what a query payload might look like 0 just underneath the text `For the json search, if we want to get the papers whose titles contain "graph engine" and written by "bin shao", we can specify the query as follows.` – Danielle M. Jan 21 '19 at 02:04
  • Yes, I have tried it, but i dont get any results. Also i dont know how to get the affiliation of one particular author – Laura Jan 21 '19 at 03:22
  • @DanielleM., when I try the particular example you tell me I get: { "statusCode": 404, "message": "Resource not found" } – Laura Jan 21 '19 at 11:45

2 Answers2

2

It seems you are using the wrong endpoint. As for anything experimental the documentation seems out of date. I have had success calling https://api.labs.cognitive.microsoft.com/academic/v1.0/evaluate These endpoints can be seen in the cognitive labs documentation.

I am yet to figure out how to retrieve academic profiles, as the query below yields no results, whereas academic.microsoft.com has loads.

https://api.labs.cognitive.microsoft.com/academic/v1.0/evaluate?expr=Composite(AA.AuN='Harry L. Anderson')&model=latest&count=10&attributes=Id,Ti,AA.AuN,E,AA.AuId

Hope this may help anyone stumbling upon this.

Update :

Here is a working query for the same author : https://api.labs.cognitive.microsoft.com/academic/v1.0/evaluate?model=latest&count=100&expr=Composite(AA.AuN=='harry l anderson')&attributes=Id,Ti,AA.AuN,E,AA.AuId

Notice the author name has to be in lowercase.

0

there's a tool for migrating the MAG into an Apache Elasticsearch ;)

https://github.com/vwoloszyn/mag2elasticsearch