azureazure-cognitive-servicesknowledge-management

Microsoft Cognitive Academic Knowledge API - validity of EXPR parameters


When trying to query for a specific DOI attribute using the following URL:

https://api.labs.cognitive.microsoft.com/academic/v1.0/evaluate?model=latest&count=10&offset=0&attributes=Id,Ti&expr=And(Composite(DOI='doi:10.1594/PANGAEA.667386'),Y=[2000,2009])&subscription-key=SUBSCRIPTION_KEY_HERE

I get the following error:

{"Error":{"Code":"Bad Argument","Message":"Invalid query expression\r\nParameter name: expression"}}

However when accessing using a different attribute, e.g. journal ID as below:

https://api.labs.cognitive.microsoft.com/academic/v1.0/evaluate?expr=And(Composite(J.JId=114840262),Y=[2013,2015])&model=latest&count=10&offset=0&attributes=Id,Ti,J.JN,J.JId,Y&subscription-key=SUBSCRIPTION_KEY_HERE

It works fine! Why does the behaviour of the API only work with some attributes? What am I doing wrong?

Relevant documentation I've read:
https://learn.microsoft.com/en-us/azure/cognitive-services/academic-knowledge/evaluatemethod

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


Solution

  • Not all entity attributes can be queried for/matched against; some can only be requested as part of the result when querying against other entity attribute fields.

    You can reference the Paper Entity documentation to see what query operations are available for different attributes. For example citation count (CC) does not support any matching operations, hence the "none" in the "Operations" column, however journal name (J.JN) supports the equality operator.

    Unfortunately, DOI is part of the "Extended" attributes, none of which support matching operations.