Talk:Wikidata Query Service/Archive 1

More in Wikidata
See also suggestions at https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/suggestions

Duplicates and missing rows.
I am getting duplicates and missing rows. The duplicates seem to arise when the a value has been edited in the references. I do not know why the row is missing.

An example of a duplicate with the below SPARQL is "wd:Q21076992 * En røv bag øret" and the missing one is "wd:Q21083886 * Beton - historier fra skurvognen" from. I am also getting duplicate elements, e.g., "Ove Dahl, Ove Dahl (politi)". This seems also to be related to editing the value.

&mdash; Fnielsen (talk) 22:16, 15 October 2015 (UTC)
 * This issue has now been phabricated: https://phabricator.wikimedia.org/T116622 &mdash; Fnielsen (talk) 17:53, 26 October 2015 (UTC)

Scratch pad
A scratch pad beside the query box would be really convenient for quickly storing queries. The pgAdmin tool for managing Postgresql databases has had this feature for years (http://www.pgadmin.org/docs/1.6/images/query.png). The main use case is when people are experimenting with queries, they often need a temporary place (ends up being a text file) to store and compare variations of a query. This feature is an effective and "low-tech" alternative to providing multiple tabs for running queries.

Rename page and subpages
Should this page and subpages be titled 'Wikidata Query Service' ? John Vandenberg (talk) 02:37, 6 January 2016 (UTC)

Exceptions and timeouts using wikidata query service
Hi there,

there might be a problem with the current wikidata query service.

I try to write a tool, which can answer questions with given answer candidates. To accomplish this I match the children of a parsed entity from the question and match the found candidates with the given.

One way which is realy fast and effective is using queries like these:

But currently I am receiving timeouts or exceptions
 * This seems to be fine now. --Smalyshev (WMF) (talk) 18:43, 16 March 2016 (UTC)

"Execute" shortcut
Can we have a keyboard shortcut for the "Execute" button, please? --Magnus Manske (talk) 12:34, 9 March 2016 (UTC)

"Error:"
This one gives a blank error. Query via WDQ2SPARQL, converted from CLAIM[131:(TREE[1198][150][131])] AND CLAIM[31:(TREE[473972][][279])]. --Magnus Manske (talk) 18:39, 10 March 2016 (UTC)
 * I think that is the same as T127014 added as another example there. - Jan Zerebecki 14:32, 11 March 2016 (UTC)
 * Yes, there's something fishy there, I'm looking into it. Smalyshev (WMF) (talk) 18:43, 16 March 2016 (UTC)

Old short links are broken
Something seems to have happened recently that broke old short URLs, such as tinyurl.com/htb92er. You can see the query in the final URL, but it doesn't appear in the box, and can't be executed. Cheers, Bovlb (talk) 20:55, 22 March 2016 (UTC)
 * Which browser are you using? --Lydia Pintscher (WMDE) (talk) 15:58, 23 March 2016 (UTC)
 * That's an excellent question, so I did some testing. I observe this problem using Google Chrome Version 49.0.2623.87 (64-bit) on MacOS, and also using an unknown version of Google Chrome on Windows.  I do not observe it in Safari 8.0.7 or Firefox 35.0.1.  This used to work fine in Google Chrome, and I'm not aware that I've updated since it was working.  The expanded URL is  which also fails on Google Chrome.  I also observe the same behaviour using the new short link mechanism.  Looking in the JavaScript console, I see this error;

App.js:126 Uncaught TypeError: this._editor.registerCallback is not a function
 * UPDATE: As I did more testing, the problem disappeared, and old links started working in Chrome. Did you update the site?  Now the only console message I see is the relatively benign:

modernizr-2.8.3-respond-1.4.2.min.js:4 Mixed Content: The page at 'https://query.wikidata.org/#SELECT%20%3Fx%20%3FxLabel%20(MIN(%3Fdate)%20AS%…20%7D%0A%7D%20GROUP%20BY%20%3Fx%20%3FxLabel%20ORDER%20BY%20DESC(%3Fmindate)' was loaded over HTTPS, but requested an insecure font 'http://themes.googleusercontent.com/static/fonts/inconsolata/v5/BjAYBlHtW3CJxDcjzrnZCIbN6UDyHWBl620a-IRfuBk.woff'. This request has been blocked; the content must be served over HTTPS.
 * Cheers, Bovlb (talk) 16:16, 23 March 2016 (UTC)


 * It seems your browser cache had an old version of Editor.js which broke App.js

✅ (caching problem)

Query Logs
Hello,

would it be possible to get query logs of Wikidata (https://query.wikidata.org/)? I'd love to have them for my research project. Thanks a lot!

Fadirra (talk) 13:54, 31 March 2016 (UTC)

Missing ps/pq
It appears that the ps and pq prefixes are automatically added in the web interface, but not in https://query.wikidata.org/sparql?format=json&query= The automatic prefixes should be consistent. --Magnus Manske (talk) 20:28, 12 April 2016 (UTC)

WDQ2SPARQL query timeout
So I have a deceptively simple WDQ query: CLAIM[1435:(TREE[916475][][279])] AND CLAIM[131:(TREE[12526][][131])] which WDQ2SPARQL converts to SELECT ?item WHERE { ?item wdt:P1435 ?sub0. ?sub0 (wdt:P279)* wd:Q916475. ?item wdt:P131 ?sub1. ?sub1 (wdt:P131)* wd:Q12526 } Now, WDQ returns the ~1000 items in about 1 second. However, the SPARQL query (can't link to it, because tinyurl prevents me from saving the page) times out (still returns JSON though?). Is there anything you can do on the SPARQL engine or WDQ2SPARQL to improve this? I would like to retire WDQ sooner rather than later, but as long as auto-conversion essentially breaks functionality in downstream tools, I can't do it. --Magnus Manske (talk) 14:22, 13 April 2016 (UTC)

Sardinia (Q1462) is not returned when I query for regions of Italy (Q16110)
This query should return 20 regions but instead only returns 19. Sardinia for some reason is missing. I checked and the relation Q16110 seems to be correctly declared for Sardinia.

This is my query

SELECT * WHERE {?resource wdt:P31 wd:Q16110.}

and this is the result

resource wd:Q1210 wd:Q1216 wd:Q1222 wd:Q1237 wd:Q1243 wd:Q1250 wd:Q1256 wd:Q1263 wd:Q1273 wd:Q1279 wd:Q1280 wd:Q1282 wd:Q1284 wd:Q1438 wd:Q1443 wd:Q1447 wd:Q1452 wd:Q1458 wd:Q1460

FrBailo (talk) 14:40, 13 April 2016 (UTC)
 * It's in wdq: http://wdq.wmflabs.org/api?q=claim[31:16110] --Magnus Manske (talk) 15:01, 13 April 2016 (UTC)