Topic on Project:Support desk

Does it possible to Query the given questions below?

6
Ramu ummadishetty (talkcontribs)
What is the total number of orphan articles on Wikipedia?
What is the total number of dead-end articles on Wikipedia?
What is the total number of articles on Wikipedia that have at least one media element (picture or video)?
What is the total number of articles on Wikipedia that have more than one media element (picture or video)?
What is the total number of articles on Wikipedia that have infoboxes?
What is the total number of articles on Wikipedia that links to (or powered/controlled by) Wiki data?
What is the total number of Wikidata Items connected to articles on Wikipedia
What is the total number of articles on Wikipedia that are marked as stubs?
What is the Average edits per page
What is the total number of articles on Telugu Wikipedia that are marked as featured articles?

using https://quarry.wmflabs.org/ .

Bawolff (talkcontribs)

yes for all of these, however for some of these you can only do the query for one specific language edition of wikipedia.

That said, actually making the queries is a lot of work. Some of the queries would likely timeout before giving sn answer on large languages. They might be runnable via toolforge shell but not quarry web frontend.

Ramu ummadishetty (talkcontribs)

I don't have any idea for above queries like which tables to use in database... Can I get one example using toolforge shell ? coz i never used it . Can it possible to fetch using API's?

This post was hidden by Ramu ummadishetty (history)
Bawolff (talkcontribs)

most of these would use page, pagelinks, page_props, and templatelinks. Some would use others.

Ramu ummadishetty (talkcontribs)

@Bawolff Thank you for suggesting Toolforge . I got approval for shell access able to query.

Only concern is I am unable to query some of the question that I mentioned in the list. I would like to have queries for them.

I tried few queries but not sure those are right. I would like you to check this queries

Wikipedia pages without images ?

SELECT page_title

FROM page

LEFT JOIN imagelinks ON il_from=page_id

WHERE page_namespace=0 AND page_is_redirect=0 AND il_from IS  NULL

LIMIT 200;

What is the total number of Wikidata Items connected to articles on Wikipedia?

USE wikidatawiki_p;

SELECT CONCAT("Q",ips_item_id), CONCAT("Lml"), CONCAT('"',ips_site_page,'"')

FROM wb_items_per_site

WHERE ips_site_id='hiwiki' AND NOT EXISTS (

  SELECT 1 FROM wb_terms WHERE CONCAT("Q", ips_item_id) = term_full_entity_id AND term_type = "label" AND term_language='hi' LIMIT 1

);

What is the total number of articles on Wikipedia that are marked as stubs?

I don't what to take size of article to consider as it as stub one so i did like this it might be wrong

select page_title, page_len from page where page_len < '2000' and page_namespace = 0 and page_is_redirect = 0;


What is the total number of articles on Wikipedia that have infoboxes?

not done

SELECT page_title

FROM page, imagelinks

WHERE page_namespace = 0

AND page_is_redirect = 0

AND page_id NOT IN (

  SELECT il_from

  FROM imagelinks

  WHERE il_from_namespace = 0

  GROUP BY(il_from)

    )

AND (

    NOT EXISTS(

        SELECT

        1

        FROM commonswiki_p.page

        WHERE page_title = il_to

        AND page_namespace = 6

    )

)

What is the total number of articles on Wikipedia that have at least one media element (picture or video)?

SELECT page_title FROM page LEFT JOIN imagelinks ON il_from=page_id WHERE page_namespace=0 AND page_is_redirect=0 AND page_len > 10 AND il_from IS NOT NULL;


What is the Average edits per page

I am to get this number from stats page


unable to query the remaining I need some help in this.

What is the total number of articles on Wikipedia that have more than one media element (picture or video)?

select count(*) from

(SELECT page_title , count(*) as cou

FROM page

LEFT JOIN imagelinks ON il_from=page_id

WHERE page_namespace=0 AND page_is_redirect=0 AND il_from IS not NULL  GROUP BY il_from having cou > 1) as tit;

What is the total number of dead-end articles on Wikipedia?

SELECT count(*)

FROM page

LEFT JOIN pagelinks ON pl_from=page_id

WHERE page_namespace=0 AND page_is_redirect=0 AND  pl_from IS  NULL ;

Reply to "Does it possible to Query the given questions below?"