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(a)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