WSoR datasets/wp template links

From Meta, a Wikimedia project coordination wiki
Jump to navigation Jump to search

This table contains a list of templates that links to the WikiProjects in table wikiproject_pages.

Location[edit]

db1048:shawn.wp_template_links

Fields[edit]

	shawn@internproxy:~$ mysql -h db1048 -e "EXPLAIN wp_template_links;SELECT * FROM wp_template_links LIMIT 3" shawn
	+------------------+----------------+------+-----+---------+-------+
	| Field            | Type           | Null | Key | Default | Extra |
	+------------------+----------------+------+-----+---------+-------+
	| page_id          | int(11)        | YES  | MUL | NULL    |       |
	| page_title       | varbinary(255) | YES  | MUL | NULL    |       |
	| page_is_redirect | int(11)        | YES  |     | NULL    |       |
	| pl_title         | varbinary(255) | YES  |     | NULL    |       |
	| pl_from          | int(11)        | YES  |     | NULL    |       |
	| pages            | int(11)        | YES  |     | NULL    |       |
	+------------------+----------------+------+-----+---------+-------+
	+---------+---------------+------------------+-------------+---------+-------+
	| page_id | page_title    | page_is_redirect | pl_title    | pl_from | pages |
	+---------+---------------+------------------+-------------+---------+-------+
	|  390292 | POV           |                0 | WikiProject |  390292 |  NULL |
	|  392667 | Disputed      |                0 | WikiProject |  392667 |  NULL |
	|  469793 | Controversial |                0 | WikiProject |  469793 |  NULL |
	+---------+---------------+------------------+-------------+---------+-------+

Each row represents a a template that contains a link to a WikiProject page.

  • page_id: page id of the template
  • page_title: template title
  • page_is_redirect: if template is a redirect
  • pl_title: wikiproject name that this template links to
  • pl_from: id of the wikiproject main page
  • pages: number of pages this template is used on (not calculated)

Reproduction[edit]

Create Table:

	CREATE TABLE `wp_template_links` (
	  `page_id` int(11) DEFAULT NULL,
	  `page_title` varbinary(255) DEFAULT NULL,
	  `page_is_redirect` int(11) DEFAULT NULL,
	  `pl_title` varbinary(255) DEFAULT NULL,
	  `pl_from` int(11) DEFAULT NULL,
	  KEY `page_title` (`page_title`)
	) ENGINE=MyISAM DEFAULT CHARSET=binary;

Insert Statement:

	INSERT INTO wp_template_links
	SELECT p.page_id,
	       p.page_title,
	       p.page_is_redirect,
	       pl_title,
	       pl_from
	FROM   enwiki.page p,
	       wikiproject_pages wpp,
	       enwiki.pagelinks
	WHERE  pl_from = p.page_id
	   AND wpp.page_title = pl_title
	   AND page_namespace = 10
	   AND pl_namespace = 4;

Notes[edit]

This table was generated on 2011-08-12 23:23:37. It depends on the table wikiproject_pages.