Wikipedia:Request a query
|
|||||
This page has archives. Sections older than 14 days may be automatically archived by Lowercase sigmabot III when more than 4 sections are present. |
This is a page for requesting one-off database queries for certain criteria. Users who are interested and able to perform SQL queries on the projects can provide results from the Quarry website.
You may also be interested in the following:
- If you are interested in writing SQL queries or helping out here, visit our tips page.
- If you need to obtain a list of article titles that meet certain criteria, consider using PetScan (user manual) or the default search. Petscan can generate list of articles in subcategories, articles which transclude some template, etc.
- If you need to make changes to a number of articles based on a particular query, you can post to the bot requests page, depending on how many changes are needed.
- For long-term review and checking, database reports are available.
Quarry does not have access to page content, so queries which require checking wikitext cannot be answered with database queries. In particular, there is no way to query for template parameters or anything related to references. However, someone may be able to assist by using Quarry in another way (for example, checking for external links rather than references) or suggest an alternative tool.
Longest untouched user subpages
[edit]I would be curious to see a list of userspace subpages that have gone the longest without being touched. I suspect there are tons and tons of abandoned pieces of articles by long-gone users. BD2412 T 19:30, 14 March 2025 (UTC)
- "Touched" has a specific but somewhat obscure meaning in this context; do you mean that, or - as I suspect - just time since last edit? (quarry:query/91716 for the latter.) —Cryptic 21:00, 14 March 2025 (UTC)
- I mean last edit, yes, thanks. BD2412 T 21:37, 14 March 2025 (UTC)
- Now I am wondering if this can be correlated against the length of time since the user's last edit, so we can see which are subpages from long-gone editors. BD2412 T 22:08, 14 March 2025 (UTC)
- I've updated the query in-place. —Cryptic 23:47, 14 March 2025 (UTC)
- Brilliant, many thanks. BD2412 T 00:54, 15 March 2025 (UTC)
- I've updated the query in-place. —Cryptic 23:47, 14 March 2025 (UTC)
- Now I am wondering if this can be correlated against the length of time since the user's last edit, so we can see which are subpages from long-gone editors. BD2412 T 22:08, 14 March 2025 (UTC)
- I mean last edit, yes, thanks. BD2412 T 21:37, 14 March 2025 (UTC)
Inactive autopatrolled users
[edit]Hi! Would it be possible to get a list of users who have WP:AUTOPATROL and have not made edits in the past 365 days? Thanks, HouseBlaster (talk • he/they) 06:37, 28 March 2025 (UTC)
- quarry:query/92230. 1639 out of 4870, awesome. 917 of them have no edits in the last 5 years. Two have no edits ever. —Cryptic 08:28, 28 March 2025 (UTC)
- ... both of which are alt accounts of admins. More striking that the no edits ever cases is that the otherwise-most-inactive autopatrolled user is Nichalp, who somewhat infamously lost most of their permissions for undisclosed paid editing. * Pppery * it has begun... 15:38, 28 March 2025 (UTC)
- Yeah, that stuck out at me too. Also that they got autopatrolled and pcr almost a year and a half after their last edit, and almost exactly a year after all their permissions were revoked. —Cryptic 17:06, 28 March 2025 (UTC)
- ... both of which are alt accounts of admins. More striking that the no edits ever cases is that the otherwise-most-inactive autopatrolled user is Nichalp, who somewhat infamously lost most of their permissions for undisclosed paid editing. * Pppery * it has begun... 15:38, 28 March 2025 (UTC)
Unusually large redirect talk archives
[edit]I recently found out that when pages and their archives are moved but archive template is not updated, ClueBot III keeps adding talk sections below the old location of archive (which is now a redirect). See Special:History/Talk:2024 Kolkata rape and murder incident/Archive 1. I need a list of talk archives that are redirects but are also unusually large (>250 bytes), ordered by page size in descending order. Thanks! —CX Zoom[he/him] (let's talk • {C•X}) 16:15, 2 April 2025 (UTC)
- quarry:query/92487. —Cryptic 17:41, 2 April 2025 (UTC)
- And quarry:query/92489 has a version that limits it to pages with at least one edit by one of the accounts in Category:Wikipedia archive bots. —Cryptic 18:02, 2 April 2025 (UTC)
- ...though I should've foreseen that one-click-archiver would've made that idea unhelpful. (Special:History/Talk:2020 Nagorno-Karabakh conflict/Archive 13, for example.) quarry:query/92490 instead looks for at least one edit with a summary containing "rchiv" and that wasn't made by User:AnomieBOT or User:Xqbot. —Cryptic 18:15, 2 April 2025 (UTC)
- Thank you very much! —CX Zoom[he/him] (let's talk • {C•X}) 19:15, 2 April 2025 (UTC)
- ...though I should've foreseen that one-click-archiver would've made that idea unhelpful. (Special:History/Talk:2020 Nagorno-Karabakh conflict/Archive 13, for example.) quarry:query/92490 instead looks for at least one edit with a summary containing "rchiv" and that wasn't made by User:AnomieBOT or User:Xqbot. —Cryptic 18:15, 2 April 2025 (UTC)
- And quarry:query/92489 has a version that limits it to pages with at least one edit by one of the accounts in Category:Wikipedia archive bots. —Cryptic 18:02, 2 April 2025 (UTC)
Articles with a particular template missing a data element from that template
[edit]How would I create query that finds all articles with a template (e.g. "Infobox university") that are missing a particular data element in that template (e.g. "logo")? A couple scenarios I'm thinking of:
- University articles missing the school logo
- Album articles missing cover art
- Musician articles missing image of person
TIA - hope this isn't too much of a newb question for this request page! — Preceding unsigned comment added by Widgetkid (talk • contribs) 16:48, 2 April 2025 (UTC)
- In practical terms, you can't - template parameters aren't exposed to the database except as part of the wikitext, so you'd have to parse that yourself; and the text isn't copied to the database replicas, so you'd have to download a dump to do even that. Or grab the pages' text from the API, if you can narrow the set enough - Special:Whatlinkshere/Template:Infobox university has close to 27000 pages on it, which is about two orders of magnitude too many for that approach to work well. (Top of this page:
Quarry does not have access to page content, so queries which require checking wikitext cannot be answered with database queries. In particular, there is no way to query for template parameters or anything related to references.
) The usual solution is to change the template to add a tracking category. —Cryptic 17:51, 2 April 2025 (UTC)- Thanks @Cryptic! Can you tell me more about how the solution with adding a tracking category would work (or point me to an example)? I'm good with rolling up my sleeves to find a way to do this. 😀 ⚙️ WidgetKid 🙈🙉🙊 19:37, 2 April 2025 (UTC)
- {{Infobox university}} in particular actually already does this - search its source for "Category:Pages using infobox university with the image name parameter". —Cryptic 19:40, 2 April 2025 (UTC)
- Thanks @Cryptic! Can you tell me more about how the solution with adding a tracking category would work (or point me to an example)? I'm good with rolling up my sleeves to find a way to do this. 😀 ⚙️ WidgetKid 🙈🙉🙊 19:37, 2 April 2025 (UTC)