Hi, all,
Looking at the database layout (http://www.mediawiki.org/wiki/Manual:Database_layout), I see that there are several link tables. There's the externallinks table, categorylinks table, langlinks table, pagelinks table, imagelinks table, and even a perennially-empty trackbacks table, but there is one kind of links that is not covered by these tables: Interwiki links. The recent, um, "controversy" made me wonder how many of these interwikis are actually used, but that information is not stored anywhere.
Would adding a table to the schema be useful? Thinking about it, it would have a layout similar to the langlinks table, so it would be like this:
mysql> DESCRIBE mw_interwiki; +----------+-----------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +----------+-----------------+------+-----+---------+-------+ | in_from | int(8) unsigned | NO | PRI | 0 | | | in_lang | varchar(10) | NO | PRI | NULL | | | in_title | varchar(255) | NO | | NULL | | +----------+-----------------+------+-----+---------+-------+ 3 rows in set (0.01 sec)
So, would it be a good idea to do this? It would allow things like [[Special:Linksearch]] for interwikis. Thoughts? Comments?
Titoxd.
On 05/05/07, Titoxd@Wikimedia titoxd.wikimedia@gmail.com wrote:
Would adding a table to the schema be useful? Thinking about it, it would have a layout similar to the langlinks table, so it would be like this:
Proper implementation of inter-project links is bug 708 (http://bugzilla.wikimedia.org/show_bug.cgi?id=708), assigned to Erik Moeller, although there's no code to show for it.
I would assume a "projectlinks" table would be added as part of this.
Rob Church
If I understand that bug correctly, what users want is interwiki links to show up at the bottom of the sidebar, similar to what langlinks do now. While that is a good idea, I'm not really talking about that... I'm thinking rather just laying down the architecture, to be able to check the usage of interwiki links. Interwikis that are never used could be pruned from the interwiki table, for example. Also, it would help in imports, to know which "external" pages link to a given page in a particular wiki. Even further, that idea can be extended to keep track of all wikis that link to our wiki, within *our* wiki. That second idea can be accomplished using *another* table. It would look kind of like this: mysql> DESCRIBE mw_interwikilinksin; +------------+-----------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +------------+-----------------+------+-----+---------+----------------+ | iwn_id | int(8) unsigned | NO | PRI | NULL | auto_increment | | iwn_prefix | varchar(10) | NO | PRI | NULL | | | iwn_lang | varchar(10) | NO | PRI | NULL | | | iwn_from | int(8) unsigned | NO | | 0 | | | iwn_title | varchar(255) | NO | PRI | NULL | | +------------+-----------------+------+-----+---------+----------------+ 5 rows in set (0.02 sec) The method behind my madness would be as follows: * iwn_id: unique primary key. * iwn_prefix would be the interwiki prefix of the page in the external wiki (let's call it page A) that is linking to a page in our wiki (page B). * iwn_lang is the language subdomain of page A, if it exists. * iwn_from is the title of page A, including namespaces. * iwn_title is the title of page B. Perhaps we should use page_id, but I'm not sure. This brings some interesting issues, though: # How do you send an "interwiki ping" to update the tables? # What happens when page A is edited to remove page B, and the server for page B is unavailable? # How do you deal with stale tables, etc? You can't really rebuild incoming links tables... # What do you do on page deletes, and such? Do you notify page A's wiki somehow? #Of course, you wouldn't want every single wiki out there to send update requests to your wiki, so wiki B would only update the tables if wiki A is part of its interwiki map, and has iw_local set to 1. Wiki A should send that request if it has wiki B on its interwiki map with iw_local set to 1 as well. But is there any other more elegant method? I'm just asking to try to get the ball rolling. This seems like a relatively useful thing, and even if the incoming interwiki links table seems like a huge mess to implement, the projectlinks (or interwikilinks) table is IMO a good idea. Titoxd.
-----Original Message----- From: Rob Church [mailto:robchur@gmail.com] Sent: Friday, May 04, 2007 8:36 PM To: Wikimedia developers Subject: Re: [Wikitech-l] Create interwikilinks table
On 05/05/07, Titoxd@Wikimedia titoxd.wikimedia@gmail.com wrote:
Would adding a table to the schema be useful? Thinking about it, it would have a layout similar to the langlinks table, so it would be like this:
Proper implementation of inter-project links is bug 708 (http://bugzilla.wikimedia.org/show_bug.cgi?id=708), assigned to Erik Moeller, although there's no code to show for it.
I would assume a "projectlinks" table would be added as part of this.
Rob Church
Titoxd@Wikimedia wrote:
If I understand that bug correctly, what users want is interwiki links to show up at the bottom of the sidebar, similar to what langlinks do now. While that is a good idea, I'm not really talking about that... I'm thinking rather just laying down the architecture, to be able to check the usage of interwiki links. Interwikis that are never used could be pruned from the interwiki table, for example. Also, it would help in imports, to know which "external" pages link to a given page in a particular wiki. Even further, that idea can be extended to keep track of all wikis that link to our wiki, within *our* wiki. That second idea can be accomplished using *another* table. It would look kind of like this: mysql> DESCRIBE mw_interwikilinksin; +------------+-----------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +------------+-----------------+------+-----+---------+----------------+ | iwn_id | int(8) unsigned | NO | PRI | NULL | auto_increment | | iwn_prefix | varchar(10) | NO | PRI | NULL | | | iwn_lang | varchar(10) | NO | PRI | NULL | | | iwn_from | int(8) unsigned | NO | | 0 | | | iwn_title | varchar(255) | NO | PRI | NULL | | +------------+-----------------+------+-----+---------+----------------+ 5 rows in set (0.02 sec) The method behind my madness would be as follows:
- iwn_id: unique primary key.
- iwn_prefix would be the interwiki prefix of the page in the external wiki
(let's call it page A) that is linking to a page in our wiki (page B).
- iwn_lang is the language subdomain of page A, if it exists.
- iwn_from is the title of page A, including namespaces.
- iwn_title is the title of page B. Perhaps we should use page_id, but I'm
not sure.
I guess this should read: * iwn_title is the title of page A, without namespaces (available at iwn_prefix). * iwn_title is the page_id of page B. Perhaps we should use the title.
I'm just asking to try to get the ball rolling. This seems like a relatively useful thing, and even if the incoming interwiki links table seems like a huge mess to implement, the projectlinks (or interwikilinks) table is IMO a good idea. Titoxd.
Ack, handling remote incoming links is a madness. Simply keep out outgoing links. If we're concerned about having to process all the wikis, make it optionally shared between all the wikis.
wikitech-l@lists.wikimedia.org