Wikidata talk:AutoList/List of queries
Categories edit
I'd like some category-based example autolist queries. For instance, w:it:Categoria:Nati nel 1901 items without Property:P569 set. --Nemo 15:54, 25 April 2014 (UTC)
As we can now edit from Autolist, I thought it could be useful to have a more structed page about queries that can be used for maintenance, so I started Wikidata:Periodical cleanup. --Zolo (talk) 20:31, 19 May 2014 (UTC)
New url edit
The url of autolist (autolist1) has changed. I suppose there is a reason to do so, but it has ruined all existing permalinks - even those of "useful lists" in this page. I suggest making redirects to keep all links working - if possible.--Pere prlpz (talk) 15:58, 14 October 2014 (UTC)
- It might have been changed because existing links kept crashing the server. --- Jura 17:17, 14 October 2014 (UTC)
- My permalinks (on my home) are redirected to the new root URL. Might have been added since. --LBE (talk) 21:50, 14 October 2014 (UTC)
Syntax question edit
How can I limit the results of claim[31:202444,31:11879590,31:12308941,31:3409032] and claim[31:4167410,31:101352]
on Autolist (currently 7078 given names) to items being used in P:P735?
I tried a version with TREE
, but this gave me the items that have P735. --- Jura 13:05, 19 November 2014 (UTC)
- I think that it is not possible directly with the syntax described at [1] for the following reasons:
- The inverse of the
CLAIM
command is not available. An approximation, which may return more results than desired, is possible using theTREE
command, however: - Unlike
CLAIM
, theTREE
command does not support subqueries.
- The inverse of the
- You will therefore need two queries:
- Query: claim[735:(claim[31:202444,31:11879590,31:12308941,31:3409032 and claim[31:4167410,31:101352])] &props=735]
- Ignore the returned
item
dictionary and look at theprops
dictionary, which contains the statements (value pairs). Make the list of the values on the right side of each pair (JavaScript should be usable for that) and supply them into the next query.
- Ignore the returned
- Query: items[result of the previous step and claim[31:202444,31:11879590,31:12308941,31:3409032] and claim[31:4167410,31:101352]]
- Query: claim[735:(claim[31:202444,31:11879590,31:12308941,31:3409032 and claim[31:4167410,31:101352])] &props=735]
- Hope that helps, Petr Matas 00:29, 21 November 2014 (UTC)
- BTW, introducing the inverse of given name (P735) should solve your problem as well. Petr Matas 01:00, 21 November 2014 (UTC)
- Thanks for your detailed explanation.
- Not sure if the inverse P735 will ever happen. That's what Reasonator is for ;) --- Jura 23:00, 23 November 2014 (UTC)
Bug? edit
Why is it that Query: claim[361:18552670] does not return Bunker Battery Den Hoorn (Q17460014)? Petr Matas 21:54, 20 November 2014 (UTC)
Order by ? edit
Hello, Is it possible to order the results by label ? --Scoopfinder (talk) 21:38, 27 December 2014 (UTC)
- Hello Scoopfinder, I don't think so, but it would be nice if Autolist could do that. Petr Matas 06:57, 29 December 2014 (UTC)
How to optimize edit
How can I get this to run: http://quarry.wmflabs.org/query/2857 ?
I had a version selecting just English labels which took about 6 minutes (max is 10 minutes). --- Jura 22:58, 29 March 2015 (UTC)
- Maybe
WHERE pl_from = ...
as the first condition. If this doesn't help, start it withFROM pagelinks JOIN wb_terms ON pl_from = ... AND ... WHERE
. Matěj Suchánek (talk) 11:52, 30 March 2015 (UTC)- Thanks for loooking into it. I gave it a try, but it still failed. Finally, I managed to avoid "concat", but adding another table. --- Jura 17:44, 30 March 2015 (UTC)
Query for official residences of governors edit
Sample of an official residence: Indiana Governor's Residence (Q14688448)
- At Q14688448#P366, this includes has use (P366) with official residence (Q481289) and qualifier of (P642) = Governor of Indiana (Q16147601)
- With Autolist, I could list it with
claim[366:481289]{claim[642:16147601]}
(autolist)
I'd like to expand to list to all official residences of governors.
- All US governors can be found with:
claim[279:889821]
(autolist) - How do I combine the two?
I tried claim[366:481289]{claim[642:(claim[279:889821])]}
but this fails. A list of the residences can be found at governors_of_US_states. --- Jura 14:36, 17 August 2015 (UTC)