openphacts / GLOBAL

Global project issues [private for now. owner lee harland]
3 stars 0 forks source link

no result with _pageSize all #368

Open danidi opened 8 years ago

danidi commented 8 years ago

Using pageSize all with one molecule in the Patents for compound: list API call and using _pageSize all returns an error (There was an error parsing the JSON document. The document may not be well-formed. unexpected end of data at line 1 column 1):

https://beta.openphacts.org/2.1/patent/byCompound?uri=http%3A%2F%2Fops.rsc.org%2FOPS2010417&app_id=f91c5b2b&app_key=18a5d823d0e4933ac5fe22a3d52974c1&_pageSize=all

Specifying _format=json returns the result correctly. https://beta.openphacts.org/2.1/patent/byCompound?uri=http%3A%2F%2Fops.rsc.org%2FOPS2010417&app_id=f91c5b2b&app_key=18a5d823d0e4933ac5fe22a3d52974c1&_format=json&_pageSize=all

danidi commented 8 years ago

For the pharmacology call, the behaviour is different: https://beta.openphacts.org/2.1/compound/pharmacology/pages?uri=http%3A%2F%2Fwww.conceptwiki.org%2Fconcept%2F38932552-111f-4a4e-a46a-4ed1d7bdf9d5&app_id=f91c5b2b&app_key=18a5d823d0e4933ac5fe22a3d52974c1&_pageSize=all&_format=json gives an incomplete result (beginning is missing).

Setting page to 0 works, and also removing the _format=json parameter: https://beta.openphacts.org/2.1/compound/pharmacology/pages?uri=http%3A%2F%2Fwww.conceptwiki.org%2Fconcept%2F38932552-111f-4a4e-a46a-4ed1d7bdf9d5&app_id=f91c5b2b&app_key=18a5d823d0e4933ac5fe22a3d52974c1&_pageSize=all&_page=0&_format=json

danidi commented 8 years ago

It seems to make a difference if you run several queries in a row with different targets/compounds. The first will return the full result, the others are truncated.