Re: Querying Wikidata

On Mon, Jan 07, 2019 at 10:59:22AM +0100, Jean-Claude Moissinac wrote:
> Hello,
> 
> Is there a good mean to query the sparql wdqs service of wikidata?
> I've tried some python code to do it, with relative success.
> Success, because some requests gives the expected result.
> Relative, because the same query sometimes gives an empty response either
> from my code or directly in the WDQS interface, where it's possible to see
> that a sparql query sometimes gives an empty response, sometimes the
> expected reponse without message or status to know that the response is
> erroneous.
> official documentation

From your description, I'm imagining a few possible responses from
WDQS. Are you saying that you get back malformed HTTP responses
without a status code or a Reason-phrase or that you get a valid
response with a body and the body doesn't include some information?

OK-body-error: HTTP/1.1 200 OK\nContent-Length: NNN\n\n<some text conveying an error><EOF>
OK-no-body: HTTP/1.1 200 OK\n\n<EOF>
OK-empty-body: HTTP/1.1 200 OK\nContent-Length: 0\n\n<EOF>
OK-missing-body: HTTP/1.1 200 OK\nContent-Length NNN\n\n<EOF>


> (demo is difficult, because it seems to depend of the load of the wdqs
> service)
> I've found the following info:
> *
> https://www.mediawiki.org/wiki/Wikidata_Query_Service/User_Manual#Query_limits,
> which suggest a possible error HTTP code 429, which I never receive
> * https://phabricator.wikimedia.org/T179879, which suggest a possible
> connexion with OAuth, but such possibility is never documented in the

Are you getting some status code back but never a 429
(https://tools.ietf.org/html/rfc6585#section-4)? Is the connection
timing out or is it being terminated by the server? (I guess if you
only see this in response to long queries, maybe you can't tell if
your client timed out, TCP timed out, some server proxy timed out, or
a ulimit told the service to time out.)


> None of them gives a practical method to get a response and trust it.
> 
> Have you some advices?
> (comment: this question is relative to the post
> https://onsem.wp.imt.fr/2019/01/06/paris-musees-and-wikidata-establishing-links/
> )
> 
> 
> --
> Jean-Claude Moissinac

-- 
-eric

office: +1.617.258.5741 32-G528, MIT, Cambridge, MA 02144 USA
mobile: +1.617.599.3509

(eric@w3.org)
Feel free to forward this message to any list for any purpose other than
email address distribution.

Received on Monday, 7 January 2019 11:53:24 UTC