Wikipedia:Request a query

From Wikipedia, the free encyclopedia
(Redirected from Wikipedia:RAQ)

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 Quarry. However, someone may be able to assist by using Quarry in another way (e.g. checking the table of category links rather than the "Category:" text) or suggest an alternative tool.

Redirects connected to a Wikidata item that target a disambiguation page[edit]

I attempted this in quarry:query/82243, but I may well have missed things that would make it more efficient. I’m wondering if the time it takes to run is purely a symptom of having to look through two very large categories, or if anyone’s aware of things that might improve it. All the best :) ‍—‍a smart kitten[meow] 18:14, 24 April 2024 (UTC)[reply]

The GROUP_CONCAT() followed by FIND_IN_SET() is going to perform a lot worse than just joining the second category - quarry:query/82254. —Cryptic 20:10, 24 April 2024 (UTC)[reply]
Ah, thank you! I don't know why that didn't occur to me. {{self-trout}} ‍—‍a smart kitten[meow] 20:48, 24 April 2024 (UTC)[reply]

Check for company articles that use both Parent and Owner field.[edit]

I'm wondering if it would be possible to check for articles that use both the Parent and Owner field in infobox company. The reason being, I have noticed that many articles incorrectly use the infobox company template to show higher-level ownership. This is not allowed per the infobox documentation. I have fixed this on most pages. However, there are many that I cannot find. WiinterU 22:45, 27 April 2024 (UTC)[reply]

@WiinterU: Quarry can't do that, because it doesn't have access to the wikitext. This search should catch most of the offenders but will contain a lot of false positives, such as articles with parent= and owner= in different infoboxes. Certes (talk) 08:35, 28 April 2024 (UTC)[reply]
Okay, thank you. WiinterU 12:31, 28 April 2024 (UTC)[reply]
(edit conflict) Hah. I typed up almost the same thing as Certes, so will defer to their great answer. –Novem Linguae (talk) 09:05, 28 April 2024 (UTC)[reply]

Query to get all articles without inline citations[edit]

Can somebody here help me write a query for all articles that don't have <ref> or {{sfn or {{sfnm or {{harvnb in the article's wikicode? Here is the context of the discussion: User_talk:CactiStaccingCrane#Untagged_unreferenced_articles CactiStaccingCrane (talk) 13:41, 4 May 2024 (UTC)[reply]

I don't believe occurrences of <ref> are stored in any table to which Quarry has access. Certes (talk) 20:09, 4 May 2024 (UTC)[reply]
Agreed. According to my sandbox, ref tags aren't placed into any categories, so we can't search the categorylinks table either. The others that OP mentioned can be queried via the templatelinks table. Or, for new pages, you can use Special:NewPagesFeed, and tick the filter for "have no citations", which should detect most of these but maybe not all (I forget which ones). WP:PETSCAN could also be useful since I think it lets you search by templates and/or categories. OP, what direction would you like to go in with this? –Novem Linguae (talk) 20:30, 4 May 2024 (UTC)[reply]
It's also possible to query for use of {{Reflist}} and similar, though many articles use a bare <references /> tag. Certes (talk) 20:43, 4 May 2024 (UTC)[reply]
We could generate a list of pages without any external links at all, or no external links except to specific sites like imdb. That's functionally the same thing - there's no real difference between a formally unreferenced page that has its subject's official site properly placed in ==External links==, and one that plugs it into ref tags instead. —Cryptic 22:10, 4 May 2024 (UTC)[reply]
Or pages that don't transclude anything in the Category:Citation templates tree. Which will miss bare <ref>[external link]</ref>s, of course; I suppose we could mitigate by also excluding pages in Category:All articles with bare URLs for citations, and tag the remaining false positives as they're noticed. —Cryptic 22:19, 4 May 2024 (UTC)[reply]
You're looking at quite a lot of pages. For example, there are about 30,000 with titles beginning with A. [1]. Many of them have a References section with plausible looking citations but no inline refs. Certes (talk) 22:56, 4 May 2024 (UTC)[reply]
CactiStaccingCrane, I wonder if it would be easier to start with the known 50,000 articles that transclude {{no footnotes}}? Once editors are done with those, come on back and we'll figure out how to find more. – Jonesey95 (talk) 03:39, 5 May 2024 (UTC)[reply]
The linked discussion shows the original user was specifically looking for unreferenced pages that aren't already tagged. (I can't imagine why, unless the intent is merely to tag them without actually looking for sources, but whatever.) —Cryptic 07:13, 5 May 2024 (UTC)[reply]
Yeah that's exactly the point. Both of us are on WP:WikiProject Unreferenced articles and we want to tag all articles that don't have citations before launching another drive around June-July. CactiStaccingCrane (talk) 09:09, 5 May 2024 (UTC)[reply]

ListeriaBot issue[edit]

I already have a query, albeit SPARQL, but been running into this issue and I thought somebody could help here. Thanks! Assem Khidhr (talk) 05:11, 12 May 2024 (UTC)[reply]