At seemingly random intervals, WDQS responses are truncated after headers (no body is sent). Example of the error:
$ curl -v 'https://query.wikidata.org/#PREFIX%20wd%3A%20%3Chttp%3A%2F%2Fwww.wikidata.org%2Fentity%2F%3E%0APREFIX%20wdt%3A%20%3Chttp%3A%2F%2Fwww.wikidata.org%2Fprop%2Fdirect%2F%3E%0A%0ASELECT%20%3Fi%20WHERE%20{%0A%20%20%20%3Fi%20wdt%3AP31%2Fwdt%3AP279*%20wd%3AQ44%20.%0A}' * Trying 91.198.174.217... * Connected to query.wikidata.org (91.198.174.217) port 443 (#0) * found 173 certificates in /etc/ssl/certs/ca-certificates.crt * found 704 certificates in /etc/ssl/certs * ALPN, offering http/1.1 * SSL connection using TLS1.2 / ECDHE_ECDSA_AES_128_GCM_SHA256 * server certificate verification OK * server certificate status verification SKIPPED * common name: *.wikipedia.org (matched) * server certificate expiration date OK * server certificate activation date OK * certificate public key: EC * certificate version: #3 * subject: C=US,ST=California,L=San Francisco,O=Wikimedia Foundation\, Inc.,CN=*.wikipedia.org * start date: Thu, 10 Dec 2015 23:22:05 GMT * expire date: Sat, 10 Dec 2016 22:46:04 GMT * issuer: C=BE,O=GlobalSign nv-sa,CN=GlobalSign Organization Validation CA - SHA256 - G2 * compression: NULL * ALPN, server accepted to use http/1.1 > GET / HTTP/1.1 > Host: query.wikidata.org > User-Agent: curl/7.43.0 > Accept: */* > < HTTP/1.1 200 OK < Date: Wed, 11 May 2016 12:31:07 GMT < Content-Type: text/html < Content-Length: 15042 < Connection: keep-alive < Server: nginx/1.9.4 < Last-Modified: Sat, 07 May 2016 20:29:34 GMT < ETag: W/"572e502e-3ac2" < X-Served-By: wdqs1002 < X-Varnish: 1682612771 1682600741, 170952985 170935056, 25959566 29460572 < Via: 1.1 varnish, 1.1 varnish-v4, 1.1 varnish-v4 < Vary: Accept-Encoding < Age: 11 < X-Cache: cp1061 hit(2), cp3007 hit(1), cp3008 frontend hit(1) < Strict-Transport-Security: max-age=31536000; includeSubDomains; preload < Set-Cookie: WMF-Last-Access=11-May-2016;Path=/;HttpOnly;secure;Expires=Sun, 12 Jun 2016 12:00:00 GMT < X-Analytics: https=1;nocookies=1 < X-Client-IP: 178.196.145.38 < Accept-Ranges: bytes < * transfer closed with 15042 bytes remaining to read * Closing connection 0 curl: (18) transfer closed with 15042 bytes remaining to read