adsabs / adsabs-dev-api

Developer API service description and example client code
162 stars 58 forks source link

Syntax error while parsing DOI #66

Closed eschnett closed 4 years ago

eschnett commented 4 years ago

I am trying to look up this DOI: 10.1007/jhep0(.2013)041. This leads to a syntax error when using the API. It leads to an internal error when I use the search field on the web page.

The full error message I receive is (I am using Julia, but the error should be "readable" anyway):

ERROR: HTTP.ExceptionRequest.StatusError(400, "GET", "/v1/search/query?q=doi:10.1007%2Fjhep07%282013%29041&fl=bibcode,citation_count", HTTP.Messages.Response: """ HTTP/1.1 400 Bad Request Date: Tue, 28 Jul 2020 04:00:40 GMT Content-Type: application/json Content-Length: 565 Connection: keep-alive Server: openresty/1.15.8.1 Access-Control-Allow-Origin: http://0.0.0.0:8000, http://adsabs.harvard.edu, http://adsx.cfa.harvard.edu:8888, http://hourly.adslabs.org, http://localhost:8000, http://ui.adsabs.harvard.edu, http://ui.adslabs.org, https://arxiv.org, https://beta.arxiv.org, https://demo.adsabs.harvard.edu, https://dev.adsabs.harvard.edu, https://devui.adsabs.harvard.edu, https://experimental-bumblebee.us-east-1.elasticbeanstalk.com, https://prod.adsabs.harvard.edu, https://staging-bumblebee.elasticbeanstalk.com, https://staging-bumblebee.us-east-1.elasticbeanstalk.com, https://ui.adsabs.harvard.edu Access-Control-Allow-Methods: DELETE, GET, OPTIONS, POST, PUT Access-Control-Allow-Headers: Accept, Authorization, Content-Type, Orcid-Authorization, X-BB-Api-Client-Version, X-CSRFToken Access-Control-Allow-Credentials: true Vary: Origin X-RateLimit-Limit: 5000 X-RateLimit-Remaining: 4823 X-RateLimit-Reset: 1595992737 Retry-After: 83896 Set-Cookie: session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJS8gv3LY808i33DffL9qvKrvBzyTb2qwqt8Hfxy_TL9a30c_fKijQKNPB1cbVVqgXqLUgtyk3MS80rgZlWWpxaBDZRycjMxEipFgDRzSOy.Xx-i6A.UtqEVCdOAuRzdIAGbynY5Mjaz3g; Expires=Wed, 28-Jul-2021 10:00:40 GMT; HttpOnly; Path=/

{"responseHeader":{"status":400,"QTime":1,"params":{"q":"doi:10.1007/jhep07(2013)041","fl":"bibcode,citation_count","start":"0","internal_logging_params":"X-Amzn-Trace-Id=Root=1-5f1fa2e8-415e19707bffd2ffa6d5e046","rows":"10","wt":"json"}},"error":{"metadata":["error-class","org.apache.solr.common.SolrException","root-error-class","java.lang.Exception"],"msg":"org.apache.solr.search.SyntaxError: INVALID_SYNTAX_CANNOT_PARSE: Syntax Error, cannot parse doi:10.1007/jhep07(2013)041: The parser reported a syntax error, antlrqueryparser hates errors! ","code":400}} """)

csgrant00 commented 4 years ago

Erik,

That DOI leads to the error - where did you get it? It looks malformed (most are of the format: 10.1007/JHEP01(2013)041, 10.1007/JHEP02(2013)041, etc.)

-Carolyn


Carolyn Stern Grant Astrophysics Data System (ADS)

cgrant@cfa.harvard.edu Center for Astrophysics

617-495-7154 (voicemail) 60 Garden Street MS 83

617-495-7356 fax Cambridge, MA 02138


On Tue, Jul 28, 2020 at 10:59 AM Erik Schnetter notifications@github.com wrote:

I am trying to look up this DOI: 10.1007/jhep0(.2013)041. This leads to a syntax error when using the API. It leads to an internal error when I use the search field on the web page.

The full error message I receive is (I am using Julia, but the error should be "readable" anyway):

ERROR: HTTP.ExceptionRequest.StatusError(400, "GET", "/v1/search/query?q=doi:10.1007%2Fjhep07%282013%29041&fl=bibcode,citation_count", HTTP.Messages.Response: """ HTTP/1.1 400 Bad Request Date: Tue, 28 Jul 2020 04:00:40 GMT Content-Type: application/json Content-Length: 565 Connection: keep-alive Server: openresty/1.15.8.1 Access-Control-Allow-Origin: http://0.0.0.0:8000, http://adsabs.harvard.edu, http://adsx.cfa.harvard.edu:8888, http://hourly.adslabs.org, http://localhost:8000, http://ui.adsabs.harvard.edu, http://ui.adslabs.org, https://arxiv.org, https://beta.arxiv.org, https://demo.adsabs.harvard.edu, https://dev.adsabs.harvard.edu, https://devui.adsabs.harvard.edu, https://experimental-bumblebee.us-east-1.elasticbeanstalk.com, https://prod.adsabs.harvard.edu, https://staging-bumblebee.elasticbeanstalk.com, https://staging-bumblebee.us-east-1.elasticbeanstalk.com, https://ui.adsabs.harvard.edu Access-Control-Allow-Methods: DELETE, GET, OPTIONS, POST, PUT Access-Control-Allow-Headers: Accept, Authorization, Content-Type, Orcid-Authorization, X-BB-Api-Client-Version, X-CSRFToken Access-Control-Allow-Credentials: true Vary: Origin X-RateLimit-Limit: 5000 X-RateLimit-Remaining: 4823 X-RateLimit-Reset: 1595992737 Retry-After: 83896 Set-Cookie: session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJS8gv3LY808i33DffL9qvKrvBzyTb2qwqt8Hfxy_TL9a30c_fKijQKNPB1cbVVqgXqLUgtyk3MS80rgZlWWpxaBDZRycjMxEipFgDRzSOy.Xx-i6A.UtqEVCdOAuRzdIAGbynY5Mjaz3g; Expires=Wed, 28-Jul-2021 10:00:40 GMT; HttpOnly; Path=/

{"responseHeader":{"status":400,"QTime":1,"params":{"q":"doi:10.1007/jhep07(2013)041","fl":"bibcode,citation_count","start":"0","internal_logging_params":"X-Amzn-Trace-Id=Root=1-5f1fa2e8-415e19707bffd2ffa6d5e046","rows":"10","wt":"json"}},"error":{"metadata":["error-class","org.apache.solr.common.SolrException","root-error-class","java.lang.Exception"],"msg":"org.apache.solr.search.SyntaxError: INVALID_SYNTAX_CANNOT_PARSE: Syntax Error, cannot parse doi:10.1007/jhep07(2013)041: The parser reported a syntax error, antlrqueryparser hates errors! ","code":400}} """)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/adsabs/adsabs-dev-api/issues/66, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABKDRFPGM33PONKQGUL33MLR53RULANCNFSM4PKTRE2A .

eschnett commented 4 years ago

The DOI I try to resolve is 10.1007/jhep07(2013)041. I don't know how the dot made it into my text above – sorry. The error messages I quote have the correct DOI.

(This DOI is from arxiv.org. The author would have entered it. I don't know whether arxiv.org validates DOIs.)

csgrant00 commented 4 years ago

Erik, You need to put quotes around the doi, the syntax is doi:"10.1007/jhep07(2013)041"

which then needs to be escaped to work with the API:

https://api.adsabs.harvard.edu/v1/search/query?q=doi:%2210.1007%2Fjhep07%282013%29041%22&fl=DOI

Hope this helps.

-Carolyn


Carolyn Stern Grant Astrophysics Data System (ADS)

cgrant@cfa.harvard.edu Center for Astrophysics

617-495-7154 (voicemail) 60 Garden Street MS 83

617-495-7356 fax Cambridge, MA 02138


On Thu, Jul 30, 2020 at 3:21 PM Erik Schnetter notifications@github.com wrote:

The DOI I try to resolve is 10.1007/jhep07(2013)041. I don't know how the dot made it into my text above – sorry. The error messages I quote have the correct DOI.

(This DOI is from arxiv.org. The author would have entered it. I don't know whether arxiv.org validates DOIs.)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/adsabs/adsabs-dev-api/issues/66#issuecomment-666626963, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABKDRFJTPXV72OE2XQDAG2DR6HB2FANCNFSM4PKTRE2A .

eschnett commented 4 years ago

Thanks for the pointer.