Jump to content

User:JoeNMLC/Article orphan query

From Wikipedia, the free encyclopedia
⬆ Article cleanup
Find short articles
Article tracking
Helpful guidance
Tracking many categories

Orphan query

[edit]

Orphaned articles with more than two incoming links

The following is an edited excerpt from WP Talk - Orphan - Orphaned articles from July 2023 discussion. August 3, 2023.

On a aside-note, it seems like we've all found the same quarry - I use to run this quarry ( 9081 ) to find de-orphaned articles that can be de-tagged,
which I forked/copied from this quarry ( 6731 ) by GoingBatty
- just want to give cred. Jonatan Svensson Glad (talk) 20:10, 16 August 2023 (UTC)

@JoeNMLC Been a while since I am here. I just ran a similar query script ( 39296 ) as this DB report to detect more than 0 incoming link for Orphaned articles from July 2023... Justanothersgwikieditor

@JoeNMLC I have another query ( 38614 ) which list all the orphans but for your specific case, click the fork button on the top right so you will create a new query for yourself, change "Orphaned_articles_from_July_2023" to "Orphaned_articles_from_MONTH_YYYY" and then click "Submit Query" button. The "Orphaned_articles_from_MONTH_YYYY" format needs to follow the same "Orphaned articles from July 2023" similar to the category name (aka full month July, September instead of just Jul or Sep). Please note the query needs the underscore as it do not understand blank spaces.Justanothersgwikieditor

For the list of orphan articles to de-tag, run Query #38614, link below.

Query instructions

[edit]

Instructions to obtain a list of currently tagged orphan articles:

  1. Start query script tool.
  2. Click on "Fork" button, for first few times. After several requests, just click Log in.
  3. It should auto-login, otherwise Log in, and next time it should remember.
  4. Click on Home and select a recent request.
  5. Change category to query, for example: "Orphaned_articles_from_August_2023"
    Note the underscores are required.
    At line having COUNT(pl.pl_from)>1, leave at 1 for first pass;
    Change from "1" to zero for second pass.
  6. Click on "Submit Query" button.
  7. From results list, copy/paste into any plain text editor.
  8. Update the wikitable below, with "Before count" of articles in category.
  9. From the query article list, most articles can have orphan tag removed. A few may be disambig articles, so check every article "What links here" (ctrl-alt-j) to verify before removing the orphan tag.
  10. When done un-tagging orphan articles, enter "After count" of articles in category,
    and the "Reduction" number.

Query error and update

[edit]

On 7 June 2024, Orphaned queries failed. See details here.

  • Here is the error query:
USE enwiki_p;
SELECT p.page_title
FROM page p
INNER JOIN categorylinks c ON p.page_id = c.cl_from AND c.cl_to = "Orphaned_articles_from_June_2024"
INNER JOIN pagelinks pl ON p.page_title = pl.pl_title AND p.page_namespace = pl.pl_namespace
INNER JOIN page p2 ON p2.page_id = pl.pl_from
AND pl.pl_from_namespace = 0 and p2.page_is_redirect=0
GROUP BY p.page_title
having COUNT(pl.pl_from)>1
ORDER BY COUNT(pl.pl_from) desc, p.page_title;
On above, the second "INNER JOIN" is replaced below with two "JOIN" statements.
  • Here is the updated query:
    USE enwiki_p;
    SELECT p.page_title
    FROM page p
    INNER JOIN categorylinks c ON p.page_id = c.cl_from AND c.cl_to = "Orphaned_articles_from_June_2024"
    JOIN linktarget ON p.page_title = lt_title AND p.page_namespace = lt_namespace
    JOIN pagelinks pl ON lt_id = pl_target_id
    INNER JOIN page p2 ON p2.page_id = pl.pl_from
    AND pl.pl_from_namespace = 0 and p2.page_is_redirect=0
    GROUP BY p.page_title
    having COUNT(pl.pl_from)>1
    ORDER BY COUNT(pl.pl_from) desc, p.page_title;
    

Above changes are at Here you go. —Cryptic 21:15, 7 June 2024 (UTC)